/* ====== CSS RESET / BASE ====== */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f0f2f5;
    color: #111;
    /* overflow: hidden;  <-- УБРАТЬ */
}
:root {
    /* динамическая высота для мобильных браузеров (фикс 100vh) */
    --vh: 1vh;
    --sidebar-w: 300px;
    --radius: 12px;
}
.hidden { display: none !important; }

button {
    transition: background-color 0.2s ease, transform 0.2s ease;
}
button:hover {
    transform: translateY(-2px);
}
button:active {
    transform: translateY(0);
}

/* ====== MODALS ====== */
.modal-container {
    position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
    background-color: rgba(0,0,0,.5); z-index: 1000; padding: 16px;
}
.modal-content {
    background: #fff; width: min(560px, 100%); border-radius: var(--radius);
    box-shadow: 0 10px 30px rgba(0,0,0,.2); padding: 24px;
    animation: modal-pop 0.25s ease;
}
.modal-buttons { margin-top: 16px; display: flex; gap: 12px; justify-content: flex-end; }
.modal-buttons button {
    padding: 10px 16px; border: none; border-radius: 10px; background: #007bff; color: #fff; font-size: 15px; cursor: pointer;
}
.modal-buttons button[type="button"] { background: #6c757d; }

.suggestions { list-style: none; margin: 5px 0; padding: 0; border: 1px solid #ccc; border-radius: 8px; max-height: 150px; overflow-y: auto; }
.suggestions li { padding: 6px 10px; cursor: pointer; }
.suggestions li:hover { background: #f0f0f0; }
.selected-members { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.selected-member { background: #007bff; color: #fff; padding: 4px 8px; border-radius: 12px; display: flex; align-items: center; font-size: 13px; }
.selected-member .remove { margin-left: 6px; cursor: pointer; }

@keyframes modal-pop {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

/* Call modal */
/* .call-modal-content { width: min(480px, 100%); }
.call-btn { padding: 10px 16px; border: 0; border-radius: 10px; color: #fff; font-size: 15px; cursor: pointer; }
.call-btn.accept { background: #28a745; }
.call-btn.reject { background: #dc3545; }
#audio-visualizer, #remote-audio-visualizer { width: 100%; max-width: 100%; height: 56px; border: 1px solid #ddd; border-radius: 8px; display: block; }
#active-call-view label { display: block; margin: 10px 0 6px; font-size: 13px; color: #6c757d; } */

/* Call modal */
.call-btn { padding: 10px 16px; border: 0; border-radius: 10px; color: #fff; font-size: 15px; cursor: pointer; }

.call-modal-content { 
    width: min(380px, 100%); /* Можно сделать немного уже для мобильных */
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.call-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 16px;
    border: 3px solid #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,.15);
}

.call-modal-content h3 {
    margin-top: 0;
    margin-bottom: 8px;
    font-size: 1.5rem;
}

.call-modal-content p {
    margin-top: 0;
    margin-bottom: 20px;
    color: #6c757d;
}

.call-btn.reject { background: #e74c3c; }

#call-timer {
    font-size: 1rem; /* Размер шрифта как у обычного текста */
    color: #333;    /* Темно-серый цвет */
    margin: -12px 0 16px 0; /* Отрицательный верхний отступ, чтобы приблизить к статусу */
    min-height: 1.2em; /* Предотвращает "прыжок" макета при появлении таймера */
}

/* ====== MINIMIZED CALL BAR IMPROVED ====== */
#minimized-call-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 12px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    color: #111;
    font-size: 14px;
    font-weight: 500;
}

#minimized-call-info {
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;

}

#minimized-call-timer {
    font-weight: 600;
    color: #007bff;
}

.minimized-call-buttons {
    display: flex;
    gap: 8px;
}

.call-btn.small {
    padding: 6px;
    line-height: 1;
    border-radius: 10px;
}
.call-btn.small svg {
    display: block;
}
.call-btn.expand {
    background: #007bff;
    padding: 6px;
    color: #fff;
    border-radius: 10px;
}
.call-btn.expand svg {
    stroke: #fff;
    display: block;
}
.call-btn.reject.small {
    background: #dc3545;
    color: #fff;
}

/* Кнопка "Свернуть" в модальном окне */
.call-modal-content {
    position: relative; /* Необходимо для позиционирования кнопки */
}

.minimize-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    color: #6c757d;
}
.minimize-btn:hover {
    background-color: #f0f2f5;
}
.minimize-btn svg {
    display: block;
}


/* ====== AUTH ====== */
#auth-container { min-height: calc(var(--vh) * 100); display: grid; place-items: center; padding: 20px; }
.form-container { width: min(360px, 100%); background: #fff; border-radius: var(--radius); padding: 24px; box-shadow: 0 6px 18px rgba(0,0,0,.08); }
.auth-header { display: grid; place-items: center; gap: 8px; margin-bottom: 18px; }
.auth-header h1 { margin: 0; font-size: 32px; letter-spacing: 1px; }
#auth-form { display: grid; gap: 12px; }
#auth-form input { padding: 12px 14px; border: 1px solid #ddd; border-radius: 10px; font-size: 16px; }
#auth-form button { padding: 12px 14px; border: 0; border-radius: 10px; background: #007bff; color: #fff; font-size: 16px; cursor: pointer; }
#auth-form button:hover { background: #0a63c9; }
#switch-form-link { display: block; margin-top: 10px; color: #0a63c9; text-decoration: none; font-size: 14px; }
.error { color: #d93025; min-height: 1.2em; margin-top: 10px; }

/* ====== APP LAYOUT ====== */
#app-container { height: calc(var(--vh) * 100); display: flex; position: relative; overflow: hidden; }

/* Sidebar */
#sidebar {
    width: var(--sidebar-w); min-width: 240px; max-width: 380px; flex-shrink: 0;
    border-right: 1px solid #ddd; background: #fff; display: flex; flex-direction: column;
}
#user-profile { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid #eee; background: #f7f7f7; }
#profile-avatar { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; cursor: pointer; }
#profile-username { font-weight: 700; }
#search-container { padding: 12px 14px; border-bottom: 1px solid #eee; }
#search-input { width: 100%; padding: 10px 14px; border: 1px solid #ccc; border-radius: 18px; font-size: 14px; }
#chats-label { margin: 0; padding: 10px 14px; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: #6c757d; font-weight: 700; }
#chat-list { list-style: none; margin: 0; padding: 8px; overflow-y: auto; flex: 1; }

#chat-list li { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 10px; cursor: pointer; }
#chat-list li:hover { background: #f2f2f2; }
#chat-list li.active-chat { background: #007bff; color: #fff; }
.avatar-wrapper { position: relative; flex-shrink: 0; }
.chat-item-avatar, #chat-header-avatar { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; display: block; }
.online-indicator { position: absolute; bottom: -1px; right: -1px; width: 12px; height: 12px; border-radius: 50%; border: 2px solid #fff; background: #28a745; display: none; }
.avatar-wrapper.online .online-indicator { display: block; }
.chat-item-info { font-weight: 700; }
.unread-badge { margin-left: auto; background: #dc3545; color: #fff; font-size: 12px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; display: grid; place-items: center; }

/* Chat window */
#chat-window {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #E5DDD5;
    min-height: 0; /* важно! чтобы flex-элемент с overflow работал */
}
#chat-header { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: #f0f2f5; border-bottom: 1px solid #ddd; }
.chat-header-info { display: flex; flex-direction: column; min-width: 0; }
#chat-header-name { font-weight: 700; }
#chat-header-status { font-size: 13px; color: #6c757d; white-space: nowrap; }
#chat-header-status.online { color: #28a745; font-weight: 700; }
.call-icon {
    /* margin-left: auto;  <-- УДАЛИ ЭТУ СТРОКУ */
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
}
.call-icon:hover { background: #e9e9e9; }
.call-icon svg { width: 22px; height: 22px; }

.back-button { display: none; font-size: 22px; line-height: 1; user-select: none; padding: 4px 8px; border-radius: 8px; }

#messages {
    list-style: none;
    margin: 0;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;   /* прокрутка */
    flex: 1;
    min-height: 0;      /* фикс для мобильных */
}
#messages > li { max-width: 75%; padding: 8px 14px; border-radius: 18px; word-wrap: break-word; line-height: 1.35; position: relative; }
#messages > li.sent { align-self: flex-end; background: #dcf8c6; padding-right: 36px; }
#messages > li.received { align-self: flex-start; background: #fff; }

.message-appear {
    animation: message-appear 0.3s ease;
}

@keyframes message-appear {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.status-wrapper { position: absolute; right: 8px; bottom: 6px; }
.message-status svg { width: 16px; height: 16px; fill: #999; display: block; }
.message-status.read svg { fill: #4fc3f7; }
.status-tooltip { display: none; position: absolute; top: 115%; right: 0; padding: 8px; background: #333; color: #fff; border-radius: 8px; font-size: 12px; min-width: 160px; z-index: 10; }

#form {
  background: #f0f2f5;
  padding: 10px;
  display: flex;
  gap: 8px;
  border-top: 1px solid #ddd;
  padding-bottom: calc(10px + env(safe-area-inset-bottom));
  flex-wrap: nowrap; /* запрет переносов */
  flex-shrink: 0; /* не позволяет форме уменьшаться */
}
#input {
  flex: 1;
  min-width: 0; /* ключевой фикс, чтобы поле не вылезало */
  border: 1px solid #ccc;
  border-radius: 18px;
  padding: 10px 14px;
  font-size: 15px;
}
#form > button { border: 0; border-radius: 18px; padding: 10px 14px; background: #007bff; color: #fff; }

/* ==== Мобильный режим с анимацией ==== */
@media (max-width: 768px) {
  #app-container {
    position: relative;
    overflow: hidden;
  }

  #sidebar,
  #chat-window {
    position: absolute;
    inset: 0;
    transition: transform 0.35s ease, opacity 0.35s ease;
    will-change: transform, opacity;
  }

  /* состояние по умолчанию */
  #sidebar {
    transform: translateX(0);
    opacity: 1;
    z-index: 1;
  }
  #chat-window {
    transform: translateX(100%);
    opacity: 0;
    z-index: 2;
  }

  /* когда активирован чат */
  #app-container.chat-active #sidebar {
    transform: translateX(-100%);
    opacity: 0;
  }
  #app-container.chat-active #chat-window {
    transform: translateX(0);
    opacity: 1;
  }

  /* хэдер с кнопкой назад */
  #chat-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: #f1f1f1;
    border-bottom: 1px solid #ccc;
  }

  .back-btn {
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
  }
}

