@font-face {
    font-family: 'Find Sans Pro';
    src: url('fonts/FindSansPro-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'Find Sans Pro Medium';
    src: url('fonts/FindSansPro-Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
}

@font-face {
    font-family: 'Find Sans Pro Bold';
    src: url('fonts/FindSansPro-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
}

@font-face {
    font-family: 'Soyuz Grotesk Bold';
    src: url('fonts/SoyuzGroteskBold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Find Sans Pro', sans-serif;
}

body {
    height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: #000000;
    color: #eaeaea;
}

.app-main {
    display: flex;
    height: 100vh;
    align-items: flex-start;
}

.friends {
    width: 250px;
    height: 100vh;
    background-color: #0d0d0d;
    padding: 20px;
    border-right: 3px solid #1f1f1f;
    overflow-y: auto;
    color: #e0e0e0;
    flex-direction: column;
    display: flex;
}

.rooms-header,
.friends-header {
    padding: 15px;
    border-bottom: 1px solid #222;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 10;
    margin-bottom: 10px;
}

.rooms-header h3,
.friends-header h3 {
    font-size: 1.1em;
    color: #a89bb5;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-family: 'Find Sans Pro Bold', sans-serif;
    transition: color 0.1s ease, transform 0.1s ease;
    user-select: none;
}

.rooms-header h3:hover,
.friends-header h3:hover {
    color: #c39bff;
    text-shadow: 0 0 6px rgba(195, 155, 255, 0.6);
}

.room-in-list,
.friend {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 8px;
    border-radius: 20px;
    cursor: pointer;
    transition: background 0.1s ease;
}

.room-in-list:hover,
.friend:hover {
    background-color: #141414;
}

.room-in-list img,
.friend img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #1f1f1f;
    user-select: none;
}

.room-in-list-title-and-last-message,
.friend-name-status {
    display: flex;
    flex-direction: column;
}

.room-in-list-title,
.friend-name {
    font-family: "Find Sans Pro", sans-serif;
    color: #b19cd9;
}

.friend-status {
    font-family: "Soyuz Grotesk Bold", sans-serif;
    font-size: 0.85em;
    color: #888;
    margin-top: 2px;
    user-select: none;
}


/*СТИЛЬ СПИСКА КОМНАТ*/

.rooms {
    width: 350px;
    height: 100vh;
    background-color: #0d0d0d;
    flex-direction: column;
    border-right: 3px solid #1f1f1f;
    padding: 20px;
    overflow-y: auto;
    color: #e0e0e0;
}

.last-message-in-room-in-list{
    font-family: "Soyuz Grotesk Bold", sans-serif;
    font-size: 1em;
    color: #888;
    margin-top: 2px;
}


/*СТИЛЬ КОМНАТЫ*/

.room {
    width: 850px;
    height: 100vh;
    background-color: #0d0d0d;
    border-right: 3px solid #1f1f1f;
    overflow-y: auto;
    flex-direction: column;
    padding: 20px;
    color: #e0e0e0;
    display: flex;
    justify-content: space-between;
}

.room-header {
    border-bottom: 1px solid #222;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 10;
    margin-bottom: 1px;
    height: 52px;
}

.room-title {
    font-size: 1.3em;
    color: #a89bb5;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-family: 'Find Sans Pro Bold', sans-serif;
    transition: color 0.1s ease, transform 0.1s ease;
}

.room-members-amount {
    font-family: "Soyuz Grotesk Bold", sans-serif;
    font-size: 0.9em;
    color: #888;
    margin-top: 1px;
}

.room-placeholder {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    text-align: center;
    color: #666;
}

.room-placeholder h3 {
    font-family: 'Soyuz Grotesk Bold', sans-serif;
    font-size: 1.5em;
    margin-bottom: 10px;
    color: #a89bb5;
    text-transform: uppercase;
    user-select: none;
}

.room-placeholder p {
    font-size: 1em;
    color: #888;
}

.room:has(.room-header:not(:empty)) .room-placeholder {
    display: none;
}

.rooms-header {
    position: relative;
}

.add-room-btn,
.add-friend-btn {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%) translateZ(0);
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #a89bb5, #8a7ba3);
    color: #0d0d0d;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 3px 12px rgba(168, 155, 181, 0.3);
    padding: 0;
    backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
    filter: blur(0);
}

.add-room-btn:hover,
.add-friend-btn:hover {
    transform: translateY(-50%) scale(1.1) translateZ(0);
    box-shadow: 0 5px 18px rgba(168, 155, 181, 0.5);
}

.add-room-icon,
.add-room-btn svg,
.add-friend-btn svg {
    transform: none !important;
    transition: none !important;
    width: 18px;
    height: 18px;
}

.message-form {
    display: flex;
    align-items: center;
    padding: 10px;
    border-top: 2px solid #1f1f1f;
    background-color: #0d0d0d;
}

.message-input {
    flex: 1;
    background: #111;
    color: #ccc;
    border: 1px solid #222;
    border-radius: 20px;
    padding: 10px 15px;
    outline: none;
    font-family: 'Find Sans Pro', sans-serif;
    transition: border 0.1s ease, background 0.1s ease;
}

.message-input:focus {
    border-color: #a77bff;
    background: #151515;
}

.send-btn {
    background: linear-gradient(135deg, #a89bb5, #8a7ba3);
    border: none;
    border-radius: 50%;
    margin-left: 10px;
    width: 40px;
    height: 40px;
    color: #0d0d0d;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 3px 12px rgba(168, 155, 181, 0.3);
    transition: all 0.1s ease;
}

.message-input:placeholder-shown + .send-btn {
    opacity: 0.4;
    pointer-events: none;
}

.message-input:not(:placeholder-shown) + .send-btn {
    opacity: 1;
    pointer-events: auto;
}

/* Контейнер со всеми сообщениями */
/* Контейнер всех сообщений */
.messages {
    flex: 1;
    padding: 10px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    scroll-behavior: smooth;
}

/* Внешний контейнер для каждого сообщения с аватаркой */
.message-wrapper {
    display: flex;            /* аватар слева, сообщение справа */
    align-items: flex-start;  /* аватар по верхнему краю */
    gap: 10px;                /* расстояние между аватаркой и сообщением */
}

/* Аватарка */
.avatar-msg-meta {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    user-select: none;
}

/* Сообщение пользователя */
.message {
    align-self: flex-end;
    background-color: #2a2a2a;
    border: 1px solid #1e1e1e;
    border-radius: 16px;
    padding: 10px 14px 18px 14px;
    max-width: 65%;
    box-shadow: 0 0 6px rgba(162, 117, 255, 0.15);
    position: relative;
    color: #ddd;
}

/* Входящее сообщение */
.message-incoming {
    background-color: #23232a;
    border: 1px solid #1e1e1e;
    border-radius: 16px;
    padding: 10px 14px 18px 14px;
    max-width: 65%;
    box-shadow: 0 0 6px rgba(162, 117, 255, 0.15);
    position: relative;
    color: #ddd;
}

/* Метаданные сообщения */
.msg-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

/* Никнейм */
.username-msg-meta {
    font-weight: 500;
    color: #b79dff;
    font-size: 0.85em;
    margin-bottom: 4px;
    display: block;
}

/* Время */
.msg-meta time {
    position: absolute;
    bottom: 4px;
    right: 10px;
    font-size: 0.65em;
    color: #777;
    cursor: default;
    user-select: none;
}

/* Текст сообщения */
.message p,
.message-incoming p {
    color: #ddd;
    line-height: 1.2;
    font-size: 0.85em;
    word-break: break-word;
    margin-bottom: 10px;
}

/* Ограничение ширины сообщений */
.message,
.message-incoming {
    width: fit-content;
    word-wrap: break-word;
    position: relative; /* нужно для position: absolute у времени */
}

/* Webkit-браузеры (Chrome, Edge, Opera, Safari) */
.messages::-webkit-scrollbar {
    width: 10px;               /* удобная толщина */
}

.messages::-webkit-scrollbar-track {
    background: transparent;    /* почти невидимая дорожка */
}

.messages::-webkit-scrollbar-thumb {
    background-color: rgba(138, 123, 163, 0.4); /* мягкий, полупрозрачный */
    border-radius: 5px;
}

.messages::-webkit-scrollbar-thumb:hover {
    background-color: rgba(183, 157, 255, 0.6); /* чуть ярче при наведении */
}

/* Firefox */
.messages {
    scrollbar-width: thin;
    scrollbar-color: rgba(138, 123, 163, 0.4) transparent; /* thumb + track */
}





