/* === VOLNA MESSENGER - ПОЛНЫЕ СТИЛИ v1.0.0 === */
/* Версия для демонстрации инвесторам */
/* Совместим с index.html и script.js */

/* === ПЕРЕМЕННЫЕ === */
:root {
  --primary: #667eea;
  --primary-dark: #5a67d8;
  --secondary: #764ba2;
  --success: #2ecc71;
  --error: #e74c3c;
  --warning: #f39c12;
  --info: #3498db;
  
  --bg-white: #ffffff;
  --bg-light: #f8f9fa;
  --bg-app: #f0f2f5;
  --gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --bg-bubble-in: #f1f3f4;
  --bg-bubble-out: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  
  --text-dark: #1a1a2e;
  --text-gray: #6c757d;
  --text-light: #ffffff;
  --text-muted: #adb5bd;
  
  --border: #e9ecef;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 15px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
  
  --transition: 0.2s ease;
}

/* === БАЗОВЫЕ СТИЛИ === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg-app);
  color: var(--text-dark);
  overflow: hidden;
  line-height: 1.5;
}

.app {
  display: flex;
  height: 100vh;
  max-width: 1600px;
  margin: 0 auto;
  background: var(--bg-white);
  box-shadow: var(--shadow-lg);
}

/* === САЙДБАР === */
.sidebar {
  width: 350px;
  background: var(--bg-white);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.sidebar__header {
  padding: 15px 20px;
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.menu-btn, .settings-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 18px;
  color: var(--text-dark);
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.menu-btn:hover, .settings-btn:hover {
  background: var(--bg-light);
  transform: scale(1.05);
}

.user-profile {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 5px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}

.user-profile:hover {
  background: var(--bg-light);
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 16px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.user-info {
  flex: 1;
  min-width: 0;
}

.user-info .user-name {
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-info .user-status {
  font-size: 12px;
  color: var(--success);
}

/* === ПОИСК === */
.search {
  padding: 12px 15px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.search__input {
  width: 100%;
  padding: 10px 15px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 14px;
  background: var(--bg-light);
  transition: all var(--transition);
}

.search__input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* === СПИСОК ЧАТОВ === */
.chat-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.chat-item {
  display: flex;
  align-items: center;
  padding: 12px 15px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  margin-bottom: 4px;
  gap: 12px;
}

.chat-item:hover {
  background: var(--bg-light);
}

.chat-item--active {
  background: rgba(102, 126, 234, 0.08);
  border-left: 3px solid var(--primary);
}

.chat-item__avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 18px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
  text-transform: uppercase;
}

.chat-item__info {
  flex: 1;
  min-width: 0;
}

.chat-item__name {
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 4px;
  color: var(--text-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-item__last-message {
  font-size: 13px;
  color: var(--text-gray);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-item__time {
  font-size: 12px;
  color: var(--text-muted);
  text-align: right;
  flex-shrink: 0;
  margin-left: 10px;
}

.chat-badge {
  display: inline-block;
  background: var(--error);
  color: white;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
}

/* === ОБЛАСТЬ ЧАТА === */
.chat-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg-white);
  min-width: 0;
}

.chat-header {
  padding: 15px 20px;
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.chat-header__title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-dark);
}

.chat-header__status {
  font-size: 13px;
  color: var(--text-gray);
}

.chat-header__actions {
  display: flex;
  gap: 8px;
}

.header-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: var(--bg-light);
  cursor: pointer;
  font-size: 16px;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.header-btn:hover {
  background: var(--primary);
  color: white;
  transform: scale(1.05);
}

/* === СООБЩЕНИЯ === */
.messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--bg-white);
}

.messages-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-gray);
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-gray);
}

.empty-icon {
  font-size: 48px;
  margin-bottom: 15px;
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 18px;
  margin-bottom: 8px;
  color: var(--text-dark);
}

.empty-state p {
  font-size: 14px;
}

/* === СООБЩЕНИЕ === */
.message {
  display: flex;
  max-width: 100%;
  animation: slideIn 0.3s ease;
}

.message--incoming {
  justify-content: flex-start;
}

.message--outgoing {
  justify-content: flex-end;
}

.bubble {
  max-width: 70%;
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  position: relative;
  box-shadow: var(--shadow);
  transition: all var(--transition);
}

.bubble:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.bubble--incoming {
  background: var(--bg-bubble-in);
  border-bottom-left-radius: 4px;
  color: var(--text-dark);
}