/* ====== VERY NARROW (<=380px) ====== */
@media (max-width: 380px) {
    #auth-form input, #auth-form button { font-size: 15px; }
    #chat-header-name { font-size: 14px; }
    #chat-header-status { font-size: 12px; }
}

/* ====== AI INTEGRATION ====== */

.header-icon {
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    /* margin-left: 0.5rem; <-- УДАЛИ ЭТУ СТРОКУ */
}
.header-icon:hover {
    background-color: #ddd;
}
.header-icon svg {
    width: 24px;
    height: 24px;
    stroke: #6c757d;
    fill: #6c757d;
}

.form-icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    margin-right: 0.5rem;
    border-radius: 50%;
}
.form-icon-btn:hover {
    background-color: #ddd;
}
.form-icon-btn svg {
    width: 24px;
    height: 24px;
    stroke: #6c757d;
}

#smart-replies-container {
    display: flex;
    gap: 0.5rem;
    /* ИЗМЕНЕНИЕ: Увеличиваем отступы для большего пространства */
    padding: 0.75rem 1rem;
    background: #f0f2f5;
    flex-wrap: wrap;
}

.smart-reply-btn {
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 18px;
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
    cursor: pointer;
}
.smart-reply-btn:hover {
    background-color: #e9e9e9;
}

