/* === theme-toggle.css === */
/**
* Путь: /styles/theme-toggle.css
* Описание: Стили кнопки переключения темы и точечная адаптация глобального фона
*/

/* ===== КНОПКА ПЕРЕКЛЮЧЕНИЯ ===== */
.theme-toggle-btn {
    padding: 10px 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
}
.theme-icon {
    width: 20px;
    height: 20px;
    transition: transform 0.5s var(--ease-spring), opacity 0.3s;
    position: absolute;
}
/* Состояние по умолчанию (Темная тема) — видна луна */
.theme-icon--sun {
    opacity: 0;
    transform: rotate(-90deg) scale(0.5);
}
.theme-icon--moon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}
/* Светлая тема — видно солнце */
body.light-theme .theme-icon--sun {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}
body.light-theme .theme-icon--moon {
    opacity: 0;
    transform: rotate(90deg) scale(0.5);
}

/* ===== АДАПТАЦИЯ ФОНА ДЛЯ СВЕТЛОЙ ТЕМЫ (ТОЧНО КАК В ДОНОРЕ) ===== */
/* [cleanup] rainbow-bg removed */
body.light-theme::after {
    background: rgba(244, 247, 255, .38);
}
/* Корректировка шапки при скролле в светлой теме */
body.light-theme .header.scrolled {
    background: rgba(255, 255, 255, 0.85);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    border-bottom-color: rgba(0, 0, 0, 0.05);
}
/* Корректировка поиска и навигации */
body.light-theme .search-bar {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.1);
}
body.light-theme .search-bar input {
    color: var(--text-primary);
}
/* ===== СВЕТЛАЯ ТЕМА ДЛЯ БУРГЕРА И DRAWER ===== */
body.light-theme .nav-burger {
    background: rgba(0, 137, 94, 0.08);
    border-color: rgba(0, 137, 94, 0.3);
    color: #075b3e;
    text-shadow: none;
    box-shadow: none;
}
body.light-theme .nav-drawer__overlay {
    background: rgba(0, 0, 0, 0.3);
}
body.light-theme .nav-drawer__panel {
    background: #ffffff;
    border-right-color: #e2e8f0;
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.1);
}
body.light-theme .nav-drawer__header {
    background: #f8fafc;
    border-bottom-color: #e2e8f0;
}
body.light-theme .nav-drawer__header h3 {
    background: linear-gradient(135deg, #8b5cf6, #0066cc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
body.light-theme .nav-drawer__close {
    background: #f1f5f9;
    border-color: #e2e8f0;
    color: #4a5568;
}
body.light-theme .nav-drawer__close:hover {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #dc2626;
}
body.light-theme .nav-drawer__item {
    color: #1a202c;
}
body.light-theme .nav-drawer__item:hover {
    background: #f1f5f9;
    border-color: #cbd5e0;
    color: #0369a1;
}
body.light-theme .nav-drawer__item i,
body.light-theme .nav-drawer__item .nav-icon-img {
    color: #0369a1;
}
/* ==========================================================================
   Светлая тема — чистый фон вместо «радужного» градиента донора
   ========================================================================== */

body.light-theme {
  background:
    radial-gradient(circle at 12% 8%, rgba(91,82,224,.08), transparent 40%),
    radial-gradient(circle at 88% 92%, rgba(3,105,161,.07), transparent 42%),
    linear-gradient(135deg, #f4f7ff 0%, #f7fbff 48%, #eef3fb 100%) !important;
  color: var(--text-primary);
}
body.light-theme::after {
  background: transparent !important;
}

/* Кнопка темы в светлой теме */
body.light-theme .theme-toggle-btn {
  background: rgba(3,105,161,.06) !important;
  border: 1px solid rgba(3,105,161,.22) !important;
  color: #0369a1 !important;
  box-shadow: none !important;
}
body.light-theme .theme-toggle-btn:hover {
  background: rgba(3,105,161,.12) !important;
  border-color: rgba(3,105,161,.42) !important;
  color: #004a99 !important;
}
body.light-theme .theme-toggle-btn .theme-icon {
  color: #0369a1 !important;
  stroke: #0369a1 !important;
}


/* ===== Inline style #1 ===== */

.user-avatar-btn { position: relative; }
.user-avatar-btn .user-initial {
    width: 24px; height: 24px; border-radius: 50%;
    background: linear-gradient(135deg, var(--neon-cyan), var(--primary, #6c63ff));
    color: #fff !important; font-weight: 800; font-size: 13px;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 0 8px rgba(0, 243, 255, 0.3);
    text-shadow: none !important; line-height: 1;
    transition: all 0.3s var(--ease-spring);
}
.user-avatar-btn:hover .user-initial {
    box-shadow: 0 0 14px rgba(0, 243, 255, 0.6);
    transform: scale(1.08);
}
body.light-theme .user-avatar-btn .user-initial {
    background: linear-gradient(135deg, #0369a1, #8b5cf6);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    color: #fff !important;
}
body.light-theme .user-avatar-btn:hover .user-initial {
    box-shadow: 0 4px 14px rgba(3, 105, 161, 0.25);
}

/* === DROPDOWN МЕНЮ ПРОФИЛЯ === */
.user-menu-wrapper { position: relative; }
.user-menu-trigger { cursor: pointer; }
.user-menu-arrow {
    font-size: 9px; transition: transform 0.3s var(--ease-spring);
    margin-left: 2px; opacity: 0.7;
}
.user-menu-wrapper.active .user-menu-arrow { transform: rotate(180deg); opacity: 1; }

.user-dropdown-menu {
    position: absolute; top: calc(100% + 10px); right: 0;
    min-width: 240px;
    background: var(--bg-card, #2e2e5a);
    border: 1px solid rgba(0, 243, 255, 0.15);
    border-radius: var(--radius-lg, 16px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4), 0 0 24px rgba(0, 243, 255, 0.06);
    padding: 8px; z-index: 1003;
    opacity: 0; visibility: hidden;
    transform: translateY(-8px) scale(0.96);
    transition: all 0.25s var(--ease-spring);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}
.user-menu-wrapper.active .user-dropdown-menu {
    opacity: 1; visibility: visible;
    transform: translateY(0) scale(1);
}
.user-dropdown-header {
    padding: 12px 16px; margin-bottom: 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.user-dropdown-name {
    font-size: 14px; font-weight: 700;
    color: var(--text-primary); margin-bottom: 2px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user-dropdown-email {
    font-size: 12px; color: var(--text-muted);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user-dropdown-item {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 16px; border-radius: var(--radius-md, 12px);
    color: var(--text-secondary); text-decoration: none;
    font-size: 14px; font-weight: 500;
    transition: all 0.2s var(--ease-spring);
}
.user-dropdown-item:hover {
    background: rgba(0, 243, 255, 0.08);
    color: var(--text-primary);
    transform: translateX(4px);
}
.user-dropdown-item i {
    width: 20px; text-align: center;
    color: var(--neon-cyan); font-size: 15px;
    flex-shrink: 0;
}
.user-dropdown-item--danger { color: var(--neon-pink, #ff6584); }
.user-dropdown-item--danger i { color: var(--neon-pink, #ff6584); }
.user-dropdown-item--danger:hover {
    background: rgba(255, 101, 132, 0.08); color: #ff3366;
}
.user-dropdown-divider {
    height: 1px; background: rgba(255, 255, 255, 0.06);
    margin: 6px 8px;
}

/* Светлая тема dropdown */
body.light-theme .user-dropdown-menu {
    background: rgba(255, 255, 255, 0.95);
    border-color: #e2e8f0;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.12);
}
body.light-theme .user-dropdown-header {
    border-bottom-color: #e2e8f0;
}
body.light-theme .user-dropdown-name { color: #1a202c; }
body.light-theme .user-dropdown-email { color: #718096; }
body.light-theme .user-dropdown-item { color: #4a5568; }
body.light-theme .user-dropdown-item:hover {
    background: #f1f5f9; color: #1a202c;
}
body.light-theme .user-dropdown-item i { color: #0369a1; }
body.light-theme .user-dropdown-item--danger { color: #c53030; }
body.light-theme .user-dropdown-item--danger i { color: #c53030; }
body.light-theme .user-dropdown-item--danger:hover {
    background: #fff5f5; color: #c53030;
}
body.light-theme .user-dropdown-divider { background: #e2e8f0; }

/* Адаптивность для узких экранов */
@media (max-width: 768px) {
    .user-menu-wrapper .btn-text,
    .user-logout-btn .btn-text { display: none; }
    .user-avatar-btn, .user-logout-btn {
        width: 40px !important; height: 40px !important;
        min-height: 40px !important; padding: 0 !important; gap: 0 !important;
    }
    .user-avatar-btn .user-initial { width: 22px; height: 22px; font-size: 12px; }
    .user-dropdown-menu { right: -40px; min-width: 220px; }
}
@media (max-width: 480px) {
    .user-avatar-btn, .user-logout-btn {
        width: 38px !important; height: 38px !important; min-height: 38px !important;
    }
    .user-avatar-btn .user-initial { width: 20px; height: 20px; font-size: 11px; }
    .user-dropdown-menu { right: -20px; min-width: 200px; }
    .user-dropdown-item { padding: 10px 12px; font-size: 13px; }
}
/* === КОЛОКОЛЬЧИК СООБЩЕНИЙ === */
.msg-bell-btn {
position: relative;
padding: 0 !important;
width: 42px !important;
height: 42px !important;
min-height: 42px !important;
gap: 0 !important;
}
.msg-bell-badge {
z-index: 2;
pointer-events: none;
}
.msg-bell-btn .btn-icon {
width: 18px;
height: 18px;
}
.msg-bell-badge {
position: absolute;
top: 2px;
right: 2px;
min-width: 18px;
height: 18px;
padding: 0 4px;
border-radius: 999px;
background: #ff5c7a;
color: #fff;
font-size: 10px;
font-weight: 800;
line-height: 18px;
text-align: center;
box-shadow: 0 2px 6px rgba(255, 92, 122, 0.4);
animation: msgBellPulse 2s ease-in-out infinite;
}
@keyframes msgBellPulse {
0%, 100% { transform: scale(1); }
50% { transform: scale(1.1); }
}
body.light-theme .msg-bell-badge {
background: #dc2626;
box-shadow: 0 2px 6px rgba(220, 38, 38, 0.3);
}
@media (max-width: 768px) {
.msg-bell-btn {
width: 40px !important;
height: 40px !important;
min-height: 40px !important;
}
.msg-bell-badge {
top: 2px;
right: 2px;
min-width: 16px;
height: 16px;
font-size: 9px;
line-height: 16px;
}
}
@media (max-width: 480px) {
.msg-bell-btn {
width: 38px !important;
height: 38px !important;
min-height: 38px !important;
}
}

/* ==========================================================================
   === SUN ICON: светлое солнце в тёмной теме ===
   Фоновая иконка солнца на треке переключателя темы — всегда светлая,
   чтобы читалась на тёмном фоне. Раньше правило было только
   внутри .auth-buttons.
   ========================================================================== */

/* Тёмная тема — солнце светлое, луна тоже светлая */
html body:not(.light-theme) .theme-toggle .theme-toggle__bg-icon--sun,
html body:not(.light-theme) .theme-toggle .theme-toggle__bg-icon--sun svg,
html body:not(.light-theme) .theme-toggle .theme-toggle__bg-icon--sun .icon,
html body:not(.light-theme) .theme-toggle .theme-toggle__bg-icon--sun svg use {
    color: rgba(255, 255, 255, 0.85) !important;
    fill: rgba(255, 255, 255, 0.85) !important;
}

html body:not(.light-theme) .theme-toggle .theme-toggle__bg-icon--moon,
html body:not(.light-theme) .theme-toggle .theme-toggle__bg-icon--moon svg,
html body:not(.light-theme) .theme-toggle .theme-toggle__bg-icon--moon .icon,
html body:not(.light-theme) .theme-toggle .theme-toggle__bg-icon--moon svg use {
    color: rgba(255, 255, 255, 0.5) !important;
    fill: rgba(255, 255, 255, 0.5) !important;
}

/* Светлая тема — солнце тёмно-серое, луна ещё темнее */
html body.light-theme .theme-toggle .theme-toggle__bg-icon--sun,
html body.light-theme .theme-toggle .theme-toggle__bg-icon--sun svg,
html body.light-theme .theme-toggle .theme-toggle__bg-icon--sun .icon,
html body.light-theme .theme-toggle .theme-toggle__bg-icon--sun svg use {
    color: rgba(20, 20, 50, 0.35) !important;
    fill: rgba(20, 20, 50, 0.35) !important;
}
html body.light-theme .theme-toggle .theme-toggle__bg-icon--moon,
html body.light-theme .theme-toggle .theme-toggle__bg-icon--moon svg,
html body.light-theme .theme-toggle .theme-toggle__bg-icon--moon .icon,
html body.light-theme .theme-toggle .theme-toggle__bg-icon--moon svg use {
    color: rgba(20, 20, 50, 0.6) !important;
    fill: rgba(20, 20, 50, 0.6) !important;
}

/* Иконка внутри самого ползунка — тоже светлее в тёмной теме */
html body:not(.light-theme) .theme-toggle .theme-toggle__knob-icon--moon,
html body:not(.light-theme) .theme-toggle .theme-toggle__knob-icon--moon svg {
    color: #ffffff !important;
    fill: #ffffff !important;
}