﻿/* ===== ГЛОБАЛЬНЫЕ СТИЛИ ===== */
:root {
  --primary-gold: #FFD700;
  --primary-orange: #FF8C00;
  --primary-dark: #5A3E07;
  --primary-light: #FFF9E6;
  --accent-red: #FF6B6B;
  --accent-teal: #0088CC;
  --neutral-white: #FFFFFF;
  --neutral-gray: #F5F7FA;
  --neutral-dark: #333333;
  --success-green: #2ECC71;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.15);
  --border-radius-sm: 12px;
  --border-radius-md: 16px;
  --border-radius-lg: 24px;
  --border-radius-xl: 30px;
  --transition-fast: 0.2s ease;
  --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Segoe UI', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  color: var(--neutral-dark);
  line-height: 1.6;
  font-weight: 400;
  min-height: 100vh;
  padding: 20px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* ===== КОНТЕЙНЕР ПРИЛОЖЕНИЯ ===== */
.app-container {
  width: 100%;
  max-width: 1440px;
  height: 95vh;
  background: var(--neutral-white);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: flex;
  position: relative;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 215, 0, 0.1);
}

/* ===== БОКОВАЯ ПАНЕЛЬ ===== */
.sidebar {
  width: 320px;
  background: linear-gradient(160deg, #FFF9E6 0%, #FFEECC 100%);
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 100;
  border-right: 1px solid rgba(255, 215, 0, 0.2);
  transition: transform var(--transition-base);
}

.sidebar-header {
  padding: 24px 20px;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 215, 0, 0.2);
}

.user-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-orange), var(--primary-gold));
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 24px;
  font-weight: 700;
  color: white;
  margin-right: 16px;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast);
}

.user-avatar:hover {
  transform: scale(1.05);
}

.user-info {
  flex: 1;
}

.user-shown-name {
  font-size: 18px;
  font-weight: 600;
  color: var(--primary-dark);
  margin-bottom: 4px;
  letter-spacing: -0.2px;
}

.username {
  font-size: 13px;
  color: #A38755;
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-indicator {
  width: 8px;
  height: 8px;
  background-color: var(--success-green);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.2);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.4); }
  70% { box-shadow: 0 0 0 6px rgba(46, 204, 113, 0); }
  100% { box-shadow: 0 0 0 0 rgba(46, 204, 113, 0); }
}

/* ===== КНОПКА НАСТРОЕК (ЗАКРУГЛЕННАЯ) ===== */
.profile-settings-btn {
  width: 40px;
  height: 40px;
  border-radius: 20px;
  border: none;
  background: linear-gradient(135deg, var(--primary-gold), var(--primary-orange));
  color: white;
  font-size: 18px;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  border: 2px solid white;
}

.profile-settings-btn:hover {
  transform: scale(1.1);
  box-shadow: var(--shadow-md);
}

/* ===== ВКЛАДКИ ===== */
.sidebar-tabs {
  display: flex;
  background: rgba(255, 255, 255, 0.8);
  padding: 0 16px;
  margin: 16px;
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-sm);
}

.tab-btn {
  flex: 1;
  padding: 14px 0;
  text-align: center;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: #A38755;
  transition: all var(--transition-fast);
  border-radius: 8px;
  margin: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.tab-btn:hover {
  background: rgba(255, 215, 0, 0.1);
  color: var(--primary-dark);
}

.tab-btn.active {
  background: linear-gradient(135deg, var(--primary-orange), var(--primary-gold));
  color: white;
  box-shadow: var(--shadow-sm);
}

/* ===== ПОИСК ===== */
.search-container {
  padding: 0 16px 16px;
}

.search-box {
  position: relative;
}

.search-box input {
  width: 100%;
  padding: 14px 20px 14px 48px;
  border: 2px solid transparent;
  border-radius: var(--border-radius-xl);
  background: rgba(255, 255, 255, 0.9);
  color: var(--primary-dark);
  font-size: 14px;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.search-box input:focus {
  outline: none;
  border-color: var(--primary-gold);
  box-shadow: 0 0 0 4px rgba(255, 215, 0, 0.1);
}

.search-box i {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--primary-orange);
  font-size: 16px;
}

/* ===== СПИСОК ЧАТОВ ===== */
.chats-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 16px;
  scrollbar-width: thin;
  scrollbar-color: var(--primary-gold) transparent;
}

.chats-list::-webkit-scrollbar {
  width: 6px;
}

.chats-list::-webkit-scrollbar-track {
  background: transparent;
}

