/* ScholarDream Prep Universal Theme Engine & Custom Styles */

/* ==========================================================================
   0. Optimal Proportional Root Scaling (Compact Modern Dashboard Feel at 100% Zoom)
   ========================================================================== */
html {
    font-size: 14.5px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

@media (min-width: 1024px) {
    html {
        font-size: 14px; /* Sleek, proportional compact layout on desktop (looks identical to 80% browser zoom) */
    }
}

@media (min-width: 1600px) {
    html {
        font-size: 15px;
    }
}

@media (max-width: 640px) {
    html {
        font-size: 13.5px; /* Clean, comfortable mobile app scale */
    }
}

/* ==========================================================================
   1. Theme Variables & Color Tokens
   ========================================================================== */
:root {
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --bg-card-subtle: #f8fafc;
    --bg-muted: #f1f5f9;
    --text-main: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --border-subtle: #f1f5f9;
    --primary: #0284C7;
    --primary-light: rgba(2, 132, 199, 0.1);
}

html[data-theme="dark"], body.theme-dark, html.theme-dark, [data-theme="dark"] {
    --bg-main: #0f172a;
    --bg-card: #1e293b;
    --bg-card-subtle: #162032;
    --bg-muted: #1e293b;
    --text-main: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --border: #334155;
    --border-subtle: #1e293b;
    --primary-light: rgba(2, 132, 199, 0.2);
}

html[data-theme="light"], body.theme-light, html.theme-light, [data-theme="light"] {
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --bg-card-subtle: #f8fafc;
    --bg-muted: #f1f5f9;
    --text-main: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --border-subtle: #f1f5f9;
    --primary-light: rgba(2, 132, 199, 0.1);
}

/* ==========================================================================
   2. Pure Standard Light Theme Engine
   ========================================================================== */
.theme-light body,
html.theme-light body,
body.theme-light,
[data-theme="light"] body {
    background-color: #f8fafc !important;
    color: #0f172a !important;
}

/* Header & Navigation in Light Theme */
.theme-light header,
.theme-light .top-header,
.theme-light header.sticky,
[data-theme="light"] header,
body.theme-light header {
    background-color: #ffffff !important;
    border-color: #e2e8f0 !important;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05) !important;
}

.theme-light header input,
.theme-light header [class*="bg-slate-800"],
.theme-light .search-bar,
[data-theme="light"] header input,
[data-theme="light"] header [class*="bg-slate-800"],
[data-theme="light"] .search-bar,
body.theme-light header input,
body.theme-light header .bg-slate-800\/50,
body.theme-light .search-bar {
    background-color: #f1f5f9 !important;
    border-color: #e2e8f0 !important;
    color: #0f172a !important;
}

.theme-light header input::placeholder,
[data-theme="light"] header input::placeholder,
body.theme-light header input::placeholder {
    color: #94a3b8 !important;
}

/* Sidebar in Light Theme (Standard Clean White Look) */
.theme-light #sidebar,
.theme-light .sidebar,
.theme-light aside,
[data-theme="light"] #sidebar,
[data-theme="light"] .sidebar,
[data-theme="light"] aside,
body.theme-light #sidebar,
body.theme-light .sidebar,
body.theme-light aside {
    background-color: #ffffff !important;
    border-color: #e2e8f0 !important;
    box-shadow: 1px 0 3px 0 rgba(0, 0, 0, 0.04) !important;
}

.theme-light .sidebar .p-6,
.theme-light .sidebar .p-4,
.theme-light .sidebar .p-5,
[data-theme="light"] .sidebar .p-6,
[data-theme="light"] .sidebar .p-4,
[data-theme="light"] .sidebar .p-5 {
    border-color: #e2e8f0 !important;
}

.theme-light .nav-link,
.theme-light .sidebar-link,
[data-theme="light"] .nav-link,
[data-theme="light"] .sidebar-link {
    color: #334155 !important;
}

.theme-light .nav-link:hover,
.theme-light .sidebar-link:hover,
[data-theme="light"] .nav-link:hover,
[data-theme="light"] .sidebar-link:hover {
    background-color: #f1f5f9 !important;
    color: #0f172a !important;
}

.theme-light .nav-link.active,
.theme-light .sidebar-link.active,
[data-theme="light"] .nav-link.active,
[data-theme="light"] .sidebar-link.active {
    background-color: rgba(2, 132, 199, 0.1) !important;
    color: var(--primary) !important;
    font-weight: 700 !important;
}

.theme-light .sidebar-text.text-slate-500,
.theme-light .sidebar .text-slate-500,
.theme-light .sidebar [class*="text-slate-500"],
[data-theme="light"] .sidebar-text.text-slate-500,
[data-theme="light"] .sidebar .text-slate-500,
[data-theme="light"] .sidebar [class*="text-slate-500"] {
    color: #94a3b8 !important;
}

/* Bottom Navigation in Light Theme */
.theme-light .bottom-nav,
[data-theme="light"] .bottom-nav,
body.theme-light .bottom-nav {
    background-color: #ffffff !important;
    border-color: #e2e8f0 !important;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05) !important;
}

.theme-light .bottom-nav a,
[data-theme="light"] .bottom-nav a {
    color: #64748b !important;
}

.theme-light .bottom-nav a.active,
[data-theme="light"] .bottom-nav a.active {
    color: var(--primary) !important;
}

/* Breadcrumbs (Standard Light Capsules across Category, Subcategory, Chapters, Levels) */
.theme-light [class*="bg-slate-950\/40"],
.theme-light [class*="bg-slate-950\/50"],
.theme-light [class*="bg-slate-950\/70"],
.theme-light [class*="bg-slate-950\/90"],
.theme-light .hide-scrollbar .inline-flex.rounded-full,
[data-theme="light"] [class*="bg-slate-950\/40"],
[data-theme="light"] [class*="bg-slate-950\/50"],
[data-theme="light"] [class*="bg-slate-950\/70"],
[data-theme="light"] [class*="bg-slate-950\/90"],
[data-theme="light"] .hide-scrollbar .inline-flex.rounded-full {
    background-color: #ffffff !important;
    border-color: #e2e8f0 !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04) !important;
}

.theme-light .hide-scrollbar .inline-flex.rounded-full a,
[data-theme="light"] .hide-scrollbar .inline-flex.rounded-full a {
    color: #64748b !important;
}

.theme-light .hide-scrollbar .inline-flex.rounded-full a:hover,
[data-theme="light"] .hide-scrollbar .inline-flex.rounded-full a:hover {
    color: #0f172a !important;
    background-color: #f1f5f9 !important;
}

.theme-light .hide-scrollbar .inline-flex.rounded-full .text-slate-700,
[data-theme="light"] .hide-scrollbar .inline-flex.rounded-full .text-slate-700 {
    color: #cbd5e1 !important;
}

/* Universal Cards & Containers in Light Theme */
.theme-light .bg-slate-800,
.theme-light .bg-slate-900,
.theme-light .bg-slate-950,
.theme-light [class*="bg-slate-700"],
.theme-light [class*="bg-slate-800"],
.theme-light [class*="bg-slate-900"],
.theme-light [class*="bg-slate-950"],
.theme-light .bg-card,
.theme-light .card,
.theme-light .bg-\[\#0b1329\],
.theme-light .bg-\[\#0b1120\],
.theme-light .bg-\[\#0f172a\],
.theme-light .bg-\[\#1e293b\],
.theme-light .bg-\[\#131d38\],
[data-theme="light"] .bg-slate-800,
[data-theme="light"] .bg-slate-900,
[data-theme="light"] .bg-slate-950,
[data-theme="light"] [class*="bg-slate-700"],
[data-theme="light"] [class*="bg-slate-800"],
[data-theme="light"] [class*="bg-slate-900"],
[data-theme="light"] [class*="bg-slate-950"],
[data-theme="light"] .bg-card,
[data-theme="light"] .card,
[data-theme="light"] .bg-\[\#0b1329\],
[data-theme="light"] .bg-\[\#0b1120\],
[data-theme="light"] .bg-\[\#0f172a\],
[data-theme="light"] .bg-\[\#1e293b\],
[data-theme="light"] .bg-\[\#131d38\] {
    background-color: #ffffff !important;
}

/* Category & Subcategory Header Banners in Light Theme */
.theme-light .bg-slate-800.rounded-2xl,
[data-theme="light"] .bg-slate-800.rounded-2xl {
    background-color: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.03) !important;
}

.theme-light [class*="border-slate-600"],
.theme-light [class*="border-slate-700"],
.theme-light [class*="border-slate-800"],
.theme-light [class*="border-slate-900"],
.theme-light [class*="border-sky-900"],
.theme-light [class*="border-emerald-900"],
.theme-light [class*="border-purple-900"],
[data-theme="light"] [class*="border-slate-600"],
[data-theme="light"] [class*="border-slate-700"],
[data-theme="light"] [class*="border-slate-800"],
[data-theme="light"] [class*="border-slate-900"],
[data-theme="light"] [class*="border-sky-900"],
[data-theme="light"] [class*="border-emerald-900"],
[data-theme="light"] [class*="border-purple-900"] {
    border-color: #e2e8f0 !important;
}

/* Shadows in Light Theme */
.theme-light .shadow-2xl,
.theme-light .shadow-xl,
[data-theme="light"] .shadow-2xl,
[data-theme="light"] .shadow-xl {
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.06), 0 8px 10px -6px rgba(0, 0, 0, 0.04) !important;
}

.theme-light .shadow-lg,
[data-theme="light"] .shadow-lg {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.03) !important;
}

/* High Contrast Typography in Light Theme */
.theme-light h1:not(.text-white-forced):not([class*="from-"]):not(.hero-banner h1),
.theme-light h2:not(.text-white-forced):not([class*="from-"]):not(.hero-banner h2),
.theme-light h3:not(.text-white-forced),
.theme-light h4:not(.text-white-forced),
.theme-light h5:not(.text-white-forced),
.theme-light h6:not(.text-white-forced),
[data-theme="light"] h1:not(.text-white-forced):not([class*="from-"]):not(.hero-banner h1),
[data-theme="light"] h2:not(.text-white-forced):not([class*="from-"]):not(.hero-banner h2),
[data-theme="light"] h3:not(.text-white-forced),
[data-theme="light"] h4:not(.text-white-forced),
[data-theme="light"] h5:not(.text-white-forced),
[data-theme="light"] h6:not(.text-white-forced) {
    color: #0f172a !important;
}

.theme-light h2:not(.text-white-forced) span:not(.text-white-forced),
.theme-light h1:not(.text-white-forced) span:not(.text-white-forced),
[data-theme="light"] h2:not(.text-white-forced) span:not(.text-white-forced),
[data-theme="light"] h1:not(.text-white-forced) span:not(.text-white-forced) {
    color: #0f172a !important;
}

.text-white-forced,
.theme-light .text-white-forced,
[data-theme="light"] .text-white-forced,
section[class*="from-"] h1,
section[class*="from-"] .text-white,
.theme-light section[class*="from-"] h1,
[data-theme="light"] section[class*="from-"] h1 {
    color: #ffffff !important;
}

/* Solid Accent Buttons & Badges with full opacity backgrounds retain crisp white text in Light Theme */
.theme-light .btn-primary,
.theme-light .btn-success,
.theme-light .btn-danger,
.theme-light .gradient-primary,
.theme-light a.gradient-primary,
.theme-light button.gradient-primary,
.theme-light .gradient-primary *,
.theme-light a.bg-primary,
.theme-light button.bg-primary,
.theme-light a[class~="bg-primary"],
.theme-light button[class~="bg-primary"],
.theme-light a[class*="bg-primary"]:not([class*="bg-primary/5"]):not([class*="bg-primary/10"]):not([class*="bg-primary/15"]):not([class*="bg-primary/20"]):not([class*="bg-primary/25"]):not([class*="bg-primary/30"]),
.theme-light button[class*="bg-primary"]:not([class*="bg-primary/5"]):not([class*="bg-primary/10"]):not([class*="bg-primary/15"]):not([class*="bg-primary/20"]):not([class*="bg-primary/25"]):not([class*="bg-primary/30"]),
.theme-light a[class*="bg-emerald-"]:not([class*="/5"]):not([class*="/10"]):not([class*="/15"]):not([class*="/20"]):not([class*="/25"]):not([class*="/30"]),
.theme-light button[class*="bg-emerald-"]:not([class*="/5"]):not([class*="/10"]):not([class*="/15"]):not([class*="/20"]):not([class*="/25"]):not([class*="/30"]),
.theme-light a[class*="bg-green-"]:not([class*="/5"]):not([class*="/10"]):not([class*="/15"]):not([class*="/20"]):not([class*="/25"]):not([class*="/30"]),
.theme-light button[class*="bg-green-"]:not([class*="/5"]):not([class*="/10"]):not([class*="/15"]):not([class*="/20"]):not([class*="/25"]):not([class*="/30"]),
.theme-light a[class*="bg-red-"]:not([class*="/5"]):not([class*="/10"]):not([class*="/15"]):not([class*="/20"]):not([class*="/25"]):not([class*="/30"]),
.theme-light button[class*="bg-red-"]:not([class*="/5"]):not([class*="/10"]):not([class*="/15"]):not([class*="/20"]):not([class*="/25"]):not([class*="/30"]),
.theme-light a[class*="bg-rose-"]:not([class*="/5"]):not([class*="/10"]):not([class*="/15"]):not([class*="/20"]):not([class*="/25"]):not([class*="/30"]),
.theme-light button[class*="bg-rose-"]:not([class*="/5"]):not([class*="/10"]):not([class*="/15"]):not([class*="/20"]):not([class*="/25"]):not([class*="/30"]),
.theme-light a[class*="bg-blue-"]:not([class*="/5"]):not([class*="/10"]):not([class*="/15"]):not([class*="/20"]):not([class*="/25"]):not([class*="/30"]),
.theme-light button[class*="bg-blue-"]:not([class*="/5"]):not([class*="/10"]):not([class*="/15"]):not([class*="/20"]):not([class*="/25"]):not([class*="/30"]),
.theme-light a[class*="bg-indigo-"]:not([class*="/5"]):not([class*="/10"]):not([class*="/15"]):not([class*="/20"]):not([class*="/25"]):not([class*="/30"]),
.theme-light button[class*="bg-indigo-"]:not([class*="/5"]):not([class*="/10"]):not([class*="/15"]):not([class*="/20"]):not([class*="/25"]):not([class*="/30"]),
.theme-light a[class*="bg-purple-"]:not([class*="/5"]):not([class*="/10"]):not([class*="/15"]):not([class*="/20"]):not([class*="/25"]):not([class*="/30"]),
.theme-light button[class*="bg-purple-"]:not([class*="/5"]):not([class*="/10"]):not([class*="/15"]):not([class*="/20"]):not([class*="/25"]):not([class*="/30"]),
.theme-light a[class*="bg-amber-600"],
.theme-light button[class*="bg-amber-600"],
.theme-light a[class*="bg-orange-600"],
.theme-light button[class*="bg-orange-600"],
.theme-light button[class*="bg-slate-700"],
.theme-light button[class*="bg-slate-800"]:not(.bg-white),
.theme-light button[class*="bg-slate-900"],
.theme-light button.text-white,
.theme-light button[class~="text-white"],
.theme-light a.text-white[class*="bg-"],
.theme-light a[class~="text-white"][class*="bg-"],
[data-theme="light"] .btn-primary,
[data-theme="light"] .btn-success,
[data-theme="light"] .btn-danger,
[data-theme="light"] .gradient-primary,
[data-theme="light"] a.gradient-primary,
[data-theme="light"] button.gradient-primary,
[data-theme="light"] .gradient-primary *,
[data-theme="light"] a.bg-primary,
[data-theme="light"] button.bg-primary,
[data-theme="light"] a[class~="bg-primary"],
[data-theme="light"] button[class~="bg-primary"],
[data-theme="light"] a[class*="bg-primary"]:not([class*="bg-primary/5"]):not([class*="bg-primary/10"]):not([class*="bg-primary/15"]):not([class*="bg-primary/20"]):not([class*="bg-primary/25"]):not([class*="bg-primary/30"]),
[data-theme="light"] button[class*="bg-primary"]:not([class*="bg-primary/5"]):not([class*="bg-primary/10"]):not([class*="bg-primary/15"]):not([class*="bg-primary/20"]):not([class*="bg-primary/25"]):not([class*="bg-primary/30"]),
[data-theme="light"] a[class*="bg-emerald-"]:not([class*="/5"]):not([class*="/10"]):not([class*="/15"]):not([class*="/20"]):not([class*="/25"]):not([class*="/30"]),
[data-theme="light"] button[class*="bg-emerald-"]:not([class*="/5"]):not([class*="/10"]):not([class*="/15"]):not([class*="/20"]):not([class*="/25"]):not([class*="/30"]),
[data-theme="light"] a[class*="bg-green-"]:not([class*="/5"]):not([class*="/10"]):not([class*="/15"]):not([class*="/20"]):not([class*="/25"]):not([class*="/30"]),
[data-theme="light"] button[class*="bg-green-"]:not([class*="/5"]):not([class*="/10"]):not([class*="/15"]):not([class*="/20"]):not([class*="/25"]):not([class*="/30"]),
[data-theme="light"] a[class*="bg-red-"]:not([class*="/5"]):not([class*="/10"]):not([class*="/15"]):not([class*="/20"]):not([class*="/25"]):not([class*="/30"]),
[data-theme="light"] button[class*="bg-red-"]:not([class*="/5"]):not([class*="/10"]):not([class*="/15"]):not([class*="/20"]):not([class*="/25"]):not([class*="/30"]),
[data-theme="light"] a[class*="bg-rose-"]:not([class*="/5"]):not([class*="/10"]):not([class*="/15"]):not([class*="/20"]):not([class*="/25"]):not([class*="/30"]),
[data-theme="light"] button[class*="bg-rose-"]:not([class*="/5"]):not([class*="/10"]):not([class*="/15"]):not([class*="/20"]):not([class*="/25"]):not([class*="/30"]),
[data-theme="light"] a[class*="bg-blue-"]:not([class*="/5"]):not([class*="/10"]):not([class*="/15"]):not([class*="/20"]):not([class*="/25"]):not([class*="/30"]),
[data-theme="light"] button[class*="bg-blue-"]:not([class*="/5"]):not([class*="/10"]):not([class*="/15"]):not([class*="/20"]):not([class*="/25"]):not([class*="/30"]),
[data-theme="light"] a[class*="bg-indigo-"]:not([class*="/5"]):not([class*="/10"]):not([class*="/15"]):not([class*="/20"]):not([class*="/25"]):not([class*="/30"]),
[data-theme="light"] button[class*="bg-indigo-"]:not([class*="/5"]):not([class*="/10"]):not([class*="/15"]):not([class*="/20"]):not([class*="/25"]):not([class*="/30"]),
[data-theme="light"] a[class*="bg-purple-"]:not([class*="/5"]):not([class*="/10"]):not([class*="/15"]):not([class*="/20"]):not([class*="/25"]):not([class*="/30"]),
[data-theme="light"] button[class*="bg-purple-"]:not([class*="/5"]):not([class*="/10"]):not([class*="/15"]):not([class*="/20"]):not([class*="/25"]):not([class*="/30"]),
[data-theme="light"] a[class*="bg-amber-600"],
[data-theme="light"] button[class*="bg-amber-600"],
[data-theme="light"] a[class*="bg-orange-600"],
[data-theme="light"] button[class*="bg-orange-600"],
[data-theme="light"] button[class*="bg-slate-700"],
[data-theme="light"] button[class*="bg-slate-800"]:not(.bg-white),
[data-theme="light"] button[class*="bg-slate-900"],
[data-theme="light"] button.text-white,
[data-theme="light"] button[class~="text-white"],
[data-theme="light"] a.text-white[class*="bg-"],
[data-theme="light"] a[class~="text-white"][class*="bg-"] {
    color: #ffffff !important;
}

/* Ensure ALL nested elements and icons inside solid buttons retain white */
.theme-light .btn-primary *,
.theme-light .btn-success *,
.theme-light .btn-danger *,
.theme-light .gradient-primary *,
.theme-light a[class~="bg-primary"] *,
.theme-light button[class~="bg-primary"] *,
.theme-light button[class*="bg-primary"]:not([class*="bg-primary/5"]):not([class*="bg-primary/10"]):not([class*="bg-primary/15"]):not([class*="bg-primary/20"]) *,
.theme-light a[class*="bg-primary"]:not([class*="bg-primary/5"]):not([class*="bg-primary/10"]):not([class*="bg-primary/15"]):not([class*="bg-primary/20"]) *,
.theme-light button.text-white *,
.theme-light button[class~="text-white"] *,
.theme-light button[class*="bg-emerald-"]:not([class*="/5"]):not([class*="/10"]):not([class*="/15"]):not([class*="/20"]) *,
.theme-light button[class*="bg-green-"]:not([class*="/5"]):not([class*="/10"]):not([class*="/15"]):not([class*="/20"]) *,
.theme-light button[class*="bg-red-"]:not([class*="/5"]):not([class*="/10"]):not([class*="/15"]):not([class*="/20"]) *,
.theme-light button[class*="bg-rose-"]:not([class*="/5"]):not([class*="/10"]):not([class*="/15"]):not([class*="/20"]) *,
.theme-light button[class*="bg-blue-"]:not([class*="/5"]):not([class*="/10"]):not([class*="/15"]):not([class*="/20"]) *,
.theme-light button[class*="bg-slate-700"] *,
.theme-light button[class*="bg-slate-800"] *,
[data-theme="light"] .btn-primary *,
[data-theme="light"] .btn-success *,
[data-theme="light"] .btn-danger *,
[data-theme="light"] .gradient-primary *,
[data-theme="light"] a[class~="bg-primary"] *,
[data-theme="light"] button[class~="bg-primary"] *,
[data-theme="light"] button[class*="bg-primary"]:not([class*="bg-primary/5"]):not([class*="bg-primary/10"]):not([class*="bg-primary/15"]):not([class*="bg-primary/20"]) *,
[data-theme="light"] a[class*="bg-primary"]:not([class*="bg-primary/5"]):not([class*="bg-primary/10"]):not([class*="bg-primary/15"]):not([class*="bg-primary/20"]) *,
[data-theme="light"] button.text-white *,
[data-theme="light"] button[class~="text-white"] *,
[data-theme="light"] button[class*="bg-emerald-"]:not([class*="/5"]):not([class*="/10"]):not([class*="/15"]):not([class*="/20"]) *,
[data-theme="light"] button[class*="bg-green-"]:not([class*="/5"]):not([class*="/10"]):not([class*="/15"]):not([class*="/20"]) *,
[data-theme="light"] button[class*="bg-red-"]:not([class*="/5"]):not([class*="/10"]):not([class*="/15"]):not([class*="/20"]) *,
[data-theme="light"] button[class*="bg-rose-"]:not([class*="/5"]):not([class*="/10"]):not([class*="/15"]):not([class*="/20"]) *,
[data-theme="light"] button[class*="bg-blue-"]:not([class*="/5"]):not([class*="/10"]):not([class*="/15"]):not([class*="/20"]) *,
[data-theme="light"] button[class*="bg-slate-700"] *,
[data-theme="light"] button[class*="bg-slate-800"] * {
    color: #ffffff !important;
}

/* Ensure SVG icons inside solid accent buttons also inherit white */
.theme-light .btn-primary svg,
.theme-light .gradient-primary svg,
.theme-light button[class*="bg-primary"] svg,
.theme-light a[class*="bg-primary"] svg,
.theme-light button.text-white svg,
.theme-light button[class*="bg-emerald-"] svg,
.theme-light button[class*="bg-green-"] svg,
.theme-light button[class*="bg-red-"] svg,
.theme-light button[class*="bg-rose-"] svg,
.theme-light button[class*="bg-blue-"] svg,
.theme-light button[class*="bg-slate-700"] svg,
.theme-light button[class*="bg-slate-800"] svg,
[data-theme="light"] .btn-primary svg,
[data-theme="light"] .gradient-primary svg,
[data-theme="light"] button[class*="bg-primary"] svg,
[data-theme="light"] a[class*="bg-primary"] svg,
[data-theme="light"] button.text-white svg,
[data-theme="light"] button[class*="bg-emerald-"] svg,
[data-theme="light"] button[class*="bg-green-"] svg,
[data-theme="light"] button[class*="bg-red-"] svg,
[data-theme="light"] button[class*="bg-rose-"] svg,
[data-theme="light"] button[class*="bg-blue-"] svg,
[data-theme="light"] button[class*="bg-slate-700"] svg,
[data-theme="light"] button[class*="bg-slate-800"] svg {
    color: #ffffff !important;
    stroke: #ffffff !important;
}

/* Theme Toggle Button & Icon - High Contrast Dark Slate in Light Theme */
.theme-light #themeToggleBtn,
.theme-light .theme-toggle-btn,
.theme-light #themeToggleIcon,
.theme-light .theme-toggle-icon,
[data-theme="light"] #themeToggleBtn,
[data-theme="light"] .theme-toggle-btn,
[data-theme="light"] #themeToggleIcon,
[data-theme="light"] .theme-toggle-icon {
    color: #334155 !important;
    stroke: #334155 !important;
}

.theme-light #themeToggleBtn:hover,
.theme-light .theme-toggle-btn:hover,
[data-theme="light"] #themeToggleBtn:hover,
[data-theme="light"] .theme-toggle-btn:hover {
    color: var(--primary, #0284c7) !important;
    stroke: var(--primary, #0284c7) !important;
    background-color: #f1f5f9 !important;
}

.theme-light #themeToggleBtn:hover #themeToggleIcon,
.theme-light .theme-toggle-btn:hover .theme-toggle-icon,
[data-theme="light"] #themeToggleBtn:hover #themeToggleIcon,
[data-theme="light"] .theme-toggle-btn:hover .theme-toggle-icon {
    color: var(--primary, #0284c7) !important;
    stroke: var(--primary, #0284c7) !important;
}

/* Header & Mobile Action Buttons in Light Theme */
.theme-light header button:not([class*="bg-primary"]):not([class*="bg-emerald"]):not([class*="bg-green"]):not([class*="bg-red"]),
.theme-light header button:not([class*="bg-primary"]):not([class*="bg-emerald"]):not([class*="bg-green"]):not([class*="bg-red"]) svg,
[data-theme="light"] header button:not([class*="bg-primary"]):not([class*="bg-emerald"]):not([class*="bg-green"]):not([class*="bg-red"]),
[data-theme="light"] header button:not([class*="bg-primary"]):not([class*="bg-emerald"]):not([class*="bg-green"]):not([class*="bg-red"]) svg {
    color: #475569 !important;
    stroke: #475569 !important;
}

.theme-light header button:hover:not([class*="bg-primary"]),
.theme-light header button:hover:not([class*="bg-primary"]) svg,
[data-theme="light"] header button:hover:not([class*="bg-primary"]),
[data-theme="light"] header button:hover:not([class*="bg-primary"]) svg {
    color: #0f172a !important;
    stroke: #0f172a !important;
}

/* Tab Buttons in Light Theme (Profile, Quizzes, Purchases, Checkout) */
.theme-light .tab-btn:not(.active):not(.bg-primary),
[data-theme="light"] .tab-btn:not(.active):not(.bg-primary) {
    background-color: #f1f5f9 !important;
    color: #475569 !important;
    border: 1px solid #e2e8f0 !important;
}

.theme-light .tab-btn:not(.active):not(.bg-primary):hover,
[data-theme="light"] .tab-btn:not(.active):not(.bg-primary):hover {
    background-color: #e2e8f0 !important;
    color: #0f172a !important;
}

.theme-light .tab-btn.active,
.theme-light .tab-btn.bg-primary,
[data-theme="light"] .tab-btn.active,
[data-theme="light"] .tab-btn.bg-primary {
    background-color: var(--primary, #0284c7) !important;
    color: #ffffff !important;
    border-color: var(--primary, #0284c7) !important;
}

/* Checkout Payment Tabs in Light Theme */
.theme-light #btn-tab-razorpay:not(.bg-primary),
.theme-light #btn-tab-qr:not(.bg-emerald-500),
.theme-light #btn-tab-manual:not(.bg-amber-600),
[data-theme="light"] #btn-tab-razorpay:not(.bg-primary),
[data-theme="light"] #btn-tab-qr:not(.bg-emerald-500),
[data-theme="light"] #btn-tab-manual:not(.bg-amber-600) {
    color: #475569 !important;
    background-color: transparent !important;
}

.theme-light #btn-tab-razorpay:not(.bg-primary):hover,
.theme-light #btn-tab-qr:not(.bg-emerald-500):hover,
.theme-light #btn-tab-manual:not(.bg-amber-600):hover,
[data-theme="light"] #btn-tab-razorpay:not(.bg-primary):hover,
[data-theme="light"] #btn-tab-qr:not(.bg-emerald-500):hover,
[data-theme="light"] #btn-tab-manual:not(.bg-amber-600):hover {
    color: #0f172a !important;
    background-color: rgba(255, 255, 255, 0.8) !important;
}

/* Quiz Controls in Sticky Header in Light Theme */
.theme-light .sticky-header button:not(.bg-emerald-500):not([class*="bg-emerald"]),
[data-theme="light"] .sticky-header button:not(.bg-emerald-500):not([class*="bg-emerald"]) {
    color: #334155 !important;
}

.theme-light .sticky-header button:not(.bg-emerald-500):not([class*="bg-emerald"]):hover,
[data-theme="light"] .sticky-header button:not(.bg-emerald-500):not([class*="bg-emerald"]):hover {
    color: #0f172a !important;
    background-color: #e2e8f0 !important;
}

.theme-light .sticky-header #main-timer,
[data-theme="light"] .sticky-header #main-timer {
    color: #0f172a !important;
}

.theme-light .sticky-header i[data-lucide="clock"],
.theme-light .sticky-header .lucide-clock,
[data-theme="light"] .sticky-header i[data-lucide="clock"],
[data-theme="light"] .sticky-header .lucide-clock,
.theme-light .sticky-header i[data-lucide="maximize"],
.theme-light .sticky-header .lucide-maximize,
[data-theme="light"] .sticky-header i[data-lucide="maximize"],
[data-theme="light"] .sticky-header .lucide-maximize {
    color: #64748b !important;
    stroke: #64748b !important;
}

/* White / Light / Pastel buttons must keep high contrast dark text */
.theme-light button.bg-white,
.theme-light button[class*="bg-white"],
.theme-light .bg-white button,
.theme-light button[class*="bg-slate-100"],
.theme-light button[class*="bg-slate-200"],
.theme-light button.text-slate-900,
.theme-light button.text-slate-800,
.theme-light button.text-slate-950,
.theme-light button[class*="text-slate-900"],
.theme-light button[class*="text-slate-800"],
.theme-light button[class*="text-slate-950"],
.theme-light a[class*="text-slate-900"],
.theme-light a[class*="text-slate-800"],
.theme-light a[class*="text-slate-950"],
[data-theme="light"] button.bg-white,
[data-theme="light"] button[class*="bg-white"],
[data-theme="light"] .bg-white button,
[data-theme="light"] button[class*="bg-slate-100"],
[data-theme="light"] button[class*="bg-slate-200"],
[data-theme="light"] button.text-slate-900,
[data-theme="light"] button.text-slate-800,
[data-theme="light"] button.text-slate-950,
[data-theme="light"] button[class*="text-slate-900"],
[data-theme="light"] button[class*="text-slate-800"],
[data-theme="light"] button[class*="text-slate-950"],
[data-theme="light"] a[class*="text-slate-900"],
[data-theme="light"] a[class*="text-slate-800"],
[data-theme="light"] a[class*="text-slate-950"] {
    color: #0f172a !important;
}

/* Pastel buttons with colored accents retain crisp accent color (only when strictly pastel and NOT text-white or solid) */
.theme-light button[class*="bg-primary/1"]:not(.text-white):not([class*="text-white"]):not(.bg-primary):not([class~="bg-primary"]):not(.gradient-primary),
.theme-light a[class*="bg-primary/1"]:not(.text-white):not([class*="text-white"]):not(.bg-primary):not([class~="bg-primary"]):not(.gradient-primary),
.theme-light button[class*="bg-primary/2"]:not(.text-white):not([class*="text-white"]):not(.bg-primary):not([class~="bg-primary"]):not(.gradient-primary),
.theme-light a[class*="bg-primary/2"]:not(.text-white):not([class*="text-white"]):not(.bg-primary):not([class~="bg-primary"]):not(.gradient-primary),
[data-theme="light"] button[class*="bg-primary/1"]:not(.text-white):not([class*="text-white"]):not(.bg-primary):not([class~="bg-primary"]):not(.gradient-primary),
[data-theme="light"] a[class*="bg-primary/1"]:not(.text-white):not([class*="text-white"]):not(.bg-primary):not([class~="bg-primary"]):not(.gradient-primary),
[data-theme="light"] button[class*="bg-primary/2"]:not(.text-white):not([class*="text-white"]):not(.bg-primary):not([class~="bg-primary"]):not(.gradient-primary),
[data-theme="light"] a[class*="bg-primary/2"]:not(.text-white):not([class*="text-white"]):not(.bg-primary):not([class~="bg-primary"]):not(.gradient-primary) {
    color: var(--primary, #0284c7) !important;
}

.theme-light button[class*="bg-red-500/1"]:not(.text-white):not([class*="text-white"]):not([class*="bg-red-6"]):not([class*="bg-red-7"]),
.theme-light a[class*="bg-red-500/1"]:not(.text-white):not([class*="text-white"]):not([class*="bg-red-6"]):not([class*="bg-red-7"]),
[data-theme="light"] button[class*="bg-red-500/1"]:not(.text-white):not([class*="text-white"]):not([class*="bg-red-6"]):not([class*="bg-red-7"]),
[data-theme="light"] a[class*="bg-red-500/1"]:not(.text-white):not([class*="text-white"]):not([class*="bg-red-6"]):not([class*="bg-red-7"]) {
    color: #dc2626 !important;
}

.theme-light button[class*="bg-purple-500/1"]:not(.text-white):not([class*="text-white"]):not([class*="bg-purple-6"]):not([class*="bg-purple-7"]),
.theme-light a[class*="bg-purple-500/1"]:not(.text-white):not([class*="text-white"]):not([class*="bg-purple-6"]):not([class*="bg-purple-7"]),
[data-theme="light"] button[class*="bg-purple-500/1"]:not(.text-white):not([class*="text-white"]):not([class*="bg-purple-6"]):not([class*="bg-purple-7"]),
[data-theme="light"] a[class*="bg-purple-500/1"]:not(.text-white):not([class*="text-white"]):not([class*="bg-purple-6"]):not([class*="bg-purple-7"]) {
    color: #7c3aed !important;
}

.theme-light button[class*="bg-rose-500/1"]:not(.text-white):not([class*="text-white"]):not([class*="bg-rose-6"]):not([class*="bg-rose-7"]),
.theme-light a[class*="bg-rose-500/1"]:not(.text-white):not([class*="text-white"]):not([class*="bg-rose-6"]):not([class*="bg-rose-7"]),
[data-theme="light"] button[class*="bg-rose-500/1"]:not(.text-white):not([class*="text-white"]):not([class*="bg-rose-6"]):not([class*="bg-rose-7"]),
[data-theme="light"] a[class*="bg-rose-500/1"]:not(.text-white):not([class*="text-white"]):not([class*="bg-rose-6"]):not([class*="bg-rose-7"]) {
    color: #e11d48 !important;
}

/* Home Page Header Leaderboard Button in Light Theme */
.theme-light a[href*="leaderboard"]:not([class*="bg-primary"]),
[data-theme="light"] a[href*="leaderboard"]:not([class*="bg-primary"]) {
    color: #b45309 !important;
    background-color: #ffffff !important;
    border-color: #e2e8f0 !important;
}

/* Quiz Start Notes Formatting in Light Theme */
.theme-light .short-notes-wrapper strong,
[data-theme="light"] .short-notes-wrapper strong {
    color: #b45309 !important;
}

.theme-light .short-notes-wrapper blockquote,
[data-theme="light"] .short-notes-wrapper blockquote {
    color: #3730a3 !important;
    background: #eef2ff !important;
    border-left-color: #6366f1 !important;
}

.theme-light .note-example-box,
[data-theme="light"] .note-example-box {
    background: #f0fdf4 !important;
    color: #166534 !important;
    border: 1px solid #bbf7d0 !important;
    box-shadow: none !important;
}

/* High Contrast Text Conversion in Light Theme */
.theme-light .text-white:not([class*="bg-"]):not(.badge):not(.btn):not(.btn-primary):not(.gradient-primary):not(a.bg-primary):not([class*="bg-primary"]):not([class*="bg-emerald-500"]):not([class*="bg-green-"]):not([class*="bg-red-"]):not([class*="bg-blue-"]):not([class*="bg-amber-"]):not([class*="bg-sky-"]):not([class*="bg-purple-"]):not([class*="bg-pink-"]):not(.badge-pulse):not(.text-white-forced):not(button):not(button *):not(a.gradient-primary *):not(a.bg-primary *):not(a.text-white):not(a[class*="bg-"] *),
.theme-light .text-slate-100:not([class*="bg-"]):not(.badge):not(.btn):not(.text-white-forced):not(button):not(button *):not(a.gradient-primary *):not(a.bg-primary *),
.theme-light .text-slate-200:not([class*="bg-"]):not(.badge):not(.btn):not(.text-white-forced):not(button):not(button *):not(a.gradient-primary *):not(a.bg-primary *),
[data-theme="light"] .text-white:not([class*="bg-"]):not(.badge):not(.btn):not(.btn-primary):not(.gradient-primary):not(a.bg-primary):not([class*="bg-primary"]):not([class*="bg-emerald-500"]):not([class*="bg-green-"]):not([class*="bg-red-"]):not([class*="bg-blue-"]):not([class*="bg-amber-"]):not([class*="bg-sky-"]):not([class*="bg-purple-"]):not([class*="bg-pink-"]):not(.badge-pulse):not(.text-white-forced):not(button):not(button *):not(a.gradient-primary *):not(a.bg-primary *):not(a.text-white):not(a[class*="bg-"] *),
[data-theme="light"] .text-slate-100:not([class*="bg-"]):not(.badge):not(.btn):not(.text-white-forced):not(button):not(button *):not(a.gradient-primary *):not(a.bg-primary *),
[data-theme="light"] .text-slate-200:not([class*="bg-"]):not(.badge):not(.btn):not(.text-white-forced):not(button):not(button *):not(a.gradient-primary *):not(a.bg-primary *) {
    color: #0f172a !important;
}

/* Card Light Shine Thin Border & Micro-Interactions */
.cat-card, .quiz-tile-card {
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.25s ease !important;
    position: relative;
}
.cat-card:hover, .quiz-tile-card:hover {
    transform: translateY(-3px) !important;
}

.theme-light .text-slate-300,
.theme-light .text-slate-400,
[data-theme="light"] .text-slate-300,
[data-theme="light"] .text-slate-400 {
    color: #64748b !important;
}

.theme-light .text-slate-500,
.theme-light .text-slate-600,
[data-theme="light"] .text-slate-500,
[data-theme="light"] .text-slate-600 {
    color: #64748b !important;
}

.theme-light .text-sky-200,
.theme-light .text-sky-200\/70,
.theme-light .text-emerald-200,
[data-theme="light"] .text-sky-200,
[data-theme="light"] .text-sky-200\/70,
[data-theme="light"] .text-emerald-200 {
    color: #475569 !important;
}

/* Menu Tiles (Exam Explorer) in Light Theme with Rich Dark Icons */
.theme-light .menu-tile,
[data-theme="light"] .menu-tile,
body.theme-light .menu-tile {
    background: #ffffff !important;
    background-image: none !important;
    border-color: #e2e8f0 !important;
    box-shadow: 0 2px 6px -1px rgba(0, 0, 0, 0.05), 0 1px 3px -1px rgba(0, 0, 0, 0.03) !important;
}

.theme-light .menu-tile:hover,
[data-theme="light"] .menu-tile:hover,
body.theme-light .menu-tile:hover {
    border-color: rgba(2, 132, 199, 0.4) !important;
    box-shadow: 0 10px 20px -3px rgba(2, 132, 199, 0.12), 0 4px 6px -4px rgba(2, 132, 199, 0.08) !important;
}

.theme-light .menu-tile h3,
[data-theme="light"] .menu-tile h3 {
    color: #0f172a !important;
}

.theme-light .menu-tile p,
[data-theme="light"] .menu-tile p {
    color: #64748b !important;
}

/* Rich, Dark, High-Contrast Icons in Menu Tiles for Light Theme */
.theme-light .menu-tile i,
.theme-light .menu-tile svg,
[data-theme="light"] .menu-tile i,
[data-theme="light"] .menu-tile svg,
body.theme-light .menu-tile i,
body.theme-light .menu-tile svg {
    stroke-width: 2.2px !important;
}

.theme-light .menu-tile .text-sky-400,
[data-theme="light"] .menu-tile .text-sky-400,
body.theme-light .menu-tile .text-sky-400 {
    color: #0284c7 !important;
}

.theme-light .menu-tile .text-emerald-400,
[data-theme="light"] .menu-tile .text-emerald-400,
body.theme-light .menu-tile .text-emerald-400 {
    color: #059669 !important;
}

.theme-light .menu-tile .text-amber-400,
[data-theme="light"] .menu-tile .text-amber-400,
body.theme-light .menu-tile .text-amber-400 {
    color: #d97706 !important;
}

.theme-light .menu-tile .text-purple-400,
[data-theme="light"] .menu-tile .text-purple-400,
body.theme-light .menu-tile .text-purple-400 {
    color: #7c3aed !important;
}

.theme-light .menu-tile .text-rose-400,
[data-theme="light"] .menu-tile .text-rose-400,
body.theme-light .menu-tile .text-rose-400 {
    color: #e11d48 !important;
}

.theme-light .menu-tile .text-indigo-400,
[data-theme="light"] .menu-tile .text-indigo-400,
body.theme-light .menu-tile .text-indigo-400 {
    color: #4f46e5 !important;
}

.theme-light .menu-tile .text-teal-400,
[data-theme="light"] .menu-tile .text-teal-400,
body.theme-light .menu-tile .text-teal-400 {
    color: #0d9488 !important;
}

.theme-light .menu-tile .text-cyan-400,
[data-theme="light"] .menu-tile .text-cyan-400,
body.theme-light .menu-tile .text-cyan-400 {
    color: #0891b2 !important;
}

/* Icon Box Backgrounds in Light Theme */
.theme-light .menu-tile .bg-sky-500\/15,
[data-theme="light"] .menu-tile .bg-sky-500\/15 {
    background-color: #e0f2fe !important;
}

.theme-light .menu-tile .bg-emerald-500\/15,
[data-theme="light"] .menu-tile .bg-emerald-500\/15 {
    background-color: #d1fae5 !important;
}

.theme-light .menu-tile .bg-amber-500\/15,
[data-theme="light"] .menu-tile .bg-amber-500\/15 {
    background-color: #fef3c7 !important;
}

.theme-light .menu-tile .bg-purple-500\/15,
[data-theme="light"] .menu-tile .bg-purple-500\/15 {
    background-color: #f3e8ff !important;
}

.theme-light .menu-tile .bg-rose-500\/15,
[data-theme="light"] .menu-tile .bg-rose-500\/15 {
    background-color: #ffe4e6 !important;
}

.theme-light .menu-tile .bg-indigo-500\/15,
[data-theme="light"] .menu-tile .bg-indigo-500\/15 {
    background-color: #e0e7ff !important;
}

.theme-light .menu-tile .bg-teal-500\/15,
[data-theme="light"] .menu-tile .bg-teal-500\/15 {
    background-color: #ccfbf1 !important;
}

.theme-light .menu-tile .bg-cyan-500\/15,
[data-theme="light"] .menu-tile .bg-cyan-500\/15 {
    background-color: #cffafe !important;
}

/* Quick Stats Section & Top Performers in Light Theme */
.theme-light #quick-stats-section > div,
.theme-light .bg-slate-800\/40,
.theme-light .bg-slate-800\/50,
.theme-light .bg-slate-800\/60,
[data-theme="light"] #quick-stats-section > div,
[data-theme="light"] .bg-slate-800\/40,
[data-theme="light"] .bg-slate-800\/50,
[data-theme="light"] .bg-slate-800\/60 {
    background-color: #ffffff !important;
    border-color: #e2e8f0 !important;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05) !important;
}

.theme-light .divide-slate-700\/30 > *,
[data-theme="light"] .divide-slate-700\/30 > * {
    border-color: #f1f5f9 !important;
}

.theme-light .hover\:bg-slate-800\/50:hover,
.theme-light .hover\:bg-slate-800\/40:hover,
[data-theme="light"] .hover\:bg-slate-800\/50:hover,
[data-theme="light"] .hover\:bg-slate-800\/40:hover {
    background-color: #f8fafc !important;
}

/* Quiz Start Page Stat Boxes & Instructions */
.theme-light .bg-slate-700\/50,
.theme-light .bg-slate-700\/30,
[data-theme="light"] .bg-slate-700\/50,
[data-theme="light"] .bg-slate-700\/30 {
    background-color: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
}

.theme-light .bg-slate-700\/50 p,
.theme-light .bg-slate-700\/30 ul li span,
[data-theme="light"] .bg-slate-700\/50 p,
[data-theme="light"] .bg-slate-700\/30 ul li span {
    color: #334155 !important;
}

.theme-light .bg-slate-700\/50 p.text-xl,
[data-theme="light"] .bg-slate-700\/50 p.text-xl {
    color: #0f172a !important;
}

/* Level Cards in Chapters / Levels List */
.theme-light .space-y-4 > .bg-\[\#0b1329\],
.theme-light .space-y-4 > div,
[data-theme="light"] .space-y-4 > .bg-\[\#0b1329\],
[data-theme="light"] .space-y-4 > div {
    background-color: #ffffff !important;
    border-color: #e2e8f0 !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04) !important;
}

.theme-light .space-y-4 > div:hover,
[data-theme="light"] .space-y-4 > div:hover {
    border-color: rgba(2, 132, 199, 0.4) !important;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08) !important;
}

.theme-light .space-y-4 > div h3,
[data-theme="light"] .space-y-4 > div h3 {
    color: #0f172a !important;
}

/* Leaderboard Page Light Theme */
.theme-light #categorySelect,
.theme-light #subcategorySelect,
[data-theme="light"] #categorySelect,
[data-theme="light"] #subcategorySelect {
    background-color: #ffffff !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04) !important;
}

.theme-light select option,
[data-theme="light"] select option {
    background-color: #ffffff !important;
    color: #0f172a !important;
}

.theme-light .bg-slate-800\/50,
.theme-light [class*="bg-slate-800/50"],
[data-theme="light"] .bg-slate-800\/50,
[data-theme="light"] [class*="bg-slate-800/50"] {
    background-color: #f1f5f9 !important;
}

.theme-light .bg-slate-800\/50 a:not(.bg-primary),
[data-theme="light"] .bg-slate-800\/50 a:not(.bg-primary) {
    color: #475569 !important;
}

.theme-light .bg-slate-800\/50 a:not(.bg-primary):hover,
[data-theme="light"] .bg-slate-800\/50 a:not(.bg-primary):hover {
    color: #0f172a !important;
    background-color: #e2e8f0 !important;
}

/* Leaderboard Podiums (Silver, Gold, Bronze) */
.theme-light [class*="from-slate-500\/20"],
.theme-light [class*="from-yellow-500\/20"],
.theme-light [class*="from-orange-500\/20"],
[data-theme="light"] [class*="from-slate-500\/20"],
[data-theme="light"] [class*="from-yellow-500\/20"],
[data-theme="light"] [class*="from-orange-500\/20"] {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05) !important;
}

.theme-light .order-1 h3,
.theme-light .order-2 h3,
.theme-light .order-3 h3,
[data-theme="light"] .order-1 h3,
[data-theme="light"] .order-2 h3,
[data-theme="light"] .order-3 h3 {
    color: #0f172a !important;
}

/* Ad-Free & Bundle Banners in Light Theme */
.theme-light [class*="from-amber-500\/10"],
[data-theme="light"] [class*="from-amber-500\/10"] {
    background: #fffbeb !important;
    border-color: #fde68a !important;
}

.theme-light [class*="from-amber-500\/10"] span.text-white,
[data-theme="light"] [class*="from-amber-500\/10"] span.text-white {
    color: #92400e !important;
}

.theme-light [class*="from-amber-500\/10"] p,
[data-theme="light"] [class*="from-amber-500\/10"] p {
    color: #78350f !important;
}

.theme-light [class*="from-primary\/20"],
[data-theme="light"] [class*="from-primary\/20"] {
    background: #f0f9ff !important;
    border-color: #bae6fd !important;
}

.theme-light [class*="from-primary\/20"] span.text-white:not(button span):not(a span):not(.btn span),
.theme-light [class*="from-primary\/20"] p.text-white,
.theme-light [class*="from-primary\/20"] h1.text-white,
.theme-light [class*="from-primary\/20"] h2.text-white,
.theme-light [class*="from-primary\/20"] h3.text-white,
[data-theme="light"] [class*="from-primary\/20"] span.text-white:not(button span):not(a span):not(.btn span),
[data-theme="light"] [class*="from-primary\/20"] p.text-white,
[data-theme="light"] [class*="from-primary\/20"] h1.text-white,
[data-theme="light"] [class*="from-primary\/20"] h2.text-white,
[data-theme="light"] [class*="from-primary\/20"] h3.text-white {
    color: #0369a1 !important;
}

.theme-light [class*="from-primary\/20"] button,
.theme-light [class*="from-primary\/20"] button *,
.theme-light [class*="from-primary\/20"] a.gradient-primary,
.theme-light [class*="from-primary\/20"] a.gradient-primary *,
.theme-light [class*="from-primary\/20"] a.bg-primary,
.theme-light [class*="from-primary\/20"] a.bg-primary *,
[data-theme="light"] [class*="from-primary\/20"] button,
[data-theme="light"] [class*="from-primary\/20"] button *,
[data-theme="light"] [class*="from-primary\/20"] a.gradient-primary,
[data-theme="light"] [class*="from-primary\/20"] a.gradient-primary *,
[data-theme="light"] [class*="from-primary\/20"] a.bg-primary,
[data-theme="light"] [class*="from-primary\/20"] a.bg-primary * {
    color: #ffffff !important;
}

/* Dropdown Menus & Modals in Light Theme */
.theme-light .group-hover\:opacity-100,
.theme-light .dropdown-menu,
[data-theme="light"] .group-hover\:opacity-100,
[data-theme="light"] .dropdown-menu {
    background-color: #ffffff !important;
    border-color: #e2e8f0 !important;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.06) !important;
}

.theme-light .group-hover\:opacity-100 a,
.theme-light .dropdown-menu a,
[data-theme="light"] .group-hover\:opacity-100 a,
[data-theme="light"] .dropdown-menu a {
    color: #334155 !important;
}

.theme-light .group-hover\:opacity-100 a:hover,
.theme-light .dropdown-menu a:hover,
[data-theme="light"] .group-hover\:opacity-100 a:hover,
[data-theme="light"] .dropdown-menu a:hover {
    background-color: #f1f5f9 !important;
    color: #0f172a !important;
}

.theme-light hr,
.theme-light .border-slate-700\/50,
[data-theme="light"] hr,
[data-theme="light"] .border-slate-700\/50 {
    border-color: #e2e8f0 !important;
}

/* Form Controls in Light Theme */
.theme-light input,
.theme-light select,
.theme-light textarea,
[data-theme="light"] input,
[data-theme="light"] select,
[data-theme="light"] textarea {
    background-color: #ffffff !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
}

.theme-light input:focus,
.theme-light select:focus,
.theme-light textarea:focus,
[data-theme="light"] input:focus,
[data-theme="light"] select:focus,
[data-theme="light"] textarea:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15) !important;
}

.theme-light input::placeholder,
.theme-light textarea::placeholder,
[data-theme="light"] input::placeholder,
[data-theme="light"] textarea::placeholder {
    color: #94a3b8 !important;
}

/* Tables in Light Theme */
.theme-light table,
[data-theme="light"] table {
    background-color: #ffffff !important;
}

.theme-light table th,
[data-theme="light"] table th {
    background-color: #f8fafc !important;
    color: #475569 !important;
    border-color: #e2e8f0 !important;
}

.theme-light table td,
[data-theme="light"] table td {
    border-color: #e2e8f0 !important;
    color: #1e293b !important;
}

.theme-light table tr:hover td,
[data-theme="light"] table tr:hover td {
    background-color: #f8fafc !important;
}

/* ==========================================================================
   Quiz Result & Detailed Review Cards in Light Theme
   ========================================================================== */
.theme-light .bg-slate-800.rounded-2xl.p-6,
[data-theme="light"] .bg-slate-800.rounded-2xl.p-6 {
    background-color: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.06), 0 8px 10px -6px rgba(0, 0, 0, 0.04) !important;
}

.theme-light circle[stroke="#334155"],
[data-theme="light"] circle[stroke="#334155"] {
    stroke: #e2e8f0 !important;
}

.theme-light .bg-slate-700\/50.rounded-lg,
[data-theme="light"] .bg-slate-700\/50.rounded-lg {
    background-color: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
}

.theme-light .bg-slate-700\/20.rounded-lg,
[data-theme="light"] .bg-slate-700\/20.rounded-lg {
    background-color: #f1f5f9 !important;
    border-color: #e2e8f0 !important;
    color: #475569 !important;
}

.theme-light .bg-slate-800\/40.backdrop-blur-md.rounded-3xl,
[data-theme="light"] .bg-slate-800\/40.backdrop-blur-md.rounded-3xl {
    background-color: #ffffff !important;
    border: 1.5px solid #e2e8f0 !important;
    box-shadow: 0 8px 25px -4px rgba(0, 0, 0, 0.06) !important;
}

.theme-light .bg-slate-900\/80.w-12.h-12,
[data-theme="light"] .bg-slate-900\/80.w-12.h-12 {
    background-color: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
}

.theme-light .bg-slate-900\/60.rounded-2xl,
[data-theme="light"] .bg-slate-900\/60.rounded-2xl {
    background-color: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
}

.theme-light .bg-emerald-500\/5.rounded-2xl,
[data-theme="light"] .bg-emerald-500\/5.rounded-2xl {
    background-color: #ecfdf5 !important;
    border: 1.5px solid #a7f3d0 !important;
}

.theme-light .bg-slate-900\/40.rounded-2xl,
[data-theme="light"] .bg-slate-900\/40.rounded-2xl {
    background-color: #fffbeb !important;
    border: 1.5px solid #fde68a !important;
}

.theme-light .bg-slate-900\/40.rounded-2xl .text-slate-300,
[data-theme="light"] .bg-slate-900\/40.rounded-2xl .text-slate-300 {
    color: #78350f !important;
    font-weight: 500 !important;
}

.theme-light .bg-slate-900\/40.rounded-2xl .bg-slate-800,
[data-theme="light"] .bg-slate-900\/40.rounded-2xl .bg-slate-800 {
    background-color: #ffffff !important;
    border: 1px solid #fde68a !important;
    color: #b45309 !important;
}

/* ==========================================================================
   3. Custom Scrollbar, Animations & Utilities
   ========================================================================== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-muted);
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 3px;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fadeIn { animation: fadeIn 0.3s ease-out; }
.animate-pulse { animation: pulse 0.5s ease-in-out; }
.animate-shake { animation: shake 0.5s ease-in-out; }
.animate-slideUp { animation: slideUp 0.3s ease-out; }

/* Quiz Options */
.quiz-option {
    transition: all 0.2s ease;
}

.quiz-option:hover:not(.selected):not(.disabled) {
    background-color: rgba(2, 132, 199, 0.1);
    border-color: var(--primary);
}

.quiz-option.selected {
    border-color: var(--primary);
    background-color: rgba(2, 132, 199, 0.15);
}

.quiz-option.correct {
    border-color: #22c55e;
    background-color: rgba(34, 197, 94, 0.15);
}

.quiz-option.wrong {
    border-color: #ef4444;
    background-color: rgba(239, 68, 68, 0.15);
}

.quiz-option.disabled {
    pointer-events: none;
}

/* Card hover effect */
.card-hover {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* Mobile bottom nav safe area */
.pb-safe {
    padding-bottom: env(safe-area-inset-bottom, 0);
}

/* Urdu Typography Support */
.urdu, .nastaliq, [dir="rtl"].urdu, .urdu-text {
    font-family: 'Noto Nastaliq Urdu', 'Jameel Noori Nastaleeq', 'Urdu Typesetting', serif !important;
    direction: rtl !important;
    text-align: right;
    line-height: 2.1 !important;
    letter-spacing: 0px !important;
}

@media (max-width: 640px) {
    html {
        font-size: 14px;
    }
}