.bubble--outgoing {
  background: var(--bg-bubble-out);
  border-bottom-right-radius: 4px;
  color: var(--text-light);
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.bubble_text {
  font-size: 14px;
  line-height: 1.5;
  word-wrap: break-word;
  white-space: pre-wrap;
}

.bubble_time {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  margin-top: 5px;
  font-size: 11px;
  opacity: 0.75;
}

.bubble_status {
  color: #4ade80;
  font-weight: 600;
}

/* === ГОЛОСОВЫЕ СООБЩЕНИЯ === */
.voice-message {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: var(--radius);
  min-width: 280px;
  backdrop-filter: blur(10px);
  position: relative;
}

.message--outgoing .voice-message {
  background: rgba(255, 255, 255, 0.15);
}

.message--incoming .voice-message {
  background: rgba(0, 0, 0, 0.05);
}

.voice-message-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: white;
}

.voice-message-header::before {
  content: "🎤";
  font-size: 14px;
}

.message--incoming .voice-message-header {
  color: var(--text-dark);
}

.voice-message__play {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: white;
  color: var(--primary);
  cursor: pointer;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  transition: transform var(--transition);
}

.voice-message__play:hover {
  transform: scale(1.1);
}

.message--incoming .voice-message__play {
  background: var(--primary);
  color: white;
}

.voice-message__waveform {
  flex: 1;
  height: 45px;
  display: flex;
  align-items: center;
  gap: 3px;
  overflow: hidden;
}

.voice-message__waveform div {
  width: 3px;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 2px;
  animation: none;
  height: 20%;
  opacity: 0.4;
}

.voice-message.playing .voice-message__waveform div {
  animation: voiceWave 0.6s ease-in-out infinite;
}

.message--incoming .voice-message__waveform div {
  background: rgba(102, 126, 234, 0.7);
}

.voice-message__waveform div:nth-child(odd) { animation-delay: 0.1s; }
.voice-message__waveform div:nth-child(2n) { animation-delay: 0.2s; }
.voice-message__waveform div:nth-child(3n) { animation-delay: 0.3s; }
.voice-message__waveform div:nth-child(4n) { animation-delay: 0.4s; }
.voice-message__waveform div:nth-child(5n) { animation-delay: 0.5s; }

@keyframes voiceWave {
  0%, 100% { 
    height: 20%; 
    opacity: 0.4; 
  }
  50% { 
    height: 100%; 
    opacity: 1; 
  }
}

.voice-message__duration {
  font-size: 12px;
  opacity: 0.9;
  min-width: 45px;
  text-align: right;
  color: white;
  font-weight: 500;
  font-family: monospace;
}

.message--incoming .voice-message__duration {
  color: var(--text-dark);
}

/* === ФАЙЛЫ === */
.file-preview {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: var(--radius);
  min-width: 300px;
  backdrop-filter: blur(10px);
}

.message--outgoing .file-preview {
  background: rgba(255, 255, 255, 0.15);
}

.message--incoming .file-preview {
  background: var(--bg-white);
  border: 1px solid var(--border);
}

.file-preview .image-container {
  width: 100%;
  height: 220px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: rgba(255,255,255,0.2);
}

.message--incoming .file-preview .image-container {
  background: var(--bg-light);
}

.file-preview .image-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.file-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.file-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.file-info > div[style*="flex: 1"] {
  flex: 1;
  min-width: 0;
}

.file-name {
  font-size: 13px;
  font-weight: 500;
  color: white;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
  cursor: pointer;
}

.file-name:hover {
  text-decoration: underline;
}

.message--incoming .file-name {
  color: var(--text-dark);
}

.file-size {
  font-size: 11px;
  opacity: 0.8;
  color: rgba(255,255,255,0.85);
}

.message--incoming .file-size {
  color: var(--text-gray);
}

.file-download-btn {
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.25);
  border: none;
  border-radius: var(--radius-sm);
  color: white;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.file-download-btn:hover {
  background: rgba(255, 255, 255, 0.35);
  transform: translateY(-1px);
}

.message--incoming .file-download-btn {
  background: var(--primary);
}