.chats-list::-webkit-scrollbar-thumb {
  background: var(--primary-gold);
  border-radius: 3px;
}

.chat-item {
  display: flex;
  padding: 14px;
  margin-bottom: 8px;
  cursor: pointer;
  border-radius: var(--border-radius-md);
  transition: all var(--transition-fast);
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.7);
}

.chat-item:hover {
  background: rgba(255, 255, 255, 0.9);
  border-color: var(--primary-gold);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.chat-item.active {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(255, 140, 0, 0.1));
  border-color: var(--primary-gold);
}

.chat-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 20px;
  font-weight: 700;
  margin-right: 14px;
  background: linear-gradient(135deg, var(--primary-orange), var(--primary-gold));
  color: white;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.chat-info {
  flex: 1;
  min-width: 0;
}

.chat-name {
  font-weight: 600;
  color: var(--primary-dark);
  margin-bottom: 4px;
  font-size: 15px;
}

.chat-subinfo {
  font-size: 12px;
  color: #A38755;
  margin-bottom: 3px;
}

.last-message {
  font-size: 13px;
  color: #A38755;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.chat-time {
  font-size: 11px;
  color: #A38755;
  white-space: nowrap;
}

.unread-count {
  background: linear-gradient(135deg, var(--accent-red), #FF8E8E);
  color: white;
  font-size: 11px;
  font-weight: 600;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0 6px;
  box-shadow: var(--shadow-sm);
}

/* ===== ОБЛАСТЬ ЧАТА ===== */
.chat-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #FFFFFF 0%, #FFFEF9 100%);
  position: relative;
}

/* ===== ШАПКА ЧАТА (БЕЗ ТРЕХ ПОЛОСОК) ===== */
.chat-header {
  padding: 18px 24px;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 215, 0, 0.2);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  z-index: 10;
}

.menu-toggle {
  display: none !important;
}

.chat-header-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-orange), var(--primary-gold));
  color: white;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 20px;
  font-weight: 700;
  margin-right: 16px;
  box-shadow: var(--shadow-sm);
}

.chat-header-info {
  flex: 1;
}

.chat-header-name {
  font-size: 18px;
  font-weight: 600;
  color: var(--primary-dark);
  margin-bottom: 2px;
  cursor: pointer;
  transition: color var(--transition-fast);
}

.chat-header-name:hover {
  color: var(--primary-orange);
}

.chat-header-subinfo {
  font-size: 13px;
  color: #A38755;
  display: flex;
  align-items: center;
  gap: 6px;
}

.chat-actions {
  display: flex;
  gap: 12px;
}

.chat-action-btn {
  background: none;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--primary-dark);
  cursor: pointer;
  transition: all var(--transition-fast);
  background: rgba(255, 215, 0, 0.1);
}

.chat-action-btn:hover {
  background: rgba(255, 215, 0, 0.2);
  color: var(--primary-orange);
  transform: translateY(-2px);
}

/* ===== КОНТЕЙНЕР СООБЩЕНИЙ ===== */
.messages-container {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background:
    radial-gradient(circle at 20% 80%, rgba(255, 215, 0, 0.03) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255, 140, 0, 0.03) 0%, transparent 50%),
    #FFFFFF;
}

.message {
  max-width: 75%;
  padding: 12px 16px;
  border-radius: var(--border-radius-md);
  position: relative;
  animation: messageAppear 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  line-height: 1.5;
  word-wrap: break-word;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast);
}

@keyframes messageAppear {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.message:hover {
  transform: translateY(-2px);
}

.message.received {
  align-self: flex-start;
  background: linear-gradient(135deg, #FFFFFF, #FFFEF7);
  border: 1px solid rgba(255, 215, 0, 0.2);
  border-top-left-radius: 4px;
}

.message.sent {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--primary-gold), var(--primary-orange));
  color: white;
  border-top-right-radius: 4px;
}

.message-sender-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary-dark);
  margin-bottom: 6px;
}

.message-text {
  word-break: break-word;
}

.message-time {
  font-size: 11px;
  color: rgba(90, 62, 7, 0.6);
  margin-top: 8px;
  text-align: right;
  font-weight: 500;
}

.message.sent .message-time {
  color: rgba(255, 255, 255, 0.9);
}

.message-date-separator {
  text-align: center;
  margin: 20px 0;
  position: relative;
}

.message-date-separator::before,
.message-date-separator::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 30%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.3), transparent);
}

.message-date-separator::before {
  left: 0;
}

.message-date-separator::after {
  right: 0;
}

.message-date-separator span {
  background: rgba(255, 255, 255, 0.9);
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 13px;
  color: var(--primary-dark);
  font-weight: 500;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(255, 215, 0, 0.2);
}