/* ====== LOADING ANIMATION ====== */
.loading-animation {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 15px 0;
}
.loading-animation .dot {
  width: 10px;
  height: 10px;
  background: #3a7bfd;
  border-radius: 50%;
  animation: bounce 1s infinite ease-in-out;
}
.loading-animation .dot:nth-child(1) { animation-delay: 0s; }
.loading-animation .dot:nth-child(2) { animation-delay: 0.2s; }
.loading-animation .dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce {
  0%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-8px); }
}

/* Контейнер разделителя */
.date-separator {
  display: flex;
  justify-content: center;   /* центрируем бабл */
  width: auto;               /* авто, чтобы не растягивался на всю ширину окна */
  margin: 15px auto;         /* вертикальный отступ + центрирование по горизонтали */
}

/* Бабл даты */
.date-bubble {
  display: inline-block;     /* важный момент */
  background: #e5e5ea;
  color: #555;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* .message-bubble {
    position: relative;
    display: inline-block;
    padding: 8px 12px;
    border-radius: 10px;
    background: #f1f1f1;
    max-width: 70%;
}

.sent .message-bubble {
    background: #daf1ff;
    align-self: flex-end;
} */

.message-time {
    font-size: 11px;
    color: #777;
    margin-left: 8px;
}

.call-record {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 8px 0;
    margin: 10px 0;
    color: #8a97a7;
    font-size: 0.85em;
    width: auto;               /* авто, чтобы не растягивался на всю ширину окна */
    margin: 15px auto;         /* вертикальный отступ + центрирование по горизонтали *
}

.call-info {
    display: inline-block;     /* важный момент */
    align-items: center;
    gap: 8px;
    background-color: #f0f2f5;
    padding: 5px 12px;
    border-radius: 15px;
}

