/* ============================================================
   Глобальные правила светлой темы (light-theme).
   Вынесены дубли из модулей: account-auth, account-cabinet,
   admin-cabinet, admin-form-enhanced, admin-users, admin,
   ads-feed, cookie-consent и др.
   Подключается ПОСЛЕДНИМ в <head>.
   ============================================================ */

body.light-theme [class*="glow"],
body.light-theme [class*="neon"] {
  box-shadow: 0 2px 8px rgba(23,24,47,.06) !important;
  text-shadow: none !important;
}

body.light-theme [class*="nav__item"].is-active,
body.light-theme [class*="menu__item"].is-active,
body.light-theme [class*="sidebar__item"].is-active,
body.light-theme [class*="nav-item"].active,
body.light-theme [class*="nav__item"]:hover,
body.light-theme [class*="menu__item"]:hover {
  color: #0369a1 !important;
  background: rgba(3,105,161,.08) !important;
  box-shadow: none !important;
  border-color: rgba(3,105,161,.24) !important;
}

body.light-theme [class*="badge"][class*="success"],
body.light-theme [class*="status"][class*="active"],
body.light-theme [class*="chip"][class*="ok"],
body.light-theme .success {
  color: #047857 !important;
  background: rgba(4,120,87,.1) !important;
  border-color: rgba(4,120,87,.28) !important;
}

body.light-theme [class*="badge"][class*="danger"],
body.light-theme [class*="status"][class*="rejected"],
body.light-theme .danger,
body.light-theme .error {
  color: #be123c !important;
  background: rgba(190,18,60,.1) !important;
  border-color: rgba(190,18,60,.28) !important;
}

body.light-theme [class*="badge"][class*="warning"],
body.light-theme [class*="status"][class*="moderation"],
body.light-theme .warning {
  color: #b45309 !important;
  background: rgba(180,83,9,.1) !important;
  border-color: rgba(180,83,9,.28) !important;
}

body.light-theme [class*="__icon"],
body.light-theme [class*="__ic"] {
  text-shadow: none !important;
  filter: none !important;
}

body.light-theme a:not([class]) {
  color: #0369a1;
}

body.light-theme a:not([class]):visited {
 color: #0369a1;
}

body.light-theme a:not([class]):hover {
 color: #004a99;
}

body.light-theme .form-actions {
 border-top-color: #edf2f7;
}

body.light-theme .vs-number-btn {
    background: rgba(3, 105, 161, 0.08);
    color: #0369a1;
}

body.light-theme .vs-number-btn:hover {
    background: rgba(3, 105, 161, 0.16);
    box-shadow: 0 2px 8px rgba(3, 105, 161, 0.18);
    color: #024e7a;
}

body.light-theme .vs-number-btn:active {
    background: rgba(3, 105, 161, 0.25);
}

body.light-theme .form-check-label {
 color: #4a5568;
}

body.light-theme .admin-tab {
 color: #718096;
}

body.light-theme .admin-tab:hover {
 color: #2d3748;
}

body.light-theme .admin-page-dots {
 color: #a0aec0;
}

body.light-theme .nav-burger:hover {
    background: rgba(0, 137, 94, 0.15);
    border-color: rgba(0, 137, 94, 0.5);
    color: #05462e;
    box-shadow: 0 4px 12px rgba(0, 137, 94, 0.15);
}

/* ============================================================================
   FINAL OVERRIDE (загружается ПОСЛЕДНИМ, !important перебивает всё)
   ============================================================================ */