/* ===== ПАНЕЛЬ ВВОДА ===== */
.input-area {
  padding: 20px 24px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(255, 215, 0, 0.2);
}

.input-container {
  display: flex;
  align-items: center;
  background: white;
  border-radius: var(--border-radius-xl);
  padding: 8px 20px;
  border: 2px solid rgba(255, 215, 0, 0.3);
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.input-container:focus-within {
  border-color: var(--primary-gold);
  box-shadow: 0 0 0 4px rgba(255, 215, 0, 0.1);
}

.input-container i {
  color: var(--primary-orange);
  font-size: 20px;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  transition: background var(--transition-fast);
}

.input-container i:hover {
  background: rgba(255, 215, 0, 0.1);
}

#messageInput {
  flex: 1;
  padding: 14px 16px;
  border: none;
  background: transparent;
  outline: none;
  font-size: 15px;
  color: var(--primary-dark);
  min-width: 0;
}

#messageInput::placeholder {
  color: #A38755;
  opacity: 0.7;
}

#sendButton {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-gold), var(--primary-orange));
  border: none;
  color: white;
  font-size: 20px;
  cursor: pointer;
  margin-left: 12px;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

#sendButton:not(:disabled):hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: var(--shadow-lg);
}

#sendButton:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ===== ЗАГЛУШКА БЕЗ ЧАТА ===== */
.no-chat-selected {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  padding: 40px;
  color: #A38755;
}

.no-chat-selected i {
  font-size: 96px;
  margin-bottom: 24px;
  color: var(--primary-gold);
  opacity: 0.7;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

.no-chat-selected h2 {
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--primary-dark);
}

.no-chat-selected p {
  font-size: 16px;
  max-width: 400px;
  line-height: 1.6;
  margin-bottom: 32px;
}

/* ===== КНОПКА СОЗДАНИЯ ЧАТА ===== */
.create-chat-container {
  padding: 0 16px 16px;
}

.create-chat-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, var(--primary-gold), var(--primary-orange));
  color: white;
  border: none;
  border-radius: var(--border-radius-md);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.create-chat-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.create-chat-btn i {
  font-size: 18px;
}

/* ===== СТРАНИЦЫ СОЗДАНИЯ/РЕГИСТРАЦИИ ===== */
.create-chat-page,
.auth-container,
.login-container {
  max-width: 440px;
  width: 100%;
  padding: 40px;
  background: white;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== НАСТРОЙКИ ===== */
.settings-header {
  display: flex;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid rgba(255, 215, 0, 0.2);
  margin-bottom: 16px;
}

.back-to-chats-btn {
  width: 40px;
  height: 40px;
  border-radius: 20px;
  border: none;
  background: rgba(255, 215, 0, 0.1);
  color: var(--primary-dark);
  font-size: 18px;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 16px;
}

.back-to-chats-btn:hover {
  background: rgba(255, 215, 0, 0.2);
  transform: translateX(-2px);
}

.settings-header h3 {
  font-size: 20px;
  font-weight: 600;
  color: var(--primary-dark);
}

.settings-menu {
  padding: 0 8px;
  overflow-y: auto;
  max-height: calc(100vh - 200px);
}

.settings-user-info {
  display: flex;
  align-items: center;
  padding: 16px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: var(--border-radius-md);
  margin-bottom: 20px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.settings-user-info:hover {
  background: rgba(255, 215, 0, 0.1);
  transform: translateY(-2px);
}

.settings-avatar {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-orange), var(--primary-gold));
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 24px;
  font-weight: 700;
  color: white;
  margin-right: 16px;
  box-shadow: var(--shadow-sm);
}

.settings-user-details {
  flex: 1;
}

.settings-user-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--primary-dark);
  margin-bottom: 4px;
}

.settings-user-login {
  font-size: 14px;
  color: #A38755;
}

.settings-item {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  cursor: pointer;
  transition: all var(--transition-fast);
  color: var(--primary-dark);
  text-decoration: none;
  border-radius: var(--border-radius-md);
  margin-bottom: 2px;
}

.settings-item:hover {
  background: rgba(255, 215, 0, 0.1);
}

.settings-item i:first-child {
  width: 24px;
  margin-right: 16px;
  color: var(--primary-orange);
  font-size: 18px;
}

.settings-item span {
  flex: 1;
  font-size: 15px;
  font-weight: 500;
}

.settings-value, .settings-status {
  font-size: 14px;
  color: #A38755;
  border-radius: 5px;
  border-color: transparent;
  padding: 3px;
}