/* === КНОПКИ === */
.btn {
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn--primary {
  background: var(--primary);
  color: white;
}

.btn--primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn--secondary {
  background: var(--bg-light);
  color: var(--text-dark);
}

.btn--secondary:hover {
  background: var(--border);
}

/* === ПОЛЕ ВВОДА === */
.composer {
  padding: 15px 20px;
  background: var(--bg-white);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.composer__btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: var(--bg-light);
  cursor: pointer;
  font-size: 18px;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.composer__btn:hover {
  background: var(--primary);
  color: white;
  transform: scale(1.05);
}

.composer__input {
  flex: 1;
  border: none;
  background: var(--bg-light);
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  font-size: 14px;
  outline: none;
  transition: all var(--transition);
}

.composer__input:focus {
  box-shadow: 0 0 0 2px rgba(102,126,234,0.2);
}

.composer__send {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: var(--gradient);
  color: white;
  cursor: pointer;
  font-size: 18px;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.composer__send:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(102,126,234,0.3);
}

/* === КОНТЕКСТНОЕ МЕНЮ === */
.message-context-menu {
  position: fixed;
  background: white;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  padding: 6px 0;
  min-width: 180px;
  z-index: 10000;
  display: none;
}

.message-context-menu.active {
  display: block;
}

.context-menu-item {
  padding: 10px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  transition: background var(--transition);
  color: var(--text-dark);
}

.context-menu-item:hover {
  background: var(--bg-light);
}

.context-menu-item.danger {
  color: var(--error);
}

.context-menu-item.danger:hover {
  background: #ffeaea;
}

.context-menu-icon {
  font-size: 16px;
}

.message[draggable="true"] {
  cursor: context-menu;
}

/* === УВЕДОМЛЕНИЯ === */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  z-index: 10001;
  animation: slideInRight 0.3s ease;
  font-weight: 500;
  color: white;
}

.notification--success { background: var(--success); }
.notification--error { background: var(--error); }
.notification--info { background: var(--info); }

@keyframes slideInRight {
  from { transform: translateX(400px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOut {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(400px); opacity: 0; }
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

/* === ПАНЕЛИ И МОДАЛКИ === */
.menu-panel, .chat-info-panel, .gifts-panel, .modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
}

.menu-panel {
  justify-content: flex-start;
}

/* === МЕНЮ ПАНЕЛЬ - ИСПРАВЛЕНО === */
.menu-panel {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 350px;
  max-width: 100%;
  background: var(--bg-white);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  display: none;
  flex-direction: column;
  animation: slideInLeft 0.3s ease;
}

.menu-panel.active {
  display: flex;
}

@keyframes slideInLeft {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(0);
  }
}

.menu-panel__header {
  background: var(--gradient);
  padding: 20px;
  color: white;
  display: flex;
  align-items: flex-start;
  gap: 15px;
  position: relative;
  min-height: 120px;
  flex-shrink: 0;
}

.menu-panel__close {
  position: absolute;
  top: 15px;
  left: 15px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: white;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background var(--transition);
  z-index: 10;
}

.menu-panel__close:hover {
  background: rgba(255, 255, 255, 0.3);
}

.menu-panel__profile {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  margin-top: 10px;
}

.menu-panel__avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 24px;
  flex-shrink: 0;
}

.menu-panel__info {
  flex: 1;
  min-width: 0;
}

.menu-panel__name {
  font-weight: 600;
  font-size: 16px;
  color: white;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.menu-panel__status {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.9);
}

.menu-panel__body {
  background: var(--bg-white);
  flex: 1;
  overflow-y: auto;
  padding: 0;
}

.menu-panel__footer {
  background: var(--bg-white);
  padding: 15px 20px;
  border-top: 1px solid var(--border);
  text-align: center;
  flex-shrink: 0;
}

.menu-panel__version {
  font-size: 12px;
  color: var(--text-muted);
}

/* Оверлей для затемнения фона */
.menu-panel-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  display: none;
}

.menu-panel-overlay.active {
  display: block;
}

/* === АДАПТИВНОСТЬ ДЛЯ МЕНЮ === */
@media (max-width: 768px) {
  .menu-panel {
    width: 280px;
  }
}

/* === ПАНЕЛЬ ИНФОРМАЦИИ О ЧАТЕ - ИСПРАВЛЕНО === */
.chat-info-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 350px;
  height: 100vh;
  background: var(--bg-white);
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  display: none;
  flex-direction: column;
  animation: slideInRight 0.3s ease;
}

