:root {
    --page-bg: #0f0f1a;
    --page-text: #e2e8f0;
    --surface-glass: rgba(255, 255, 255, 0.05);
    --surface-card: rgba(255, 255, 255, 0.04);
    --surface-muted: rgba(255, 255, 255, 0.06);
    --surface-hover: rgba(255, 255, 255, 0.1);
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-soft: rgba(255, 255, 255, 0.1);
    --text-strong: #f8fafc;
    --text-main: #e2e8f0;
    --text-muted: #94a3b8;
    --text-faint: #64748b;
    --input-bg: rgba(0, 0, 0, 0.3);
    --input-bg-strong: rgba(0, 0, 0, 0.4);
    --scroll-track: #15152a;
    --scroll-thumb: #3a3a5c;
    --theme-toggle-bg: rgba(255, 255, 255, 0.08);
    --theme-toggle-border: rgba(255, 255, 255, 0.14);
}

:root[data-theme="light"] {
    --page-bg: #f7f8fb;
    --page-text: #111827;
    --surface-glass: rgba(255, 255, 255, 0.82);
    --surface-card: rgba(255, 255, 255, 0.9);
    --surface-muted: rgba(15, 23, 42, 0.06);
    --surface-hover: rgba(15, 23, 42, 0.1);
    --border-subtle: rgba(15, 23, 42, 0.1);
    --border-soft: rgba(15, 23, 42, 0.14);
    --text-strong: #0f172a;
    --text-main: #1f2937;
    --text-muted: #475569;
    --text-faint: #64748b;
    --input-bg: rgba(255, 255, 255, 0.92);
    --input-bg-strong: rgba(255, 255, 255, 0.98);
    --scroll-track: #e2e8f0;
    --scroll-thumb: #94a3b8;
    --theme-toggle-bg: rgba(255, 255, 255, 0.9);
    --theme-toggle-border: rgba(15, 23, 42, 0.14);
}

:root[data-theme="light"],
:root[data-theme="light"] body {
    background: var(--page-bg) !important;
    color: var(--page-text) !important;
}

:root[data-theme="light"] .login-page {
    background: var(--page-bg) !important;
}

.theme-toggle {
    width: 2rem;
    height: 2rem;
    border-radius: 9999px;
    border: 1px solid var(--theme-toggle-border);
    background: var(--theme-toggle-bg);
    color: var(--text-main);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background .15s ease, border-color .15s ease, transform .15s ease;
}

.theme-toggle:hover {
    background: var(--surface-hover);
    transform: translateY(-1px);
}

:root[data-theme="light"] .glass,
:root[data-theme="light"] .card {
    background: var(--surface-card);
    border-color: var(--border-subtle);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.07);
}

:root[data-theme="light"] .glass {
    background: var(--surface-glass);
}

:root[data-theme="light"] .text-white,
:root[data-theme="light"] .text-slate-100,
:root[data-theme="light"] .text-slate-200,
:root[data-theme="light"] .text-slate-300 {
    color: var(--text-main);
}

:root[data-theme="light"] .week-badge-a.text-white,
:root[data-theme="light"] .week-badge-b.text-white,
:root[data-theme="light"] .bg-violet-600.text-white,
:root[data-theme="light"] .bg-slate-700.text-white,
:root[data-theme="light"] .bg-gradient-to-r.text-white,
:root[data-theme="light"] .viber-btn.text-white,
:root[data-theme="light"] .viber-share-btn.text-white {
    color: #fff;
}

:root[data-theme="light"] .text-slate-400 {
    color: var(--text-muted);
}

:root[data-theme="light"] .text-slate-500,
:root[data-theme="light"] .text-slate-600,
:root[data-theme="light"] .text-slate-700 {
    color: var(--text-faint);
}

:root[data-theme="light"] .bg-black,
:root[data-theme="light"] .bg-black\/20,
:root[data-theme="light"] .bg-black\/30,
:root[data-theme="light"] .bg-black\/40,
:root[data-theme="light"] .bg-black\/70,
:root[data-theme="light"] .bg-\[\#1e1e35\],
:root[data-theme="light"] .bg-slate-800,
:root[data-theme="light"] .bg-white\/5,
:root[data-theme="light"] .bg-white\/10,
:root[data-theme="light"] .bg-slate-800\/50 {
    background-color: var(--surface-muted);
}

:root[data-theme="light"] .subject-dropdown {
    background: var(--surface-card);
    border-color: var(--border-soft);
    box-shadow: 0 18px 45px rgba(15, 23, 42, .14);
}

:root[data-theme="light"] .border-white\/5,
:root[data-theme="light"] .border-white\/10,
:root[data-theme="light"] .border-white\/15,
:root[data-theme="light"] .border-white\/20 {
    border-color: var(--border-soft);
}

:root[data-theme="light"] input,
:root[data-theme="light"] select,
:root[data-theme="light"] textarea {
    color: var(--text-main);
}

:root[data-theme="light"] input.bg-white\/5,
:root[data-theme="light"] input.bg-black\/30,
:root[data-theme="light"] input.bg-black\/40,
:root[data-theme="light"] select.bg-black\/30,
:root[data-theme="light"] select.bg-black\/40,
:root[data-theme="light"] textarea.bg-black\/30,
:root[data-theme="light"] textarea.bg-black\/40 {
    background-color: var(--input-bg-strong);
    border-color: var(--border-soft);
}

:root[data-theme="light"] .placeholder-slate-500::placeholder {
    color: #94a3b8;
}

:root[data-theme="light"] .hover\:text-white:hover {
    color: var(--text-strong);
}

:root[data-theme="light"] .hover\:bg-white\/5:hover,
:root[data-theme="light"] .hover\:bg-white\/8:hover,
:root[data-theme="light"] .hover\:bg-white\/10:hover {
    background-color: var(--surface-hover);
}

:root[data-theme="light"] .prose h1,
:root[data-theme="light"] .prose h2 {
    color: #6d28d9;
}

:root[data-theme="light"] .prose h3,
:root[data-theme="light"] .prose strong {
    color: var(--text-strong);
}

:root[data-theme="light"] .prose p,
:root[data-theme="light"] .prose ul li,
:root[data-theme="light"] .prose ol li,
:root[data-theme="light"] .toc-link {
    color: var(--text-muted);
}

:root[data-theme="light"] .prose hr {
    border-top-color: var(--border-subtle);
}

:root[data-theme="light"] .prose code {
    background: rgba(124, 58, 237, .1);
    color: #5b21b6;
}