/* --- Кнопки Вход и Регистрация: фиолетовый градиент, белый текст, БЕЛЫЕ иконки --- */
.auth-buttons .neon-btn,
.auth-buttons a.neon-btn {
    background: linear-gradient(135deg, #5b52e0, #0369a1) !important;
    color: #ffffff !important;
    border: 1.5px solid transparent !important;
    text-shadow: none !important;
    box-shadow: 0 2px 8px rgba(91,82,224,.20) !important;
    -webkit-text-fill-color: #ffffff !important;
}
.auth-buttons .neon-btn:hover,
.auth-buttons a.neon-btn:hover {
    filter: brightness(1.10) !important;
    box-shadow: 0 4px 14px rgba(91,82,224,.32) !important;
    color: #ffffff !important;
}
.auth-buttons .neon-btn .icon,
.auth-buttons .neon-btn .btn-icon svg,
.auth-buttons .neon-btn .btn-icon svg use,
.auth-buttons .neon-btn .btn-icon svg path,
.auth-buttons a.neon-btn .btn-icon svg,
.auth-buttons a.neon-btn .btn-icon svg use,
.auth-buttons a.neon-btn .btn-icon svg path {
    fill: #ffffff !important;
    color: #ffffff !important;
    stroke: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}
.auth-buttons .neon-btn .btn-text,
.auth-buttons a.neon-btn .btn-text {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

/* === Тёмная тема: сохраняем ту же фиолетовую заливку кнопок для единообразия === */
body:not(.light-theme) .auth-buttons .neon-btn,
body:not(.light-theme) .auth-buttons a.neon-btn {
    background: linear-gradient(135deg, #5b52e0, #0369a1) !important;
    color: #ffffff !important;
    border-color: transparent !important;
    box-shadow: 0 2px 8px rgba(91,82,224,.35) !important;
}
body:not(.light-theme) .auth-buttons .neon-btn .icon,
body:not(.light-theme) .auth-buttons .neon-btn .btn-icon svg,
body:not(.light-theme) .auth-buttons .neon-btn .btn-icon svg use,
body:not(.light-theme) .auth-buttons .neon-btn .btn-icon svg path {
    fill: #ffffff !important;
    color: #ffffff !important;
    stroke: #ffffff !important;
}
body:not(.light-theme) .auth-buttons .neon-btn .btn-text {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

/* --- Переключатель темы: всегда видим и контрастен --- */
.theme-switch {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    align-items: stretch !important;
    height: 40px !important;
    min-height: 40px !important;
    width: auto !important;
    min-width: 76px !important;
    max-width: none !important;
    padding: 0 !important;
    margin: 0 0 0 6px !important;
    border: 1.5px solid rgba(0, 243, 255, 0.55) !important;
    border-radius: 12px !important;
    background: rgba(20, 20, 50, 0.9) !important;
    font-family: inherit !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    overflow: hidden !important;
    cursor: pointer !important;
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.25) !important;
    transition: all 0.3s ease !important;
    flex-shrink: 0 !important;
    vertical-align: middle !important;
    line-height: 1 !important;
    position: relative !important;
    z-index: 5 !important;
}
.theme-switch:hover {
    border-color: rgba(0, 243, 255, 0.95) !important;
    box-shadow: 0 0 18px rgba(0, 243, 255, 0.4) !important;
}
.theme-switch:focus-visible {
    outline: 2px solid #94adae !important;
    outline-offset: 2px !important;
}
.theme-switch > span {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 36px !important;
    height: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    font-size: 16px !important;
    line-height: 1 !important;
    background: transparent !important;
    transition: background 0.3s, color 0.3s !important;
    box-sizing: border-box !important;
}
.theme-switch .theme-switch__moon {
    background: linear-gradient(135deg, #94adae, #6c63ff) !important;
    color: #ffffff !important;
}
.theme-switch .theme-switch__sun {
    background: transparent !important;
    color: rgba(230, 230, 240, 0.75) !important;
}
body.light-theme .theme-switch {
    background: #ffffff !important;
    border: 1.5px solid rgba(91, 82, 224, 0.55) !important;
    box-shadow: 0 2px 8px rgba(91, 82, 224, 0.20) !important;
}
body.light-theme .theme-switch:hover {
    border-color: rgba(91, 82, 224, 0.95) !important;
    box-shadow: 0 4px 14px rgba(91, 82, 224, 0.30) !important;
}
body.light-theme .theme-switch .theme-switch__moon {
    background: transparent !important;
    color: rgba(91, 82, 224, 0.55) !important;
}
body.light-theme .theme-switch .theme-switch__sun {
    background: linear-gradient(135deg, #5b52e0, #0369a1) !important;
    color: #ffffff !important;
}

@media (max-width: 480px) {
    .theme-switch {
        height: 38px !important;
        min-height: 38px !important;
        min-width: 68px !important;
        margin-left: 4px !important;
    }
    .theme-switch > span {
        width: 32px !important;
        font-size: 15px !important;
    }
}

/* === END FINAL OVERRIDE === */

/* ============================================================
   Кнопка "Подать объявление" — градиент #fd5f10 → #7a50fc,
   полностью скруглённая, белый текст, анимированная обводка
   при hover (без смещения).
   ============================================================ */

@keyframes btn-ad-run { to { --vk-a: 360deg; } }

html body a.btn-submit-ad {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    min-height: 40px;
    border-radius: 999px !important;
    background: linear-gradient(135deg, #fd5f10 0%, #7a50fc 100%) !important;
    color: #ffffff !important;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .3px;
    text-transform: uppercase;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    border: 0 !important;
    box-shadow: 0 2px 8px rgba(253, 95, 16, 0.25) !important;
    transition: box-shadow 0.25s ease;
    flex-shrink: 0;
    vertical-align: middle;
    z-index: 1;
}
html body a.btn-submit-ad:hover {
    /* НЕ двигаем кнопку, только свечение */
    box-shadow: 0 4px 14px rgba(122, 80, 252, 0.35) !important;
}
html body a.btn-submit-ad:focus-visible {
    outline: 2px solid #fd5f10;
    outline-offset: 2px;
}

html body a.btn-submit-ad .btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    color: #ffffff !important;
    flex-shrink: 0;
}
html body a.btn-submit-ad .btn-icon .icon {
    width: 14px;
    height: 14px;
    fill: #ffffff !important;
    color: #ffffff !important;
}
html body a.btn-submit-ad .btn-text {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    line-height: 1;
}

/* Анимированная обводка при hover — как у .cat-card */
html body a.btn-submit-ad::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    z-index: 2;
    padding: 2px;
    background: conic-gradient(from var(--vk-a),
        rgba(0,229,255,0) 0deg, #00e5ff 60deg, #9b6bff 140deg, #ff3d94 210deg, #00e5ff 300deg, rgba(0,229,255,0) 360deg);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    filter: blur(.4px) saturate(1.2);
    opacity: 0;
    transition: opacity .22s ease;
}
html body a.btn-submit-ad:hover::after {
    opacity: 1;
    animation: btn-ad-run 2.4s linear infinite;
}

/* Светлая тема — те же цвета */
html body.light-theme a.btn-submit-ad {
    background: linear-gradient(135deg, #fd5f10 0%, #7a50fc 100%) !important;
    color: #ffffff !important;
}
html body.light-theme a.btn-submit-ad .btn-icon .icon {
    fill: #ffffff !important;
    color: #ffffff !important;
}
html body.light-theme a.btn-submit-ad .btn-text {
    color: #ffffff !important;
}

/* Мобильный — только иконка */
@media (max-width: 900px) {
    html body a.btn-submit-ad {
        padding: 0;
        width: 40px;
        height: 40px;
        min-height: 40px;
        gap: 0;
    }
    html body a.btn-submit-ad .btn-text {
        display: none;
    }
}
@media (max-width: 480px) {
    html body a.btn-submit-ad {
        width: 38px;
        height: 38px;
        min-height: 38px;
    }
}

/* === Приоритетная защита кнопки "Подать объявление" от правил html body a === */
html body a.btn-submit-ad,
html body a.btn-submit-ad:hover,
html body a.btn-submit-ad:visited,
html body a.btn-submit-ad:focus {
    background: linear-gradient(135deg, #fd5f10 0%, #7a50fc 100%) !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    border-radius: 999px !important;
    text-decoration: none !important;
    border: 0 !important;
}
html body a.btn-submit-ad .btn-text {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}
html body a.btn-submit-ad .btn-icon,
html body a.btn-submit-ad .btn-icon .icon,
html body a.btn-submit-ad svg.icon,
html body a.btn-submit-ad svg.icon use {
    color: #ffffff !important;
    fill: #ffffff !important;
}

/* ============================================================================
   === ТЕМЫ: БАЗОВЫЙ ФОН И ЦВЕТА ТЕКСТА ===
   Светлая: белый фон, тёмный текст.
   Тёмная:  #2f2f2f фон, светлый текст.
   Подключается последним — перебивает старые декоративные слои.
   ============================================================================ */

/* ---------- СВЕТЛАЯ ТЕМА (по умолчанию) ---------- */
html body.light-theme {
    background: #ffffff !important;
    background-image: none !important;
    background-color: #ffffff !important;
    color: #17182f !important;
}

/* Переменные для светлой темы (перебивают :root) */
html body.light-theme {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f8f8;
    --bg-card: #ffffff;
    --bg-elevated: #f3f4f6;
    --bg-glass: #ffffff;
    --text-primary: #17182f;
    --text-secondary: #4a5568;
    --text-muted: #718096;
    --border-color: #e2e8f0;
    --lk-surface: #ffffff;
    --lk-line: #e2e8f0;
    --lk-txt: #17182f;
    --lk-txt-dim: #4a5568;
}

/* Убираем декоративные слои в светлой теме */
html body.light-theme .bg-pattern-layer,
html body.light-theme::after,
html body.light-theme .auth-bg,
html body.light-theme .cabinet-bg,
html body.light-theme .admin-bg {
    background: transparent !important;
    background-image: none !important;
}
html body.light-theme .bg-pattern-layer {
    display: none !important;
}

/* Типовые поверхностные элементы в светлой теме — светлые с границей */
html body.light-theme .cat-card {
    background-color: #f3f3f3 !important;
    background-image: none !important;
}
html body.light-theme .nav-burger {
    background-color: rgba(3, 105, 161, 0.06) !important;
    color: #0369a1 !important;
    border-color: rgba(3, 105, 161, 0.25) !important;
}
html body.light-theme .nav-region {
    background-color: #ffffff !important;
    color: #4a5568 !important;
    border-color: #e2e8f0 !important;
}

/* ---------- ТЁМНАЯ ТЕМА (когда .light-theme НЕ на body) ---------- */
html body:not(.light-theme) {
    background: #2f2f2f !important;
    background-image: none !important;
    background-color: #2f2f2f !important;
    color: #f0f0f0 !important;
}

/* Переменные для тёмной темы */
html body:not(.light-theme) {
    --bg-primary: #2f2f2f;
    --bg-secondary: #3a3a3a;
    --bg-card: #3a3a3a;
    --bg-elevated: #454545;
    --bg-glass: #3a3a3a;
    --text-primary: #f0f0f0;
    --text-secondary: rgba(240, 240, 240, 0.78);
    --text-muted: rgba(240, 240, 240, 0.5);
    --border-color: rgba(255, 255, 255, 0.10);
    --lk-surface: #3a3a3a;
    --lk-line: rgba(255, 255, 255, 0.10);
    --lk-txt: #f0f0f0;
    --lk-txt-dim: rgba(240, 240, 240, 0.6);
}

/* Убираем декоративные слои в тёмной теме */
html body:not(.light-theme) .bg-pattern-layer,
html body:not(.light-theme)::after {
    background: transparent !important;
    background-image: none !important;
}
html body:not(.light-theme) .bg-pattern-layer {
    display: none !important;
}

/* Типовые поверхности в тёмной теме */
html body:not(.light-theme) .cat-card {
    background-color: #3a3a3a !important;
    background-image: none !important;
    color: #ffffff !important;
}
html body:not(.light-theme) .cat-card .cat-name {
    color: #ffffff !important;
}
html body:not(.light-theme) .nav-burger {
    background-color: rgba(0, 243, 255, 0.10) !important;
    color: var(--neon-cyan) !important;
    border-color: rgba(0, 243, 255, 0.3) !important;
}
html body:not(.light-theme) .nav-region {
    background-color: rgba(0, 243, 255, 0.06) !important;
    color: #e6e6f0 !important;
    border-color: rgba(0, 243, 255, 0.25) !important;
}

/* FLAT-BG-UNIFIED 2026-10-09 */
/*
 * Единый фон для всего сайта: ЛК (cabinet-page / add-ad-body / lk-page)
 * управляется из этого файла. Значения совпадают с главной страницей:
 *   тёмная тема  — #2f2f2f
 *   светлая тема — #ffffff
 * Специфичность html body.light-theme.cabinet-page = (0,2,2) перебивает
 * правила из css/account-cabinet.css (0,2,1) и theme-main.css (0,1,2).
 */
html body.cabinet-page,
html body.add-ad-body,
html body.lk-page {
    background: #2f2f2f !important;
    background-color: #2f2f2f !important;
    background-image: none !important;
}

html body.light-theme.cabinet-page,
html body.light-theme.add-ad-body,
html body.light-theme.lk-page {
    background: #ffffff !important;
    background-color: #ffffff !important;
    background-image: none !important;
}
