/* ============================================================
   CareerPrep Hub — White Glassy theme
   Light is the default. This file remaps the dark Tailwind
   utilities used throughout the templates to a frosted,
   glassy white aesthetic — no per-template rewrites needed.
   ============================================================ */

:root,
[data-theme="light"] {
    --bg-primary: #eef2fb;
    --bg-secondary: #ffffff;
    --bg-card: rgba(255, 255, 255, 0.7);
    --bg-card-hover: rgba(255, 255, 255, 0.92);
    --glass-bg: rgba(255, 255, 255, 0.62);
    --glass-bg-strong: rgba(255, 255, 255, 0.82);
    --glass-border: rgba(255, 255, 255, 0.8);
    --hairline: rgba(15, 23, 42, 0.08);
    --hairline-soft: rgba(15, 23, 42, 0.05);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --border: rgba(15, 23, 42, 0.1);
    --border-hover: rgba(99, 102, 241, 0.45);
    --input-bg: rgba(255, 255, 255, 0.85);
    --loader-bg: #eef2fb;
    --nav-bg: rgba(255, 255, 255, 0.72);
    --shadow: rgba(15, 23, 42, 0.08);
    --shadow-lg: rgba(15, 23, 42, 0.12);
    --scroll-track: rgba(15, 23, 42, 0.06);
    color-scheme: light;
}

/* Dark theme retained for the optional toggle */
[data-theme="dark"] {
    --bg-primary: #0b1020;
    --bg-secondary: #111827;
    --bg-card: rgba(17, 24, 39, 0.8);
    --bg-card-hover: #111827;
    --glass-bg: rgba(17, 24, 39, 0.6);
    --glass-bg-strong: rgba(17, 24, 39, 0.85);
    --glass-border: rgba(255, 255, 255, 0.1);
    --hairline: rgba(255, 255, 255, 0.1);
    --hairline-soft: rgba(255, 255, 255, 0.05);
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --border: rgba(255, 255, 255, 0.1);
    --border-hover: rgba(99, 102, 241, 0.3);
    --input-bg: #111827;
    --loader-bg: #0b1020;
    --nav-bg: rgba(11, 16, 32, 0.8);
    --shadow: rgba(0, 0, 0, 0.3);
    --shadow-lg: rgba(0, 0, 0, 0.5);
    --scroll-track: rgba(255, 255, 255, 0.06);
    color-scheme: dark;
}

/* ─────────────────────────────────────────────
   Page canvas — soft, glassy white with colour blooms
   ───────────────────────────────────────────── */
html[data-theme="light"] {
    background-color: var(--bg-primary);
    background-image:
        radial-gradient(60vw 60vw at 12% -10%, rgba(99, 102, 241, 0.16), transparent 60%),
        radial-gradient(55vw 55vw at 100% 0%, rgba(34, 211, 238, 0.14), transparent 55%),
        radial-gradient(50vw 50vw at 50% 120%, rgba(168, 85, 247, 0.12), transparent 60%);
    background-attachment: fixed;
}
[data-theme="light"] body {
    color: var(--text-primary);
    background-color: transparent;
}

/* ─────────────────────────────────────────────
   Surface backgrounds → glassy white
   ───────────────────────────────────────────── */
[data-theme="light"] .bg-surface-900 { background-color: transparent !important; }
[data-theme="light"] .bg-surface-800 { background-color: rgba(255, 255, 255, 0.85) !important; }
[data-theme="light"] .bg-surface-700 { background-color: rgba(255, 255, 255, 0.9) !important; }
[data-theme="light"] .bg-surface-800\/95 { background-color: rgba(255, 255, 255, 0.9) !important; backdrop-filter: blur(14px); }
[data-theme="light"] .bg-surface-800\/30,
[data-theme="light"] .bg-surface-800\/20,
[data-theme="light"] .bg-surface-800\/50 { background-color: rgba(255, 255, 255, 0.5) !important; backdrop-filter: blur(8px); }
[data-theme="light"] .bg-surface-900\/80,
[data-theme="light"] .bg-surface-900\/70,
[data-theme="light"] .bg-surface-900\/50 { background-color: var(--nav-bg) !important; }