.settings-item .fa-chevron-right {
  width: auto;
  margin-right: 0;
  color: #A38755;
  font-size: 14px;
}

.settings-divider {
  height: 1px;
  background: rgba(255, 215, 0, 0.2);
  margin: 12px 0;
}

.settings-header-small {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  color: #A38755;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 8px;
}

.logout-item {
  color: var(--accent-red);
}

.logout-item i {
  color: var(--accent-red);
}

.logout-item:hover {
  background: rgba(255, 107, 107, 0.1);
}

/* Переключатель темы */
.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-switch label {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #E0E0E0;
  border-radius: 24px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.toggle-switch label:before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  left: 2px;
  bottom: 2px;
  background: white;
  border-radius: 50%;
  transition: all var(--transition-fast);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked + label {
  background: linear-gradient(135deg, var(--primary-gold), var(--primary-orange));
}

.toggle-switch input:checked + label:before {
  transform: translateX(20px);
}

/* ===== ТЕМНАЯ ТЕМА (ПОЛНАЯ ВЕРСИЯ) ===== */
body.dark-theme {
  background: linear-gradient(135deg, #0F0F0F 0%, #1A1A1A 100%);
  color: #E0E0E0;
}

body.dark-theme .app-container {
  background: #121212;
  border-color: rgba(255, 215, 0, 0.3);
}

body.dark-theme .sidebar {
  background: linear-gradient(160deg, #1A1A1A 0%, #2D2D1A 100%);
  border-right-color: #FFD700;
}

body.dark-theme .sidebar-header {
  background: rgba(30, 30, 30, 0.95);
  border-bottom-color: #FFD700;
}

body.dark-theme .user-shown-name {
  color: #FFE066;
}

body.dark-theme .username {
  color: #FFD700;
}

body.dark-theme .sidebar-tabs {
  background: rgba(40, 40, 40, 0.9);
}

body.dark-theme .tab-btn {
  color: #FFD700;
}

body.dark-theme .tab-btn.active {
  background: linear-gradient(135deg, #FFD700, #FF8C00);
  color: #121212;
}

body.dark-theme .search-box input {
  background: rgba(40, 40, 40, 0.9);
  color: #E0E0E0;
  border-color: #FFD700;
}

body.dark-theme .chat-item {
  background: rgba(40, 40, 40, 0.8);
  border-color: rgba(255, 215, 0, 0.3);
}

body.dark-theme .chat-item:hover {
  background: rgba(50, 50, 50, 0.9);
  border-color: #FFD700;
}

body.dark-theme .chat-item.active {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 140, 0, 0.2));
  border-color: #FFD700;
}

body.dark-theme .chat-name {
  color: #FFE066;
}

body.dark-theme .chat-subinfo {
  color: #FFD700;
}

body.dark-theme .last-message {
  color: #E0B97E;
}

body.dark-theme .chat-area {
  background: linear-gradient(180deg, #121212 0%, #1A1A1A 100%);
}

body.dark-theme .chat-header {
  background: rgba(30, 30, 30, 0.95);
  border-bottom-color: #FFD700;
}

body.dark-theme .chat-header-name {
  color: #FFE066;
}

body.dark-theme .chat-header-subinfo {
  color: #FFD700;
}

body.dark-theme .chat-action-btn {
  background: rgba(255, 215, 0, 0.15);
  color: #FFE066;
}

body.dark-theme .chat-action-btn:hover {
  background: rgba(255, 215, 0, 0.3);
  color: #FFD700;
}

body.dark-theme .messages-container {
  background:
    radial-gradient(circle at 20% 80%, rgba(255, 215, 0, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255, 140, 0, 0.1) 0%, transparent 50%),
    #121212;
}

body.dark-theme .message.received {
  background: linear-gradient(135deg, #2A2A2A, #252525);
  border-color: #FFD700;
  color: #E0E0E0;
}

body.dark-theme .message.sent {
  background: linear-gradient(135deg, #FFD700, #FF8C00);
  color: #121212;
}

body.dark-theme .message-sender-name {
  color: #FFE066;
  background: rgba(255, 215, 0, 0.15);
  padding: 4px 12px;
  border-radius: 20px;
  display: inline-block;
}

body.dark-theme .message-time {
  color: rgba(255, 215, 0, 0.7);
}

body.dark-theme .message.sent .message-time {
  color: rgba(18, 18, 18, 0.8);
}

body.dark-theme .message-date-separator span {
  background: rgba(30, 30, 30, 0.95);
  color: #FFE066;
  border-color: #FFD700;
}

body.dark-theme .input-area {
  background: rgba(30, 30, 30, 0.95);
  border-top-color: #FFD700;
}

body.dark-theme .input-container {
  background: #2A2A2A;
  border-color: #FFD700;
}

body.dark-theme #messageInput {
  color: #E0E0E0;
}

body.dark-theme #messageInput::placeholder {
  color: #B89B6E;
}

body.dark-theme .create-chat-btn {
  background: linear-gradient(135deg, #FFD700, #FF8C00);
  color: #121212;
}

body.dark-theme .profile-settings-btn {
  background: linear-gradient(135deg, #FFD700, #FF8C00);
  color: #121212;
  border-color: #FFD700;
}

/* Темная тема для настроек */
body.dark-theme .settings-header {
  border-bottom-color: #FFD700;
}

body.dark-theme .settings-header h3 {
  color: #FFE066;
}

body.dark-theme .back-to-chats-btn {
  background: rgba(255, 215, 0, 0.2);
  color: #FFD700;
}

body.dark-theme .settings-user-info {
  background: rgba(255, 215, 0, 0.1);
}

body.dark-theme .settings-user-name {
  color: #FFE066;
}

body.dark-theme .settings-user-login {
  color: #FFD700;
}

body.dark-theme .settings-item {
  color: #E0E0E0;
}

body.dark-theme .settings-item:hover {
  background: rgba(255, 215, 0, 0.2);
}

body.dark-theme .settings-item i:first-child {
  color: #FFD700;
}

body.dark-theme .settings-value,
body.dark-theme .settings-status {
  color: #FFD700;
  background: rgba(255, 215, 0, 0.1);
}

body.dark-theme .settings-divider {
  background: rgba(255, 215, 0, 0.3);
}

body.dark-theme .settings-header-small {
  color: #FFD700;
}

body.dark-theme .toggle-switch label {
  background: #444;
}

body.dark-theme .toggle-switch input:checked + label {
  background: linear-gradient(135deg, #FFD700, #FF8C00);
}

/* ===== ИНДИКАТОР НАБОРА ТЕКСТА ===== */
.typing-indicator {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  margin: 8px 0;
  background: rgba(255, 215, 0, 0.1);
  border-radius: var(--border-radius-md);
  align-self: flex-start;
  max-width: 100px;
}

.typing-indicator span {
  height: 8px;
  width: 8px;
  background: var(--primary-gold);
  border-radius: 50%;
  display: inline-block;
  margin: 0 2px;
  animation: typing 1.4s infinite ease-in-out both;
}

.typing-indicator span:nth-child(1) {
  animation-delay: -0.32s;
}

.typing-indicator span:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes typing {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.6; }
  40% { transform: scale(1); opacity: 1; }
}

/* Темная тема для индикатора */
body.dark-theme .typing-indicator {
  background: rgba(255, 215, 0, 0.2);
}

body.dark-theme .typing-indicator span {
  background: #FFD700;
}

/* ===== УВЕДОМЛЕНИЯ ===== */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 16px 24px;
  background: white;
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 3000;
  animation: slideIn 0.3s ease-out;
  border-left: 4px solid var(--primary-gold);
  max-width: 300px;
  transition: all 0.3s ease;
}

.notification.error {
  border-left-color: var(--accent-red);
}

.notification.success {
  border-left-color: var(--success-green);
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Темная тема для уведомлений */
body.dark-theme .notification {
  background: #2A2A2A;
  color: #E0E0E0;
  border-left-color: #FFD700;
}

/* ===== МОБИЛЬНАЯ ВЕРСИЯ ===== */
@media (max-width: 768px) {
  body {
    padding: 0;
  }

  .app-container {
    height: 100vh;
    border-radius: 0;
    box-shadow: none;
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100%;
    width: 280px;
    transform: translateX(-100%);
    z-index: 1000;
    box-shadow: var(--shadow-lg);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .chat-area {
    width: 100%;
  }

  .message {
    max-width: 85%;
  }

  .create-chat-page,
  .auth-container,
  .login-container {
    margin: 20px;
    padding: 30px;
  }
  
  .settings-menu {
    max-height: calc(100vh - 180px);
  }
}

@media (max-width: 480px) {
  .chat-header {
    padding: 16px;
  }

  .messages-container {
    padding: 16px;
  }

  .input-area {
    padding: 16px;
  }
}

/* ===== АНИМАЦИИ ===== */
@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideOutLeft {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(-20px);
  }
}

#settingsSection {
  animation: slideInRight 0.3s ease;
}