.call-info svg {
    opacity: 0.7;
}

.modal-overlay2 {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}
.modal-content2 {
    background-color: white;
    padding: 25px;
    border-radius: 8px;
    text-align: center;
    max-width: 320px;
}
.modal-content2 h2 {
    margin-top: 0;
}
.modal-content2 button {
    padding: 10px 20px;
    border: none;
    background-color: #3a7bfd;
    color: white;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
}

/* Стили для иконки видеозвонка (рядом с .call-icon svg) */
#video-call-btn svg {
    width: 24px;
    height: 24px;
}

/* ====== Стили для модального окна видеозвонка ====== */
#video-call-modal {
    background-color: #111; /* Темный фон */
}

.video-call-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

#remote-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; /* Заполняет все пространство, может обрезать */
    z-index: 1;
    background-color: #222; /* Цвет фона, пока видео не загрузилось */
}

#local-video {
    position: absolute;
    bottom: 100px; /* Над кнопками управления */
    right: 20px;
    width: 25%;
    max-width: 200px;
    height: auto;
    border-radius: 10px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    z-index: 2;
    transform: scaleX(-1); /* Зеркальный эффект для селфи-камеры */
    transition: all 0.3s ease;
}

.video-overlay-info {
    position: absolute;
    top: 20px;
    left: 20px;
    color: white;
    text-shadow: 1px 1px 4px rgba(0,0,0,0.7);
    z-index: 3;
    background: rgba(0,0,0,0.3);
    padding: 5px 15px;
    border-radius: 10px;
}
.video-overlay-info p {
    margin: 0;
}

.video-call-controls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
    z-index: 3;
    background: rgba(0,0,0,0.4);
    padding: 10px 20px;
    border-radius: 50px;
}

.control-btn {
    background-color: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 56px;
    height: 56px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    color: white;
    transition: background-color 0.2s;
}
.control-btn svg {
    stroke: white;
}
.control-btn:hover {
    background-color: rgba(255, 255, 255, 0.4);
}
.control-btn.hang-up {
    background-color: #e74c3c;
}
.control-btn.hang-up:hover {
    background-color: #c0392b;
}

.header-actions {
    margin-left: auto; /* Эта строка прижмет весь блок к правому краю */
    display: flex;
    align-items: center;
    gap: 4px; /* Небольшой отступ между иконками */
}