.chat-info-panel.active {
  display: flex;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Заголовок с градиентом */
.chat-info-panel__header {
  background: var(--gradient);
  padding: 30px 20px;
  color: white;
  text-align: center;
  position: relative;
  flex-shrink: 0;
}

.chat-info-panel__close {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}

.chat-info-panel__close:hover {
  background: rgba(255, 255, 255, 0.3);
}

.chat-info-panel__avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 15px;
  font-size: 32px;
  font-weight: 600;
  color: white;
}

.chat-info-panel__name {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 8px;
  color: white;
}

.chat-info-panel__status {
  font-size: 14px;
  opacity: 0.9;
  color: rgba(255, 255, 255, 0.9);
}

/* Тело панели */
.chat-info-panel__body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  background: var(--bg-white);
}

/* Кнопки действий */
.chat-info-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 30px;
}

.chat-info-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 8px;
  border: none;
  background: var(--bg-light);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  font-size: 13px;
  color: var(--text-dark);
}

.chat-info-action-btn:hover {
  background: var(--primary);
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.chat-info-action-btn span:first-child {
  font-size: 24px;
}

/* Статистика */
.chat-info-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 30px;
}

.stat-item {
  background: var(--bg-light);
  padding: 16px;
  border-radius: var(--radius);
  text-align: center;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
}

.stat-label {
  font-size: 12px;
  color: var(--text-gray);
}

/* Разделы */
.chat-info-sections {
  margin-bottom: 20px;
}

.info-section-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--bg-light);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  cursor: pointer;
  transition: background var(--transition);
}

.info-section-item:hover {
  background: var(--bg-white);
  box-shadow: var(--shadow);
}

.info-section-item .section-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-icon {
  font-size: 20px;
  width: 24px;
  text-align: center;
}

.section-text {
  font-size: 14px;
  color: var(--text-dark);
  font-weight: 500;
}

.section-value {
  font-size: 13px;
  color: var(--text-gray);
  font-weight: 500;
}

/* Кнопка покинуть чат */
.leave-chat-btn {
  width: 100%;
  padding: 14px;
  background: var(--error);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  margin-top: 20px;
}

.leave-chat-btn:hover {
  background: #c0392b;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* Оверлей для затемнения */
.chat-info-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  display: none;
}

.chat-info-overlay.active {
  display: block;
}

/* Адаптивность */
@media (max-width: 768px) {
  .chat-info-panel {
    width: 100%;
  }
  
  .chat-info-actions {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Скроллбар */
.chat-info-panel__body::-webkit-scrollbar {
  width: 6px;
}

.chat-info-panel__body::-webkit-scrollbar-track {
  background: transparent;
}

.chat-info-panel__body::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.chat-info-panel__body::-webkit-scrollbar-thumb:hover {
  background: var(--text-gray);
}

/* === СЕКЦИИ МЕНЮ === */
.settings-section {
  margin-bottom: 0;
  padding: 15px 0;
  border-bottom: 1px solid var(--border);
}

.settings-section:last-child {
  border-bottom: none;
}

.settings-section h4 {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-gray);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0 20px;
  margin-top: 10px;
}

.settings-section h4:first-child {
  margin-top: 0;
}

/* === ЭЛЕМЕНТЫ МЕНЮ === */
.menu-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 12px 20px;
  cursor: pointer;
  transition: background var(--transition);
  color: var(--text-dark);
}

.menu-item:hover {
  background: var(--bg-light);
}

.menu-item__icon {
  font-size: 20px;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

.menu-item__text {
  flex: 1;
  font-size: 14px;
}

/* === НАСТРОЙКИ === */
.settings-section input[type="text"],
.settings-section input[type="tel"],
.settings-section input[type="email"],
.settings-section input[type="password"] {
  width: calc(100% - 40px);
  margin: 8px 20px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
}

.setting-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  font-size: 14px;
  cursor: pointer;
}

.setting-toggle:hover {
  background: var(--bg-light);
}

.setting-toggle input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

/* === DROPDOWN МЕНЮ === */
.dropdown-menu {
  position: absolute;
  background: white;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  padding: 6px 0;
  min-width: 220px;
  z-index: 1000;
  display: none;
}

.dropdown-menu.active {
  display: block;
}

.dropdown-item {
  padding: 10px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text-dark);
  transition: background var(--transition);
}

.dropdown-item:hover {
  background: var(--bg-light);
}

.dropdown-item.danger {
  color: var(--error);
}

.dropdown-item.danger:hover {
  background: #ffeaea;
}