/* Translucent white tints used for hovers / chips */
[data-theme="light"] .bg-white\/5 { background-color: rgba(15, 23, 42, 0.04) !important; }
[data-theme="light"] .bg-white\/10 { background-color: rgba(15, 23, 42, 0.06) !important; }
[data-theme="light"] .hover\:bg-white\/5:hover { background-color: rgba(15, 23, 42, 0.05) !important; }
[data-theme="light"] .hover\:bg-white\/10:hover { background-color: rgba(15, 23, 42, 0.08) !important; }

/* Decorative oversized numerals (text-white/5) */
[data-theme="light"] .text-white\/5 { color: rgba(15, 23, 42, 0.06) !important; }
[data-theme="light"] .text-white\/10 { color: rgba(15, 23, 42, 0.08) !important; }

/* ─────────────────────────────────────────────
   Borders / hairlines
   ───────────────────────────────────────────── */
[data-theme="light"] .border-white\/5 { border-color: var(--hairline-soft) !important; }
[data-theme="light"] .border-white\/10 { border-color: var(--hairline) !important; }
[data-theme="light"] .border-white\/20 { border-color: rgba(15, 23, 42, 0.14) !important; }
[data-theme="light"] .border-y { border-top-color: var(--hairline); border-bottom-color: var(--hairline); }
[data-theme="light"] .divide-white\/10 > * + * { border-color: var(--hairline) !important; }
[data-theme="light"] .divide-white\/5 > * + * { border-color: var(--hairline-soft) !important; }

/* ─────────────────────────────────────────────
   Text colours
   ───────────────────────────────────────────── */