/* Панель предпросмотра */
#attachment-preview-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    background-color: #f0f2f5;
    border-top: 1px solid #ddd;
    flex-shrink: 0;
}

.preview-thumbnail {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
    background-color: #e0e0e0;
}

.preview-info {
    flex: 1;
    min-width: 0; /* Важно для переноса текста */
}

.preview-filename {
    display: block;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.preview-progress-bar {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    margin-top: 4px;
}

.preview-close-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    color: #6c757d;
}
.preview-close-btn:hover {
    background-color: #e0e0e0;
}

/* Стили для сообщений с файлами в чате */
.message-bubble.has-attachment {
    padding: 8px; /* Уменьшаем внутренние отступы, т.к. контент будет иметь свои */
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.message-image {
    max-width: 100%; /* Чтобы картинка не вылезала за пределы бабла */
    max-height: 300px;
    border-radius: 12px;
    cursor: pointer; /* Можно добавить открытие в полный размер */
    object-fit: cover;
}

.message-file {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: rgba(0,0,0,0.05);
    padding: 8px 12px;
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
}
.message-file:hover {
    background-color: rgba(0,0,0,0.1);
}

.file-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

.file-info {
    min-width: 0; /* Важно для переноса текста */
}

.file-name {
    display: block;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-caption {
    margin-top: 4px; /* Отступ для подписи */
    line-height: 1.4;
    word-wrap: break-word;
}

.audio-player {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    max-width: 280px; /* Ограничим максимальную ширину плеера */
    padding: 5px;
}

.play-pause-btn {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    background-color: #007bff;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.2s;
}
.play-pause-btn:hover {
    background-color: #0056b3;
}

/* Иконка "Play" (треугольник на CSS) */
.play-pause-btn.play::before {
    content: '';
    width: 0;
    height: 0;
    border-top: 7px solid transparent;
    border-bottom: 7px solid transparent;
    border-left: 12px solid white;
    margin-left: 4px; /* Небольшая коррекция для центровки */
}

/* Иконка "Pause" (две полоски на CSS) */
.play-pause-btn.pause::before {
    content: '';
    width: 12px;
    height: 14px;
    border-left: 4px solid white;
    border-right: 4px solid white;
    box-sizing: border-box;
}


.player-controls {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.progress-bar-container {
    width: 100%;
    height: 5px;
    background-color: #e0e0e0;
    border-radius: 2.5px;
    cursor: pointer;
    margin-bottom: 4px;
}

.progress-bar-fill {
    height: 100%;
    width: 0; /* Начальная ширина 0 */
    background-color: #007bff;
    border-radius: 2.5px;
}

.audio-info {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: #666;
}

.audio-filename {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 10px;
}

.preview-thumbnail {
    /* Эти стили уже могут быть, просто убедись, что они есть */
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
    background-color: #e9e9e9; /* Фон для иконки */

    /* Добавь это для центрирования SVG */
    display: flex;
    justify-content: center;
    align-items: center;
}

.preview-thumbnail svg {
    width: 32px; /* Размер самой иконки */
    height: 32px;
}

.context-menu {
    position: absolute;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    z-index: 1000;
    animation: fadeInScale 0.15s ease;
}

.context-menu div {
    padding: 8px 12px;
    cursor: pointer;
}

.context-menu div:hover {
    background: #f0f0f0;
}

.edited-label {
    font-size: 0.75em;
    color: #666;
    margin-left: 4px;
}

@keyframes fadeOutHeight {
    to { opacity: 0; height: 0; margin: 0; padding: 0; }
}

.message-remove {
    animation: fadeOutHeight 0.3s forwards;
}

@keyframes fadeInScale {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

/* === Групповые чаты === */
#create-group-btn {
    margin: 8px 16px;
    padding: 8px;
    width: calc(100% - 32px);
    border: none;
    border-radius: 8px;
    background: #007bff;
    color: #fff;
    cursor: pointer;
}

li.group-message {
    display: flex;
    align-items: flex-end;
}

li.group-message .message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    margin-right: 8px;
    object-fit: cover;
    cursor: pointer;
}

.profile-preview-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 16px;
}