/* === ЧАТ ИНФО ПАНЕЛЬ === */
.chat-info-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.chat-info-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px;
  border: none;
  background: var(--bg-light);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  font-size: 12px;
}

.chat-info-action-btn:hover {
  background: var(--primary);
  color: white;
  transform: translateY(-2px);
}

.chat-info-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
  padding: 16px;
  background: var(--bg-light);
  border-radius: var(--radius);
}

.stat-item {
  text-align: center;
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
}

.stat-label {
  font-size: 12px;
  color: var(--text-gray);
}

.chat-info-sections {
  margin-bottom: 24px;
}

.info-section-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 15px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition);
  margin-bottom: 4px;
}

.info-section-item:hover {
  background: var(--bg-light);
}

.section-icon {
  font-size: 18px;
  width: 24px;
}

.section-text {
  flex: 1;
  font-size: 14px;
}

.section-value {
  font-size: 13px;
  color: var(--text-gray);
}

/* === ПАНЕЛЬ ПОДАРКОВ === */
.gifts-panel {
  position: fixed;
  top: 0;
  right: 0;  /* ✅ ПАНЕЛЬ СПРАВА */
  width: 400px;
  height: 100vh;
  background: var(--bg-white);
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.1);
  z-index: 1001;
  display: none;
  flex-direction: column;
}

.gifts-panel.active {
  display: flex;
}

.gifts-panel__header {
  background: var(--gradient);
  padding: 20px;
  color: white;
  position: relative;
  flex-shrink: 0;
}

.gifts-panel__close {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}

.gifts-panel__close:hover {
  background: rgba(255, 255, 255, 0.3);
}

.gifts-panel__header h3 {
  font-size: 18px;
  margin-bottom: 5px;
}

.gifts-panel__header p {
  font-size: 13px;
  opacity: 0.9;
}

.gifts-panel__tabs {
  display: flex;
  gap: 8px;
  padding: 15px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.gift-tab {
  padding: 8px 16px;
  border: none;
  background: var(--bg-light);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all var(--transition);
}

.gift-tab.active {
  background: var(--primary);
  color: white;
}

.gifts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  padding: 20px;
  flex: 1;
  overflow-y: auto;
  align-content: start;
}

.gift-item {
  background: var(--bg-light);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.gift-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  background: var(--bg-white);
}

.gift-emoji {
  font-size: 48px;
  margin-bottom: 4px;
}