[data-theme="light"] .text-gray-100 { color: #0f172a !important; }
[data-theme="light"] .text-gray-200 { color: #1e293b !important; }
[data-theme="light"] .text-gray-300 { color: #334155 !important; }
[data-theme="light"] .text-gray-400 { color: #475569 !important; }
[data-theme="light"] .text-gray-500 { color: #64748b !important; }

/* Accent text — darkened for AA contrast on white */
[data-theme="light"] .text-brand-400,
[data-theme="light"] .text-brand-200 { color: #4f46e5 !important; }
[data-theme="light"] .text-cyan-400 { color: #0891b2 !important; }
[data-theme="light"] .text-cyan-200 { color: #0e7490 !important; }
[data-theme="light"] .text-emerald-400 { color: #059669 !important; }
[data-theme="light"] .text-emerald-200 { color: #047857 !important; }
[data-theme="light"] .text-amber-400 { color: #b45309 !important; }
[data-theme="light"] .text-amber-200 { color: #92400e !important; }
[data-theme="light"] .text-rose-400 { color: #e11d48 !important; }
[data-theme="light"] .text-rose-200 { color: #be123c !important; }
[data-theme="light"] .text-violet-400 { color: #7c3aed !important; }
[data-theme="light"] .text-red-400 { color: #dc2626 !important; }
[data-theme="light"] .text-red-300 { color: #dc2626 !important; }
[data-theme="light"] .text-red-200 { color: #b91c1c !important; }
[data-theme="light"] .text-emerald-300 { color: #047857 !important; }

/* Important-flagged badge text (e.g. !text-emerald-200) used on status pills */
[data-theme="light"] .\!text-emerald-200 { color: #047857 !important; }
[data-theme="light"] .\!text-cyan-200 { color: #0e7490 !important; }
[data-theme="light"] .\!text-amber-200 { color: #92400e !important; }
[data-theme="light"] .\!text-rose-200 { color: #be123c !important; }
[data-theme="light"] .\!text-brand-200 { color: #4338ca !important; }

/* ─────────────────────────────────────────────
   Glass cards
   ───────────────────────────────────────────── */
[data-theme="light"] .card,
[data-theme="light"] .content-card,
[data-theme="light"] .module-card,
[data-theme="light"] .stat-card {
    background: var(--glass-bg);
    border-color: var(--glass-border);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset, 0 10px 30px var(--shadow);
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
}
[data-theme="light"] .module-card {
    background: linear-gradient(150deg, rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0.55));
}
[data-theme="light"] .content-card:hover,
[data-theme="light"] .module-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset, 0 18px 40px var(--shadow-lg);
}
[data-theme="light"] .stat-card {
    background: var(--glass-bg-strong);
}

/* Badge / pills */
[data-theme="light"] .badge {
    background: rgba(99, 102, 241, 0.12);
    color: #4338ca;
    border-color: rgba(99, 102, 241, 0.25);
}
[data-theme="light"] .badge-violet {
    background: rgba(124, 58, 237, 0.14);
    color: #5b21b6;
    border-color: rgba(124, 58, 237, 0.3);
}
[data-theme="light"] .badge-cyan {
    background: rgba(8, 145, 178, 0.14);
    color: #0e7490;
    border-color: rgba(8, 145, 178, 0.3);
}
[data-theme="light"] .badge-amber {
    background: rgba(217, 119, 6, 0.14);
    color: #b45309;
    border-color: rgba(217, 119, 6, 0.3);
}
[data-theme="light"] .badge-emerald {
    background: rgba(5, 150, 105, 0.14);
    color: #047857;
    border-color: rgba(5, 150, 105, 0.3);
}
[data-theme="light"] .badge-rose {
    background: rgba(225, 29, 72, 0.12);
    color: #be123c;
    border-color: rgba(225, 29, 72, 0.28);
}

/* Reading content — light theme contrast */
[data-theme="light"] .reading-content h2 { color: #0f172a; }
[data-theme="light"] .reading-content h3 { color: #1e293b; }
[data-theme="light"] .reading-content strong { color: #0f172a; }
[data-theme="light"] .reading-content code {
    background: rgba(15, 23, 42, 0.06);
    color: #334155;
}
[data-theme="light"] .reading-content pre {
    background: rgba(15, 23, 42, 0.05);
    color: #1e293b;
}
[data-theme="light"] .reading-content blockquote { color: #475569; }

/* ─────────────────────────────────────────────
   Forms
   ───────────────────────────────────────────── */
[data-theme="light"] .form-input,
[data-theme="light"] input.form-input,
[data-theme="light"] select.form-input,
[data-theme="light"] textarea.form-input {
    background: var(--input-bg);
    color: var(--text-primary);
    border-color: var(--border);
    backdrop-filter: blur(6px);
}
[data-theme="light"] .form-input::placeholder { color: #94a3b8; }
[data-theme="light"] .form-label { color: #334155; }

/* ─────────────────────────────────────────────
   Buttons
   ───────────────────────────────────────────── */
[data-theme="light"] .btn-secondary {
    color: #334155;
    border-color: rgba(15, 23, 42, 0.14);
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(8px);
}
[data-theme="light"] .btn-secondary:hover { background: rgba(255, 255, 255, 0.95); border-color: var(--border-hover); }

/* ─────────────────────────────────────────────
   Navigation / loader / misc chrome
   ───────────────────────────────────────────── */
[data-theme="light"] .page-loader { background: var(--loader-bg); }
[data-theme="light"] .nav-link { color: #475569; }
[data-theme="light"] .nav-link:hover { color: #0f172a; background: rgba(15, 23, 42, 0.05); }
[data-theme="light"] .mobile-nav-link { color: #475569; }
[data-theme="light"] .mobile-nav-link:hover { color: #0f172a; background: rgba(15, 23, 42, 0.05); }

[data-theme="light"] .command-palette-backdrop { background: rgba(15, 23, 42, 0.35); }
[data-theme="light"] .command-palette-panel {
    background: rgba(255, 255, 255, 0.92);
    border-color: rgba(15, 23, 42, 0.1);
    box-shadow: 0 25px 60px rgba(15, 23, 42, 0.18);
    backdrop-filter: blur(20px) saturate(160%);
}
[data-theme="light"] .cmd-result:hover,
[data-theme="light"] .cmd-result.cmd-active { background: rgba(99, 102, 241, 0.12); }
[data-theme="light"] .cmd-kbd {
    border-color: rgba(15, 23, 42, 0.12);
    background: rgba(15, 23, 42, 0.04);
    color: #64748b;
}

[data-theme="light"] .level-badge,
[data-theme="light"] .tier-badge {
    border-color: rgba(15, 23, 42, 0.1);
    background: rgba(255, 255, 255, 0.75);
}

[data-theme="light"] .heat-cell { background: rgba(15, 23, 42, 0.06); }
[data-theme="light"] .ring-track { stroke: rgba(15, 23, 42, 0.1); }

/* Quiz option contrast on light */
[data-theme="light"] .quiz-option { background: rgba(255, 255, 255, 0.7); }

/* ─────────────────────────────────────────────
   Light-tuned accents
   ───────────────────────────────────────────── */
[data-theme="light"] .gradient-text {
    background: linear-gradient(90deg, #4f46e5, #0891b2, #7c3aed, #4f46e5);
    background-size: 300% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
[data-theme="light"] .stat-number {
    background: linear-gradient(135deg, #1e293b, #4f46e5);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* Aurora blobs softened for a white canvas */
[data-theme="light"] .aurora-bg::before,
[data-theme="light"] .aurora-bg::after { opacity: 0.22; filter: blur(130px); }
[data-theme="light"] .aurora-bg::before { background: radial-gradient(circle, #6366f1, transparent 70%); }
[data-theme="light"] .aurora-bg::after { background: radial-gradient(circle, #22d3ee, transparent 70%); }

/* Hero overlay → fade to white instead of dark */
.hero-fade {
    position: absolute;
    inset: 0;
    z-index: 10;
    pointer-events: none;
}
[data-theme="light"] .hero-fade {
    background: linear-gradient(180deg, rgba(238, 242, 251, 0.1) 0%, rgba(238, 242, 251, 0.55) 60%, var(--bg-primary) 100%);
}
[data-theme="dark"] .hero-fade {
    background: linear-gradient(180deg, rgba(11, 16, 32, 0.2) 0%, rgba(11, 16, 32, 0.7) 55%, #0b1020 100%);
}

/* Scrollbar */
[data-theme="light"] ::-webkit-scrollbar { width: 12px; height: 12px; }
[data-theme="light"] ::-webkit-scrollbar-track { background: var(--scroll-track); }
[data-theme="light"] ::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.35);
    border-radius: 999px;
    border: 3px solid transparent;
    background-clip: content-box;
}
[data-theme="light"] ::-webkit-scrollbar-thumb:hover { background: rgba(99, 102, 241, 0.55); background-clip: content-box; }
[data-theme="light"] ::selection { background: rgba(99, 102, 241, 0.2); }

/* ─────────────────────────────────────────────
   Theme toggle button
   ───────────────────────────────────────────── */
.theme-toggle {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}
.theme-toggle:hover {
    border-color: var(--border-hover);
    color: var(--text-primary);
}
[data-theme="light"] .logo-brand-name { color: #0f172a !important; }
[data-theme="dark"] .logo-brand-name { color: #f8fafc; }

.logo-3d-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
}
.logo-3d-wrap .logo-fallback {
    display: block;
}
.logo-3d-wrap.is-3d-active .logo-fallback {
    display: none;
}
.logo-3d-wrap canvas {
    display: block;
    position: absolute;
    inset: 0;
    margin: auto;
}

[data-theme="light"] .nav-link.active,
[data-theme="light"] .mobile-nav-link.active {
    color: #312e81 !important;
    background: rgba(99, 102, 241, 0.14) !important;
    box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.35);
}
[data-theme="light"] .nav-link.text-amber-400\/90.active,
[data-theme="light"] .mobile-nav-link.text-amber-400.active {
    color: #b45309 !important;
    background: rgba(245, 158, 11, 0.12) !important;
    box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.35);
}