.gift-stars {
  font-size: 12px;
  color: var(--warning);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

.gifts-panel__footer {
  padding: 15px 20px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

/* Оверлей для подарков */
.gifts-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  display: none;
}

.gifts-overlay.active {
  display: block;
}

/* Адаптивность */
@media (max-width: 768px) {
  .gifts-panel {
    width: 100%;
  }
  
  .gifts-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Скроллбар */
.gifts-grid::-webkit-scrollbar {
  width: 6px;
}

.gifts-grid::-webkit-scrollbar-track {
  background: transparent;
}

.gifts-grid::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

/* === МОДАЛЬНЫЕ ОКНА И ЗВОНКИ - ИСПРАВЛЕНО === */

/* Основной контейнер модалки */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

/* Контент модалки */
.modal__content {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: 30px;
  max-width: 500px;
  width: 90%;
  text-align: center;
  animation: modalSlideIn 0.3s ease;
  position: relative;
  margin: auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Контент звонка - УМЕНЬШЕНО */
.call-modal-content {
  background: var(--gradient);
  color: white;
  max-width: 500px;  /* Уменьшено с 600px */
  width: 90%;
  padding: 25px;  /* Уменьшено с 40px */
}

/* Контейнер видео - УМЕНЬШЕН */
.call-video-container {
  position: relative;
  width: 100%;
  height: 300px;  /* Уменьшено с 400px */
  background: rgba(0, 0, 0, 0.3);
  border-radius: var(--radius);
  margin-bottom: 20px;
  overflow: hidden;
}

.remote-video, .local-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Локальное видео - УМЕНЬШЕНО */
.local-video {
  position: absolute;
  bottom: 15px;  /* Уменьшено с 20px */
  right: 15px;
  width: 100px;  /* Уменьшено с 120px */
  height: 130px;  /* Уменьшено с 160px */
  border-radius: var(--radius-sm);
  border: 2px solid white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.call-info {
  margin-bottom: 25px;  /* Уменьшено с 30px */
}

.call-icon {
  font-size: 56px;  /* Уменьшено с 64px */
  margin-bottom: 12px;
}

.call-info h2 {
  font-size: 22px;  /* Уменьшено с 24px */
  margin-bottom: 8px;
}

.call-info p {
  opacity: 0.9;
  margin-bottom: 12px;
}

.call-timer {
  font-size: 18px;
  font-weight: 600;
  font-family: monospace;
}

/* Кнопки управления - КОМПАКТНЕЕ */
.call-controls {
  display: flex;
  justify-content: center;
  gap: 12px;  /* Уменьшено с 16px */
}

.call-control-btn {
  width: 50px;  /* Уменьшено с 56px */
  height: 50px;  /* Уменьшено с 56px */
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  cursor: pointer;
  font-size: 20px;  /* Уменьшено с 22px */
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.call-control-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.call-control-btn.call-end-btn {
  background: var(--error);
}

.call-control-btn.call-end-btn:hover {
  background: #c0392b;
}

/* Кнопки для входящего звонка */
.call-incoming-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 15px;
}

.call-incoming-buttons button {
  padding: 10px 24px;  /* Уменьшено с 12px 32px */
  border: none;
  border-radius: 8px;
  font-size: 14px;  /* Уменьшено с 16px */
  cursor: pointer;
  transition: all var(--transition);
}

.call-incoming-buttons button:first-child {
  background: var(--success);
  color: white;
}

.call-incoming-buttons button:first-child:hover {
  background: #27ae60;
  transform: scale(1.05);
}

.call-incoming-buttons button:last-child {
  background: var(--error);
  color: white;
}

.call-incoming-buttons button:last-child:hover {
  background: #c0392b;
  transform: scale(1.05);
}

/* Кнопка закрытия */
.modal__close {
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-gray);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background var(--transition);
  z-index: 10;
}

.modal__close:hover {
  background: var(--bg-light);
}

.call-modal-content .modal__close {
  color: white;
}

.call-modal-content .modal__close:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Адаптивность */
@media (max-width: 768px) {
  .modal__content {
    width: 95%;
    padding: 20px;
  }
  
  .call-modal-content {
    padding: 15px;
  }
  
  .call-video-container {
    height: 250px;  /* Ещё меньше на мобильных */
  }
  
  .local-video {
    width: 80px;
    height: 110px;
    bottom: 10px;
    right: 10px;
  }
  
  .call-controls {
    gap: 10px;
  }
  
  .call-control-btn {
    width: 44px;
    height: 44px;
    font-size: 18px;
  }
  
  .call-icon {
    font-size: 48px;
  }
  
  .call-info h2 {
    font-size: 20px;
  }
}

/* === ЭМОДЗИ ПАНЕЛЬ === */
.emoji-panel {
  position: absolute;
  bottom: 80px;
  left: 20px;
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 15px;
  width: 320px;
  max-height: 400px;
  overflow-y: auto;
  z-index: 1000;
  display: none;
}

.emoji-panel.active {
  display: block;
}

.emoji-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.emoji-tab {
  padding: 6px 12px;
  border: none;
  background: var(--bg-light);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 12px;
  transition: all var(--transition);
}

.emoji-tab.active {
  background: var(--primary);
  color: white;
}

.emoji-search {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 12px;
}

.emoji-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 4px;
}

.emoji-item {
  font-size: 24px;
  padding: 6px;
  text-align: center;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}

.emoji-item:hover {
  background: var(--bg-light);
}

/* === МЕНЮ ВЛОЖЕНИЙ === */
.attach-menu {
  position: absolute;
  bottom: 80px;
  left: 80px;
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 8px;
  display: none;
  z-index: 1000;
}

.attach-menu.active {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.attach-menu__item {
  padding: 10px 16px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  text-align: left;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
  display: flex;
  align-items: center;
  gap: 10px;
}

.attach-menu__item:hover {
  background: var(--bg-light);
}

/* === ИНДИКАТОРЫ === */
.typing-indicator {
  padding: 8px 20px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-gray);
  background: var(--bg-white);
}

.typing-indicator__dot {
  width: 6px;
  height: 6px;
  background: var(--text-gray);
  border-radius: 50%;
  animation: typing 1.4s infinite;
}

.typing-indicator__dot:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator__dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-4px); }
}

.recording-indicator {
  padding: 10px 20px;
  background: var(--error);
  color: white;
  display: flex;
  align-items: center;
  gap: 12px;
}

.recording-pulse {
  width: 12px;
  height: 12px;
  background: white;
  border-radius: 50%;
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.2); }
}

.recording-time {
  font-weight: 500;
  font-family: monospace;
}

.recording-cancel {
  margin-left: auto;
  background: none;
  border: none;
  color: white;
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 50%;
  transition: background var(--transition);
}

.recording-cancel:hover {
  background: rgba(255,255,255,0.2);
}

/* === СКРОЛЛБАР === */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-gray);
}

.menu-panel__body::-webkit-scrollbar {
  width: 6px;
}

.menu-panel__body::-webkit-scrollbar-track {
  background: transparent;
}

.menu-panel__body::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.menu-panel__body::-webkit-scrollbar-thumb:hover {
  background: var(--text-gray);
}

/* === АДАПТИВНОСТЬ === */
@media (max-width: 768px) {
  .sidebar {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 100;
    transform: translateX(-100%);
    transition: transform 0.3s;
  }
  .sidebar.active {
    transform: translateX(0);
  }
  .bubble {
    max-width: 85%;
  }
  .chat-header__status {
    display: none;
  }
}

/* === ТЕМНАЯ ТЕМА === */
body.dark {
  --bg-white: #1a1a2e;
  --bg-light: #16213e;
  --text-dark: #eaeaea;
  --text-gray: #a0a0a0;
  --border: #2a2a4a;
  --bg-bubble-in: #2a2a4a;
}

body.dark .chat-item:hover {
  background: #1f2b4d;
}

body.dark .composer__input {
  background: #1f2b4d;
  color: var(--text-dark);
}

body.dark .menu-panel__header,
body.dark .menu-panel__body,
body.dark .menu-panel__footer {
  background: #1a1a2e;
}

/* === ЗАГРУЗКА === */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* === СТАТУСЫ === */
.status-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.status-online {
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
}

.status-offline {
  background: var(--text-muted);
}

.status-away {
  background: var(--warning);
}

.status-busy {
  background: var(--error);
}

/* === ФОТО ПРЕВЬЮ МОДАЛКА === */
.photo-preview__content {
  max-width: 600px;
}

.photo-preview__image {
  max-width: 100%;
  max-height: 60vh;
  border-radius: var(--radius);
  margin: 20px 0;
}

.photo-caption {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 15px;
}

.photo-preview__actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.modal__close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-gray);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background var(--transition);
}

.modal__close:hover {
  background: var(--bg-light);
}

/* Исправление позиции панели */
.chat-info-panel {
  right: 0 !important;
  left: auto !important;
}

.chat-info-panel[style*="display: flex"] {
  animation: slideInRight 0.3s ease !important;
}

/* === КНОПКИ УПРАВЛЕНИЯ ЗВОНКОМ === */
.call-controls {
  display: flex;
  gap: 15px;
  justify-content: center;
  align-items: center;
  margin-top: 20px;
}

.call-control-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 60px;
  height: 60px;
  border: none;
  border-radius: 50%;
  font-size: 24px;
  cursor: pointer;
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

.call-control-btn:hover {
  transform: scale(1.1);
  background: rgba(255, 255, 255, 0.3);
}

.call-end-btn {
  background: linear-gradient(135deg, #eb3349 0%, #f45c43 100%);
}

.call-end-btn:hover {
  background: linear-gradient(135deg, #ff4d5a 0%, #ff6b5b 100%);
  box-shadow: 0 4px 15px rgba(235, 51, 73, 0.4);
}

/* Кнопка отмены звонка */
.call-cancel-btn {
  width: auto;
  padding: 12px 25px;
  border-radius: 25px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  font-size: 16px;
  gap: 10px;
}

.call-cancel-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

/* Кнопки входящего звонка */
.call-controls-incoming {
  display: flex;
  gap: 20px;
}

.call-accept-btn {
  background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.call-accept-btn:hover {
  background: linear-gradient(135deg, #13a094 0%, #3dff8a 100%);
  box-shadow: 0 4px 15px rgba(56, 239, 125, 0.4);
}

.call-decline-btn {
  background: linear-gradient(135deg, #eb3349 0%, #f45c43 100%);
}

.call-decline-btn:hover {
  background: linear-gradient(135deg, #ff4d5a 0%, #ff6b5b 100%);
  box-shadow: 0 4px 15px rgba(235, 51, 73, 0.4);
}