/* ============================================
   PrakashNotes — Global Dark Mode Overrides
   Covers ALL pages via prefers-color-scheme

   Three blocks:
   1. @media (prefers-color-scheme: dark) + html:not([data-theme="light"])
      → Auto dark: fires only when OS prefers dark AND user hasn't forced light
   2. html[data-theme="dark"]
      → Manual dark: user explicitly picked dark mode
   3. html[data-theme="light"]
      → Manual light: user explicitly picked light mode
   ============================================ */


/* ============================================
   1. AUTO DARK (OS preference)
   ============================================ */
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) {
    color-scheme: dark;

    body {
      background: #0f172a !important;
      color: #e2e8f0 !important;
    }

    a:not(.nav-link):not(.dropdown-item):not(.profile-item):not(.sidebar-link):not(.footer-link):not(.nt-card-btn):not(.np-plan-btn):not(.np-banner-btn):not(.np-cta-btn):not(.ud-btn-primary):not(.ud-btn-outline):not(.ud-btn-white):not(.ud-btn-glass):not(.ud-submit):not(.ud-empty-btn):not(.ud-quick-a):not(.ncd-btn-primary):not(.ncd-chapter-link):not(.ncd-subchapter-link) { color: #38bdf8; }
    a:not(.nav-link):not(.dropdown-item):not(.profile-item):not(.sidebar-link):not(.footer-link):not(.nt-card-btn):not(.np-plan-btn):not(.np-banner-btn):not(.np-cta-btn):not(.ud-btn-primary):not(.ud-btn-outline):not(.ud-btn-white):not(.ud-btn-glass):not(.ud-submit):not(.ud-empty-btn):not(.ud-quick-a):not(.ncd-btn-primary):not(.ncd-chapter-link):not(.ncd-subchapter-link):hover { color: #7dd3fc; }

    h1, h2, h3, h4, h5, h6 {
      color: #f1f5f9 !important;
    }

    /* ===== BACKGROUNDS: white / gray ===== */
    .bg-white { background-color: #1e293b !important; }
    .bg-gray-50 { background-color: #0f172a !important; }
    .bg-gray-100 { background-color: #1e293b !important; }
    .bg-gray-200 { background-color: #334155 !important; }
    .bg-gray-300 { background-color: #475569 !important; }
    .bg-gray-400 { background-color: #64748b !important; }

    /* ===== BACKGROUNDS: blue ===== */
    .bg-blue-50 { background-color: rgba(56, 189, 248, 0.1) !important; }
    .bg-blue-100 { background-color: rgba(56, 189, 248, 0.15) !important; }
    .bg-blue-500 { background-color: #0284c7 !important; }
    .bg-blue-600 { background-color: #0284c7 !important; }
    .bg-blue-700 { background-color: #0369a1 !important; }
    .bg-blue-800 { background-color: #075985 !important; }

    /* ===== BACKGROUNDS: green ===== */
    .bg-green-50 { background-color: rgba(34, 197, 94, 0.1) !important; }
    .bg-green-100 { background-color: rgba(34, 197, 94, 0.15) !important; }
    .bg-green-500 { background-color: #16a34a !important; }
    .bg-green-600 { background-color: #15803d !important; }
    .bg-green-700 { background-color: #15803d !important; }

    /* ===== BACKGROUNDS: red ===== */
    .bg-red-50 { background-color: rgba(239, 68, 68, 0.1) !important; }
    .bg-red-100 { background-color: rgba(239, 68, 68, 0.15) !important; }
    .bg-red-500 { background-color: #dc2626 !important; }
    .bg-red-600 { background-color: #dc2626 !important; }

    /* ===== BACKGROUNDS: yellow / amber ===== */
    .bg-yellow-50 { background-color: rgba(234, 179, 8, 0.1) !important; }
    .bg-yellow-100 { background-color: rgba(234, 179, 8, 0.15) !important; }
    .bg-yellow-300 { background-color: #facc15 !important; }
    .bg-yellow-500 { background-color: #eab308 !important; }
    .bg-yellow-600 { background-color: #ca8a04 !important; }
    .bg-amber-50 { background-color: rgba(245, 158, 11, 0.1) !important; }
    .bg-amber-100 { background-color: rgba(245, 158, 11, 0.15) !important; }

    /* ===== BACKGROUNDS: orange ===== */
    .bg-orange-50 { background-color: rgba(249, 115, 22, 0.1) !important; }
    .bg-orange-100 { background-color: rgba(249, 115, 22, 0.15) !important; }
    .bg-orange-500 { background-color: #ea580c !important; }
    .bg-orange-600 { background-color: #ea580c !important; }

    /* ===== BACKGROUNDS: purple ===== */
    .bg-purple-50 { background-color: rgba(168, 85, 247, 0.1) !important; }
    .bg-purple-100 { background-color: rgba(168, 85, 247, 0.15) !important; }
    .bg-purple-300 { background-color: #a855f7 !important; }
    .bg-purple-500 { background-color: #a855f7 !important; }
    .bg-purple-600 { background-color: #9333ea !important; }
    .bg-purple-700 { background-color: #7e22ce !important; }

    /* ===== BACKGROUNDS: indigo ===== */
    .bg-indigo-50 { background-color: rgba(99, 102, 241, 0.1) !important; }
    .bg-indigo-100 { background-color: rgba(99, 102, 241, 0.15) !important; }
    .bg-indigo-600 { background-color: #4f46e5 !important; }
    .bg-indigo-700 { background-color: #4338ca !important; }

    /* ===== BACKGROUNDS: teal / cyan ===== */
    .bg-teal-50 { background-color: rgba(20, 184, 166, 0.1) !important; }
    .bg-teal-100 { background-color: rgba(20, 184, 166, 0.15) !important; }
    .bg-teal-500 { background-color: #14b8a6 !important; }
    .bg-teal-600 { background-color: #0d9488 !important; }
    .bg-teal-700 { background-color: #0f766e !important; }
    .bg-cyan-50 { background-color: rgba(6, 182, 212, 0.1) !important; }
    .bg-cyan-100 { background-color: rgba(6, 182, 212, 0.15) !important; }
    .bg-cyan-500 { background-color: #06b6d4 !important; }
    .bg-cyan-600 { background-color: #0891b2 !important; }
    .bg-cyan-700 { background-color: #0e7490 !important; }

    /* ===== BACKGROUNDS: slate ===== */
    .bg-slate-50 { background-color: #0f172a !important; }
    .bg-slate-100 { background-color: #1e293b !important; }
    .bg-slate-200 { background-color: #334155 !important; }
    .bg-slate-300 { background-color: #475569 !important; }
    .bg-slate-700 { background-color: #334155 !important; }
    .bg-slate-800 { background-color: #1e293b !important; }
    .bg-slate-900 { background-color: #0f172a !important; }

    /* ===== TEXT: gray ===== */
    .text-gray-100 { color: #f1f5f9 !important; }
    .text-gray-200 { color: #e2e8f0 !important; }
    .text-gray-300 { color: #cbd5e1 !important; }
    .text-gray-400 { color: #94a3b8 !important; }
    .text-gray-500 { color: #94a3b8 !important; }
    .text-gray-600 { color: #cbd5e1 !important; }
    .text-gray-700 { color: #e2e8f0 !important; }
    .text-gray-800 { color: #f1f5f9 !important; }
    .text-gray-900 { color: #f1f5f9 !important; }
    .text-black { color: #f1f5f9 !important; }

    /* ===== TEXT: blue ===== */
    .text-blue-300 { color: #93c5fd !important; }
    .text-blue-400 { color: #60a5fa !important; }
    .text-blue-500 { color: #3b82f6 !important; }
    .text-blue-600 { color: #38bdf8 !important; }
    .text-blue-700 { color: #60a5fa !important; }
    .text-blue-800 { color: #93c5fd !important; }

    /* ===== TEXT: green ===== */
    .text-green-400 { color: #4ade80 !important; }
    .text-green-500 { color: #4ade80 !important; }
    .text-green-600 { color: #4ade80 !important; }
    .text-green-700 { color: #86efac !important; }
    .text-green-800 { color: #bbf7d0 !important; }

    /* ===== TEXT: red ===== */
    .text-red-300 { color: #fca5a5 !important; }
    .text-red-400 { color: #f87171 !important; }
    .text-red-500 { color: #f87171 !important; }
    .text-red-600 { color: #f87171 !important; }
    .text-red-700 { color: #fca5a5 !important; }
    .text-red-800 { color: #fecaca !important; }

    /* ===== TEXT: yellow ===== */
    .text-yellow-600 { color: #facc15 !important; }
    .text-yellow-700 { color: #fde047 !important; }
    .text-yellow-800 { color: #fef08a !important; }

    /* ===== TEXT: orange ===== */
    .text-orange-500 { color: #fb923c !important; }
    .text-orange-600 { color: #fb923c !important; }

    /* ===== TEXT: purple ===== */
    .text-purple-500 { color: #c084fc !important; }
    .text-purple-600 { color: #c084fc !important; }
    .text-purple-700 { color: #d8b4fe !important; }

    /* ===== TEXT: indigo ===== */
    .text-indigo-500 { color: #818cf8 !important; }
    .text-indigo-600 { color: #818cf8 !important; }
    .text-indigo-700 { color: #a5b4fc !important; }

    /* ===== TEXT: teal / cyan ===== */
    .text-teal-500 { color: #2dd4bf !important; }
    .text-teal-600 { color: #2dd4bf !important; }
    .text-teal-700 { color: #5eead4 !important; }
    .text-cyan-500 { color: #22d3ee !important; }
    .text-cyan-600 { color: #22d3ee !important; }
    .text-cyan-700 { color: #67e8f9 !important; }

    /* ===== TEXT: slate ===== */
    .text-slate-500 { color: #94a3b8 !important; }
    .text-slate-600 { color: #cbd5e1 !important; }
    .text-slate-700 { color: #e2e8f0 !important; }
    .text-slate-800 { color: #f1f5f9 !important; }
    .text-slate-900 { color: #f1f5f9 !important; }

    /* ===== TEXT: emerald ===== */
    .text-emerald-500 { color: #34d399 !important; }
    .text-emerald-600 { color: #34d399 !important; }
    .text-emerald-700 { color: #6ee7b7 !important; }

    /* ===== TEXT: amber ===== */
    .text-amber-500 { color: #fbbf24 !important; }
    .text-amber-600 { color: #fbbf24 !important; }

    /* ===== BORDERS ===== */
    .border-gray-50 { border-color: #1e293b !important; }
    .border-gray-100 { border-color: #1e293b !important; }
    .border-gray-200 { border-color: #334155 !important; }
    .border-gray-300 { border-color: #475569 !important; }
    .border-gray-400 { border-color: #64748b !important; }
    .border-blue-300 { border-color: #60a5fa !important; }
    .border-blue-400 { border-color: #60a5fa !important; }
    .border-blue-500 { border-color: #3b82f6 !important; }
    .border-green-100 { border-color: rgba(34, 197, 94, 0.2) !important; }
    .border-green-200 { border-color: rgba(34, 197, 94, 0.3) !important; }
    .border-green-300 { border-color: rgba(34, 197, 94, 0.4) !important; }
    .border-green-400 { border-color: #4ade80 !important; }
    .border-green-500 { border-color: #4ade80 !important; }
    .border-red-300 { border-color: #f87171 !important; }
    .border-red-500 { border-color: #f87171 !important; }
    .border-yellow-300 { border-color: #facc15 !important; }
    .border-indigo-300 { border-color: #818cf8 !important; }
    .border-indigo-500 { border-color: #6366f1 !important; }
    .border-purple-300 { border-color: #c084fc !important; }
    .border-teal-300 { border-color: #2dd4bf !important; }
    .border-teal-500 { border-color: #14b8a6 !important; }
    .border-cyan-300 { border-color: #22d3ee !important; }
    .border-cyan-500 { border-color: #06b6d4 !important; }
    .border-slate-200 { border-color: #334155 !important; }
    .border-slate-300 { border-color: #475569 !important; }
    .border-slate-700 { border-color: #475569 !important; }

    /* ===== DIVIDE ===== */
    .divide-gray-200 > :not([hidden]) ~ :not([hidden]) { border-color: #334155 !important; }
    .divide-gray-300 > :not([hidden]) ~ :not([hidden]) { border-color: #475569 !important; }

    /* ===== RING / FOCUS ===== */
    .ring-gray-300 { --tw-ring-color: #475569 !important; }
    .ring-blue-500 { --tw-ring-color: #3b82f6 !important; }

    /* ===== SHADOWS ===== */
    .shadow {
      --tw-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.4), 0 1px 2px -1px rgba(0, 0, 0, 0.4) !important;
      box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow) !important;
    }
    .shadow-sm {
      --tw-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.4) !important;
      box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow) !important;
    }
    .shadow-md {
      --tw-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.4) !important;
      box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow) !important;
    }
    .shadow-lg {
      --tw-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -4px rgba(0, 0, 0, 0.4) !important;
      box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow) !important;
    }
    .shadow-xl {
      --tw-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.4) !important;
      box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow) !important;
    }
    .shadow-2xl {
      --tw-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6) !important;
      box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow) !important;
    }

    /* ===== GRADIENTS ===== */
    .bg-gradient-to-br { background-color: #1e293b !important; }
    .bg-gradient-to-r { background-color: #1e293b !important; }

    /* ===== FORMS ===== */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="search"],
    input[type="url"],
    input[type="date"],
    input[type="tel"],
    textarea,
    select {
      background-color: #0f172a !important;
      border-color: #475569 !important;
      color: #f1f5f9 !important;
    }

    input::placeholder,
    textarea::placeholder { color: #64748b !important; }

    input:focus,
    textarea:focus,
    select:focus {
      border-color: #38bdf8 !important;
      box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15) !important;
    }

    label { color: #e2e8f0 !important; }

    /* ===== SCROLLBAR ===== */
    ::-webkit-scrollbar-track { background: #0f172a !important; }
    ::-webkit-scrollbar-thumb { background: #475569 !important; }
    ::-webkit-scrollbar-thumb:hover { background: #64748b !important; }

    /* ===== DJANGO MESSAGES ===== */
    #django-messages .bg-blue-100 {
      background: rgba(56, 189, 248, 0.15) !important;
      color: #7dd3fc !important;
    }
    #django-messages .bg-green-100 {
      background: rgba(34, 197, 94, 0.15) !important;
      color: #4ade80 !important;
    }
    #django-messages .bg-yellow-100 {
      background: rgba(234, 179, 8, 0.15) !important;
      color: #facc15 !important;
    }
    #django-messages .bg-red-100 {
      background: rgba(239, 68, 68, 0.15) !important;
      color: #f87171 !important;
    }

    /* ===== ERRORLIST ===== */
    .errorlist > li { color: #f87171 !important; }

    /* ===== TABLES ===== */
    table { color: #e2e8f0 !important; }
    th { background-color: #1e293b !important; color: #f1f5f9 !important; }
    td { border-color: #334155 !important; }
    tr:nth-child(even) { background-color: rgba(30, 41, 59, 0.5) !important; }

    /* ===== CODE BLOCKS ===== */
    pre { background-color: #0f172a !important; color: #e2e8f0 !important; }
    code { background-color: #1e293b !important; color: #f472b6 !important; }
    pre code { background-color: transparent !important; color: #e2e8f0 !important; }

    /* ===== PROSE / ARTICLE CONTENT ===== */
    .prose { color: #e2e8f0 !important; }
    .prose h1, .prose h2, .prose h3, .prose h4, .prose h5, .prose h6 { color: #f1f5f9 !important; }
    .prose a { color: #38bdf8 !important; }
    .prose strong { color: #f1f5f9 !important; }
    .prose code { background-color: #1e293b !important; color: #f472b6 !important; }
    .prose pre { background-color: #0f172a !important; }
    .prose blockquote { border-left-color: #475569 !important; color: #94a3b8 !important; }
    .prose hr { border-color: #334155 !important; }
    .prose td, .prose th { border-color: #334155 !important; }

    /* ===== CARDS & SECTIONS ===== */
    .nbd-card,
    .nbd-article-shell,
    .nbd-related-card,
    .nbd-card-title {
      background-color: #1e293b !important;
      color: #e2e8f0 !important;
      border-color: #334155 !important;
    }

    /* ===== IN-ARTICLE AD ===== */
    .in-article-ad {
      background-color: rgba(30, 41, 59, 0.5) !important;
      border-color: #334155 !important;
    }

    /* ===== PRICING CARDS ===== */
    .pricing-card,
    [class*="pricing"] {
      background-color: #1e293b !important;
      border-color: #334155 !important;
    }

    /* ===== QUIZ / MCQ ===== */
    .quiz-option,
    .mcq-option,
    [class*="option"] {
      background-color: #1e293b !important;
      border-color: #475569 !important;
      color: #e2e8f0 !important;
    }
    .quiz-option:active,
    .mcq-option:active {
      border-color: #38bdf8 !important;
      background-color: rgba(56, 189, 248, 0.08) !important;
    }
    .quiz-option.selected,
    .mcq-option.selected {
      border-color: #38bdf8 !important;
      background-color: rgba(56, 189, 248, 0.12) !important;
    }

    /* ===== USER DASHBOARD ===== */
    .dashboard-card,
    [class*="dashboard"] {
      background-color: #1e293b !important;
      border-color: #334155 !important;
    }

    /* ===== LOGIN / REGISTER FORMS ===== */
    .auth-card,
    [class*="login"],
    [class*="register"],
    [class*="auth"] {
      background-color: #1e293b !important;
      border-color: #334155 !important;
    }

    /* ===== NOTES LIST ===== */
    .note-card {
      background-color: #1e293b !important;
      border-color: #334155 !important;
      color: #e2e8f0 !important;
    }
    .note-card:hover {
      border-color: #38bdf8 !important;
    }

    /* ===== BLOG CARDS ===== */
    .blog-card {
      background-color: #1e293b !important;
      border-color: #334155 !important;
      color: #e2e8f0 !important;
    }

    /* ===== FOOTER ===== */
    footer {
      background-color: #0f172a !important;
      color: #94a3b8 !important;
    }
    footer a { color: #94a3b8 !important; }
    footer a:hover { color: #38bdf8 !important; }

    /* ===== CATEGORY BADGES ===== */
    .bg-primary\/10,
    [class*="bg-primary"] {
      background-color: rgba(56, 189, 248, 0.15) !important;
      color: #38bdf8 !important;
    }

    /* ===== HERO SECTIONS ===== */
    .hero-section {
      background-color: #0f172a !important;
      color: #f1f5f9 !important;
    }

    /* ===== SEARCH RESULTS ===== */
    .search-result-item { border-color: #334155 !important; }
    .search-result-item:hover { background-color: rgba(56, 189, 248, 0.06) !important; }

    /* ===== SIDEBAR ===== */
    .sidebar {
      background-color: #0f172a !important;
      border-right-color: #1e293b !important;
    }

    /* ===== EMPTY STATES ===== */
    .empty-state,
    [class*="empty"] {
      background-color: #1e293b !important;
      color: #94a3b8 !important;
    }

    /* ===== TOOLTIPS ===== */
    [data-tooltip]::after {
      background-color: #1e293b !important;
      color: #f1f5f9 !important;
    }

    /* ===== BADGES ===== */
    .badge {
      background-color: #334155 !important;
      color: #e2e8f0 !important;
    }

    /* ===== BRAND NAME (PrakashNotes) ===== */
    .brand-name { color: #ffffff !important; }

    /* ===== LOGO — swap to dark variant ===== */
    img.logo-svg,
    .mobile-header-logo img {
      content: url('/static/logo/logo-dark.svg');
    }
  }
}


/* ============================================
   2. MANUAL DARK MODE (user explicitly picked dark)
   ============================================ */
html[data-theme="dark"] {
  color-scheme: dark;
}

html[data-theme="dark"] body {
  background: #0f172a !important;
  color: #e2e8f0 !important;
}

html[data-theme="dark"] a:not(.nav-link):not(.dropdown-item):not(.profile-item):not(.sidebar-link):not(.footer-link):not(.home-cta-btn):not(.nav-btn):not(.nt-card-btn):not(.np-plan-btn):not(.np-banner-btn):not(.np-cta-btn):not(.ud-btn-primary):not(.ud-btn-outline):not(.ud-btn-white):not(.ud-btn-glass):not(.ud-submit):not(.ud-empty-btn):not(.ud-quick-a):not(.ncd-btn-primary):not(.ncd-chapter-link):not(.ncd-subchapter-link) { color: #38bdf8 !important; }
html[data-theme="dark"] a:not(.nav-link):not(.dropdown-item):not(.profile-item):not(.sidebar-link):not(.footer-link):not(.home-cta-btn):not(.nav-btn):not(.nt-card-btn):not(.np-plan-btn):not(.np-banner-btn):not(.np-cta-btn):not(.ud-btn-primary):not(.ud-btn-outline):not(.ud-btn-white):not(.ud-btn-glass):not(.ud-submit):not(.ud-empty-btn):not(.ud-quick-a):not(.ncd-btn-primary):not(.ncd-chapter-link):not(.ncd-subchapter-link):hover { color: #7dd3fc !important; }
html[data-theme="dark"] h1, html[data-theme="dark"] h2, html[data-theme="dark"] h3,
html[data-theme="dark"] h4, html[data-theme="dark"] h5, html[data-theme="dark"] h6 {
  color: #f1f5f9 !important;
}

/* Backgrounds */
html[data-theme="dark"] .bg-white { background-color: #1e293b !important; }
html[data-theme="dark"] .bg-gray-50 { background-color: #0f172a !important; }
html[data-theme="dark"] .bg-gray-100 { background-color: #1e293b !important; }
html[data-theme="dark"] .bg-gray-200 { background-color: #334155 !important; }
html[data-theme="dark"] .bg-gray-300 { background-color: #475569 !important; }
html[data-theme="dark"] .bg-gray-400 { background-color: #64748b !important; }
html[data-theme="dark"] .bg-blue-50 { background-color: rgba(56, 189, 248, 0.1) !important; }
html[data-theme="dark"] .bg-blue-100 { background-color: rgba(56, 189, 248, 0.15) !important; }
html[data-theme="dark"] .bg-blue-500 { background-color: #0284c7 !important; }
html[data-theme="dark"] .bg-blue-600 { background-color: #0284c7 !important; }
html[data-theme="dark"] .bg-blue-700 { background-color: #0369a1 !important; }
html[data-theme="dark"] .bg-blue-800 { background-color: #075985 !important; }
html[data-theme="dark"] .bg-green-50 { background-color: rgba(34, 197, 94, 0.1) !important; }
html[data-theme="dark"] .bg-green-100 { background-color: rgba(34, 197, 94, 0.15) !important; }
html[data-theme="dark"] .bg-green-500 { background-color: #16a34a !important; }
html[data-theme="dark"] .bg-green-600 { background-color: #15803d !important; }
html[data-theme="dark"] .bg-green-700 { background-color: #15803d !important; }
html[data-theme="dark"] .bg-red-50 { background-color: rgba(239, 68, 68, 0.1) !important; }
html[data-theme="dark"] .bg-red-100 { background-color: rgba(239, 68, 68, 0.15) !important; }
html[data-theme="dark"] .bg-red-500 { background-color: #dc2626 !important; }
html[data-theme="dark"] .bg-red-600 { background-color: #dc2626 !important; }
html[data-theme="dark"] .bg-yellow-50 { background-color: rgba(234, 179, 8, 0.1) !important; }
html[data-theme="dark"] .bg-yellow-100 { background-color: rgba(234, 179, 8, 0.15) !important; }
html[data-theme="dark"] .bg-yellow-300 { background-color: #facc15 !important; }
html[data-theme="dark"] .bg-yellow-500 { background-color: #eab308 !important; }
html[data-theme="dark"] .bg-yellow-600 { background-color: #ca8a04 !important; }
html[data-theme="dark"] .bg-amber-50 { background-color: rgba(245, 158, 11, 0.1) !important; }
html[data-theme="dark"] .bg-amber-100 { background-color: rgba(245, 158, 11, 0.15) !important; }
html[data-theme="dark"] .bg-orange-50 { background-color: rgba(249, 115, 22, 0.1) !important; }
html[data-theme="dark"] .bg-orange-100 { background-color: rgba(249, 115, 22, 0.15) !important; }
html[data-theme="dark"] .bg-orange-500 { background-color: #ea580c !important; }
html[data-theme="dark"] .bg-orange-600 { background-color: #ea580c !important; }
html[data-theme="dark"] .bg-purple-50 { background-color: rgba(168, 85, 247, 0.1) !important; }
html[data-theme="dark"] .bg-purple-100 { background-color: rgba(168, 85, 247, 0.15) !important; }
html[data-theme="dark"] .bg-purple-300 { background-color: #a855f7 !important; }
html[data-theme="dark"] .bg-purple-500 { background-color: #a855f7 !important; }
html[data-theme="dark"] .bg-purple-600 { background-color: #9333ea !important; }
html[data-theme="dark"] .bg-purple-700 { background-color: #7e22ce !important; }
html[data-theme="dark"] .bg-indigo-50 { background-color: rgba(99, 102, 241, 0.1) !important; }
html[data-theme="dark"] .bg-indigo-100 { background-color: rgba(99, 102, 241, 0.15) !important; }
html[data-theme="dark"] .bg-indigo-600 { background-color: #4f46e5 !important; }
html[data-theme="dark"] .bg-indigo-700 { background-color: #4338ca !important; }
html[data-theme="dark"] .bg-teal-50 { background-color: rgba(20, 184, 166, 0.1) !important; }
html[data-theme="dark"] .bg-teal-100 { background-color: rgba(20, 184, 166, 0.15) !important; }
html[data-theme="dark"] .bg-teal-500 { background-color: #14b8a6 !important; }
html[data-theme="dark"] .bg-teal-600 { background-color: #0d9488 !important; }
html[data-theme="dark"] .bg-teal-700 { background-color: #0f766e !important; }
html[data-theme="dark"] .bg-cyan-50 { background-color: rgba(6, 182, 212, 0.1) !important; }
html[data-theme="dark"] .bg-cyan-100 { background-color: rgba(6, 182, 212, 0.15) !important; }
html[data-theme="dark"] .bg-cyan-500 { background-color: #06b6d4 !important; }
html[data-theme="dark"] .bg-cyan-600 { background-color: #0891b2 !important; }
html[data-theme="dark"] .bg-cyan-700 { background-color: #0e7490 !important; }
html[data-theme="dark"] .bg-slate-50 { background-color: #0f172a !important; }
html[data-theme="dark"] .bg-slate-100 { background-color: #1e293b !important; }
html[data-theme="dark"] .bg-slate-200 { background-color: #334155 !important; }
html[data-theme="dark"] .bg-slate-300 { background-color: #475569 !important; }
html[data-theme="dark"] .bg-slate-700 { background-color: #334155 !important; }
html[data-theme="dark"] .bg-slate-800 { background-color: #1e293b !important; }
html[data-theme="dark"] .bg-slate-900 { background-color: #0f172a !important; }

/* Text */
html[data-theme="dark"] .text-gray-100 { color: #f1f5f9 !important; }
html[data-theme="dark"] .text-gray-200 { color: #e2e8f0 !important; }
html[data-theme="dark"] .text-gray-300 { color: #cbd5e1 !important; }
html[data-theme="dark"] .text-gray-400 { color: #94a3b8 !important; }
html[data-theme="dark"] .text-gray-500 { color: #94a3b8 !important; }
html[data-theme="dark"] .text-gray-600 { color: #cbd5e1 !important; }
html[data-theme="dark"] .text-gray-700 { color: #e2e8f0 !important; }
html[data-theme="dark"] .text-gray-800 { color: #f1f5f9 !important; }
html[data-theme="dark"] .text-gray-900 { color: #f1f5f9 !important; }
html[data-theme="dark"] .text-black { color: #f1f5f9 !important; }
html[data-theme="dark"] .text-blue-300 { color: #93c5fd !important; }
html[data-theme="dark"] .text-blue-400 { color: #60a5fa !important; }
html[data-theme="dark"] .text-blue-500 { color: #3b82f6 !important; }
html[data-theme="dark"] .text-blue-600 { color: #38bdf8 !important; }
html[data-theme="dark"] .text-blue-700 { color: #60a5fa !important; }
html[data-theme="dark"] .text-blue-800 { color: #93c5fd !important; }
html[data-theme="dark"] .text-green-400 { color: #4ade80 !important; }
html[data-theme="dark"] .text-green-500 { color: #4ade80 !important; }
html[data-theme="dark"] .text-green-600 { color: #4ade80 !important; }
html[data-theme="dark"] .text-green-700 { color: #86efac !important; }
html[data-theme="dark"] .text-green-800 { color: #bbf7d0 !important; }
html[data-theme="dark"] .text-red-300 { color: #fca5a5 !important; }
html[data-theme="dark"] .text-red-400 { color: #f87171 !important; }
html[data-theme="dark"] .text-red-500 { color: #f87171 !important; }
html[data-theme="dark"] .text-red-600 { color: #f87171 !important; }
html[data-theme="dark"] .text-red-700 { color: #fca5a5 !important; }
html[data-theme="dark"] .text-red-800 { color: #fecaca !important; }
html[data-theme="dark"] .text-yellow-600 { color: #facc15 !important; }
html[data-theme="dark"] .text-yellow-700 { color: #fde047 !important; }
html[data-theme="dark"] .text-yellow-800 { color: #fef08a !important; }
html[data-theme="dark"] .text-orange-500 { color: #fb923c !important; }
html[data-theme="dark"] .text-orange-600 { color: #fb923c !important; }
html[data-theme="dark"] .text-purple-500 { color: #c084fc !important; }
html[data-theme="dark"] .text-purple-600 { color: #c084fc !important; }
html[data-theme="dark"] .text-purple-700 { color: #d8b4fe !important; }
html[data-theme="dark"] .text-indigo-500 { color: #818cf8 !important; }
html[data-theme="dark"] .text-indigo-600 { color: #818cf8 !important; }
html[data-theme="dark"] .text-indigo-700 { color: #a5b4fc !important; }
html[data-theme="dark"] .text-teal-500 { color: #2dd4bf !important; }
html[data-theme="dark"] .text-teal-600 { color: #2dd4bf !important; }
html[data-theme="dark"] .text-teal-700 { color: #5eead4 !important; }
html[data-theme="dark"] .text-cyan-500 { color: #22d3ee !important; }
html[data-theme="dark"] .text-cyan-600 { color: #22d3ee !important; }
html[data-theme="dark"] .text-cyan-700 { color: #67e8f9 !important; }
html[data-theme="dark"] .text-slate-500 { color: #94a3b8 !important; }
html[data-theme="dark"] .text-slate-600 { color: #cbd5e1 !important; }
html[data-theme="dark"] .text-slate-700 { color: #e2e8f0 !important; }
html[data-theme="dark"] .text-slate-800 { color: #f1f5f9 !important; }
html[data-theme="dark"] .text-slate-900 { color: #f1f5f9 !important; }
html[data-theme="dark"] .text-emerald-500 { color: #34d399 !important; }
html[data-theme="dark"] .text-emerald-600 { color: #34d399 !important; }
html[data-theme="dark"] .text-emerald-700 { color: #6ee7b7 !important; }
html[data-theme="dark"] .text-amber-500 { color: #fbbf24 !important; }
html[data-theme="dark"] .text-amber-600 { color: #fbbf24 !important; }

/* Borders */
html[data-theme="dark"] .border-gray-50 { border-color: #1e293b !important; }
html[data-theme="dark"] .border-gray-100 { border-color: #1e293b !important; }
html[data-theme="dark"] .border-gray-200 { border-color: #334155 !important; }
html[data-theme="dark"] .border-gray-300 { border-color: #475569 !important; }
html[data-theme="dark"] .border-gray-400 { border-color: #64748b !important; }
html[data-theme="dark"] .border-blue-300 { border-color: #60a5fa !important; }
html[data-theme="dark"] .border-blue-400 { border-color: #60a5fa !important; }
html[data-theme="dark"] .border-blue-500 { border-color: #3b82f6 !important; }
html[data-theme="dark"] .border-green-100 { border-color: rgba(34, 197, 94, 0.2) !important; }
html[data-theme="dark"] .border-green-200 { border-color: rgba(34, 197, 94, 0.3) !important; }
html[data-theme="dark"] .border-green-300 { border-color: rgba(34, 197, 94, 0.4) !important; }
html[data-theme="dark"] .border-green-400 { border-color: #4ade80 !important; }
html[data-theme="dark"] .border-green-500 { border-color: #4ade80 !important; }
html[data-theme="dark"] .border-red-300 { border-color: #f87171 !important; }
html[data-theme="dark"] .border-red-500 { border-color: #f87171 !important; }
html[data-theme="dark"] .border-yellow-300 { border-color: #facc15 !important; }
html[data-theme="dark"] .border-indigo-300 { border-color: #818cf8 !important; }
html[data-theme="dark"] .border-indigo-500 { border-color: #6366f1 !important; }
html[data-theme="dark"] .border-purple-300 { border-color: #c084fc !important; }
html[data-theme="dark"] .border-teal-300 { border-color: #2dd4bf !important; }
html[data-theme="dark"] .border-teal-500 { border-color: #14b8a6 !important; }
html[data-theme="dark"] .border-cyan-300 { border-color: #22d3ee !important; }
html[data-theme="dark"] .border-cyan-500 { border-color: #06b6d4 !important; }
html[data-theme="dark"] .border-slate-200 { border-color: #334155 !important; }
html[data-theme="dark"] .border-slate-300 { border-color: #475569 !important; }
html[data-theme="dark"] .border-slate-700 { border-color: #475569 !important; }

/* Divide */
html[data-theme="dark"] .divide-gray-200 > :not([hidden]) ~ :not([hidden]) { border-color: #334155 !important; }
html[data-theme="dark"] .divide-gray-300 > :not([hidden]) ~ :not([hidden]) { border-color: #475569 !important; }

/* Ring */
html[data-theme="dark"] .ring-gray-300 { --tw-ring-color: #475569 !important; }
html[data-theme="dark"] .ring-blue-500 { --tw-ring-color: #3b82f6 !important; }

/* Shadows */
html[data-theme="dark"] .shadow {
  --tw-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.4), 0 1px 2px -1px rgba(0, 0, 0, 0.4) !important;
  box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow) !important;
}
html[data-theme="dark"] .shadow-sm {
  --tw-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.4) !important;
  box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow) !important;
}
html[data-theme="dark"] .shadow-md {
  --tw-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.4) !important;
  box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow) !important;
}
html[data-theme="dark"] .shadow-lg {
  --tw-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -4px rgba(0, 0, 0, 0.4) !important;
  box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow) !important;
}
html[data-theme="dark"] .shadow-xl {
  --tw-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.4) !important;
  box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow) !important;
}
html[data-theme="dark"] .shadow-2xl {
  --tw-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6) !important;
  box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow) !important;
}

/* Gradient */
html[data-theme="dark"] .bg-gradient-to-br { background-color: #1e293b !important; }
html[data-theme="dark"] .bg-gradient-to-r { background-color: #1e293b !important; }

/* Forms */
html[data-theme="dark"] input[type="text"],
html[data-theme="dark"] input[type="email"],
html[data-theme="dark"] input[type="password"],
html[data-theme="dark"] input[type="number"],
html[data-theme="dark"] input[type="search"],
html[data-theme="dark"] input[type="url"],
html[data-theme="dark"] input[type="date"],
html[data-theme="dark"] input[type="tel"],
html[data-theme="dark"] textarea,
html[data-theme="dark"] select {
  background-color: #0f172a !important;
  border-color: #475569 !important;
  color: #f1f5f9 !important;
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder { color: #64748b !important; }

html[data-theme="dark"] input:focus,
html[data-theme="dark"] textarea:focus,
html[data-theme="dark"] select:focus {
  border-color: #38bdf8 !important;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15) !important;
}

html[data-theme="dark"] label { color: #e2e8f0 !important; }

/* Scrollbar */
html[data-theme="dark"] ::-webkit-scrollbar-track { background: #0f172a !important; }
html[data-theme="dark"] ::-webkit-scrollbar-thumb { background: #475569 !important; }
html[data-theme="dark"] ::-webkit-scrollbar-thumb:hover { background: #64748b !important; }

/* Django messages */
html[data-theme="dark"] #django-messages .bg-blue-100 { background: rgba(56, 189, 248, 0.15) !important; color: #7dd3fc !important; }
html[data-theme="dark"] #django-messages .bg-green-100 { background: rgba(34, 197, 94, 0.15) !important; color: #4ade80 !important; }
html[data-theme="dark"] #django-messages .bg-yellow-100 { background: rgba(234, 179, 8, 0.15) !important; color: #facc15 !important; }
html[data-theme="dark"] #django-messages .bg-red-100 { background: rgba(239, 68, 68, 0.15) !important; color: #f87171 !important; }

/* Errorlist */
html[data-theme="dark"] .errorlist > li { color: #f87171 !important; }

/* Tables */
html[data-theme="dark"] table { color: #e2e8f0 !important; }
html[data-theme="dark"] th { background-color: #1e293b !important; color: #f1f5f9 !important; }
html[data-theme="dark"] td { border-color: #334155 !important; }
html[data-theme="dark"] tr:nth-child(even) { background-color: rgba(30, 41, 59, 0.5) !important; }

/* Code */
html[data-theme="dark"] pre { background-color: #0f172a !important; color: #e2e8f0 !important; }
html[data-theme="dark"] code { background-color: #1e293b !important; color: #f472b6 !important; }
html[data-theme="dark"] pre code { background-color: transparent !important; color: #e2e8f0 !important; }

/* Prose */
html[data-theme="dark"] .prose { color: #e2e8f0 !important; }
html[data-theme="dark"] .prose h1, html[data-theme="dark"] .prose h2, html[data-theme="dark"] .prose h3,
html[data-theme="dark"] .prose h4, html[data-theme="dark"] .prose h5, html[data-theme="dark"] .prose h6 { color: #f1f5f9 !important; }
html[data-theme="dark"] .prose a { color: #38bdf8 !important; }
html[data-theme="dark"] .prose strong { color: #f1f5f9 !important; }
html[data-theme="dark"] .prose code { background-color: #1e293b !important; color: #f472b6 !important; }
html[data-theme="dark"] .prose pre { background-color: #0f172a !important; }
html[data-theme="dark"] .prose blockquote { border-left-color: #475569 !important; color: #94a3b8 !important; }
html[data-theme="dark"] .prose hr { border-color: #334155 !important; }
html[data-theme="dark"] .prose td, html[data-theme="dark"] .prose th { border-color: #334155 !important; }

/* Cards */
html[data-theme="dark"] .nbd-card,
html[data-theme="dark"] .nbd-article-shell,
html[data-theme="dark"] .nbd-related-card,
html[data-theme="dark"] .nbd-card-title {
  background-color: #1e293b !important;
  color: #e2e8f0 !important;
  border-color: #334155 !important;
}

/* Ad */
html[data-theme="dark"] .in-article-ad { background-color: rgba(30, 41, 59, 0.5) !important; border-color: #334155 !important; }

/* Pricing */
html[data-theme="dark"] .pricing-card,
html[data-theme="dark"] [class*="pricing"] { background-color: #1e293b !important; border-color: #334155 !important; }

/* Quiz */
html[data-theme="dark"] .quiz-option,
html[data-theme="dark"] .mcq-option,
html[data-theme="dark"] [class*="option"] {
  background-color: #1e293b !important;
  border-color: #475569 !important;
  color: #e2e8f0 !important;
}
html[data-theme="dark"] .quiz-option:active,
html[data-theme="dark"] .mcq-option:active {
  border-color: #38bdf8 !important;
  background-color: rgba(56, 189, 248, 0.08) !important;
}
html[data-theme="dark"] .quiz-option.selected,
html[data-theme="dark"] .mcq-option.selected {
  border-color: #38bdf8 !important;
  background-color: rgba(56, 189, 248, 0.12) !important;
}

/* Dashboard */
html[data-theme="dark"] .dashboard-card,
html[data-theme="dark"] [class*="dashboard"] { background-color: #1e293b !important; border-color: #334155 !important; }

/* Auth */
html[data-theme="dark"] .auth-card,
html[data-theme="dark"] [class*="login"],
html[data-theme="dark"] [class*="register"],
html[data-theme="dark"] [class*="auth"] { background-color: #1e293b !important; border-color: #334155 !important; }

/* Notes */
html[data-theme="dark"] .note-card { background-color: #1e293b !important; border-color: #334155 !important; color: #e2e8f0 !important; }
html[data-theme="dark"] .note-card:hover { border-color: #38bdf8 !important; }

/* Blog */
html[data-theme="dark"] .blog-card { background-color: #1e293b !important; border-color: #334155 !important; color: #e2e8f0 !important; }

/* Footer */
html[data-theme="dark"] footer { background-color: #0f172a !important; color: #94a3b8 !important; }
html[data-theme="dark"] footer a { color: #94a3b8 !important; }
html[data-theme="dark"] footer a:hover { color: #38bdf8 !important; }

/* Hero */
html[data-theme="dark"] .hero-section { background-color: #0f172a !important; color: #f1f5f9 !important; }

/* Search */
html[data-theme="dark"] .search-result-item { border-color: #334155 !important; }
html[data-theme="dark"] .search-result-item:hover { background-color: rgba(56, 189, 248, 0.06) !important; }

/* Sidebar */
html[data-theme="dark"] .sidebar { background-color: #0f172a !important; border-right-color: #1e293b !important; }

/* Empty states */
html[data-theme="dark"] .empty-state,
html[data-theme="dark"] [class*="empty"] { background-color: #1e293b !important; color: #94a3b8 !important; }

/* Tooltips */
html[data-theme="dark"] [data-tooltip]::after { background-color: #1e293b !important; color: #f1f5f9 !important; }

/* Badges */
html[data-theme="dark"] .badge { background-color: #334155 !important; color: #e2e8f0 !important; }

/* Brand */
html[data-theme="dark"] .brand-name { color: #ffffff !important; }

/* Logo — dark variant */
html[data-theme="dark"] img.logo-svg,
html[data-theme="dark"] .mobile-header-logo img {
  content: url('/static/logo/logo-dark.svg');
}

/* Primary bg */
html[data-theme="dark"] .bg-primary\/10,
html[data-theme="dark"] [class*="bg-primary"] { background-color: rgba(56, 189, 248, 0.15) !important; color: #38bdf8 !important; }


/* ============================================
   3. MANUAL LIGHT MODE (user explicitly picked light)
   Forces light mode even when OS prefers dark.
   Uses html[data-theme="light"] for maximum specificity.
   ============================================ */
html[data-theme="light"] {
  color-scheme: light;
}

html[data-theme="light"] body {
  background: #f4f8fb !important;
  color: #0f172a !important;
}

html[data-theme="light"] a:not(.nav-link):not(.dropdown-item):not(.profile-item):not(.sidebar-link):not(.footer-link):not(.home-cta-btn):not(.nav-btn):not(.nt-card-btn):not(.np-plan-btn):not(.np-banner-btn):not(.np-cta-btn):not(.ud-btn-primary):not(.ud-btn-outline):not(.ud-btn-white):not(.ud-btn-glass):not(.ud-submit):not(.ud-empty-btn):not(.ud-quick-a):not(.ncd-btn-primary):not(.ncd-chapter-link):not(.ncd-subchapter-link) { color: #0b6e99 !important; }
html[data-theme="light"] a:not(.nav-link):not(.dropdown-item):not(.profile-item):not(.sidebar-link):not(.footer-link):not(.home-cta-btn):not(.nav-btn):not(.nt-card-btn):not(.np-plan-btn):not(.np-banner-btn):not(.np-cta-btn):not(.ud-btn-primary):not(.ud-btn-outline):not(.ud-btn-white):not(.ud-btn-glass):not(.ud-submit):not(.ud-empty-btn):not(.ud-quick-a):not(.ncd-btn-primary):not(.ncd-chapter-link):not(.ncd-subchapter-link):hover { color: #095b7e !important; }
html[data-theme="light"] h1, html[data-theme="light"] h2, html[data-theme="light"] h3,
html[data-theme="light"] h4, html[data-theme="light"] h5, html[data-theme="light"] h6 {
  color: #0f172a !important;
}

/* Backgrounds - reset to light */
html[data-theme="light"] .bg-white { background-color: #ffffff !important; }
html[data-theme="light"] .bg-gray-50 { background-color: #f9fafb !important; }
html[data-theme="light"] .bg-gray-100 { background-color: #f3f4f6 !important; }
html[data-theme="light"] .bg-gray-200 { background-color: #e5e7eb !important; }
html[data-theme="light"] .bg-gray-300 { background-color: #d1d5db !important; }
html[data-theme="light"] .bg-gray-400 { background-color: #9ca3af !important; }
html[data-theme="light"] .bg-blue-50 { background-color: #eff6ff !important; }
html[data-theme="light"] .bg-blue-100 { background-color: #dbeafe !important; }
html[data-theme="light"] .bg-green-50 { background-color: #f0fdf4 !important; }
html[data-theme="light"] .bg-green-100 { background-color: #dcfce7 !important; }
html[data-theme="light"] .bg-red-50 { background-color: #fef2f2 !important; }
html[data-theme="light"] .bg-red-100 { background-color: #fee2e2 !important; }
html[data-theme="light"] .bg-yellow-50 { background-color: #fefce8 !important; }
html[data-theme="light"] .bg-yellow-100 { background-color: #fef9c3 !important; }
html[data-theme="light"] .bg-amber-50 { background-color: #fffbeb !important; }
html[data-theme="light"] .bg-amber-100 { background-color: #fef3c7 !important; }
html[data-theme="light"] .bg-orange-50 { background-color: #fff7ed !important; }
html[data-theme="light"] .bg-orange-100 { background-color: #ffedd5 !important; }
html[data-theme="light"] .bg-purple-50 { background-color: #faf5ff !important; }
html[data-theme="light"] .bg-purple-100 { background-color: #f3e8ff !important; }
html[data-theme="light"] .bg-indigo-50 { background-color: #eef2ff !important; }
html[data-theme="light"] .bg-indigo-100 { background-color: #e0e7ff !important; }
html[data-theme="light"] .bg-teal-50 { background-color: #f0fdfa !important; }
html[data-theme="light"] .bg-teal-100 { background-color: #ccfbf1 !important; }
html[data-theme="light"] .bg-cyan-50 { background-color: #ecfeff !important; }
html[data-theme="light"] .bg-cyan-100 { background-color: #cffafe !important; }
html[data-theme="light"] .bg-slate-50 { background-color: #f8fafc !important; }
html[data-theme="light"] .bg-slate-100 { background-color: #f1f5f9 !important; }
html[data-theme="light"] .bg-slate-200 { background-color: #e2e8f0 !important; }
html[data-theme="light"] .bg-slate-300 { background-color: #cbd5e1 !important; }
html[data-theme="light"] .bg-slate-700 { background-color: #334155 !important; }
html[data-theme="light"] .bg-slate-800 { background-color: #1e293b !important; }
html[data-theme="light"] .bg-slate-900 { background-color: #0f172a !important; }

/* Text - reset to light defaults */
html[data-theme="light"] .text-gray-600 { color: #4b5563 !important; }
html[data-theme="light"] .text-gray-700 { color: #374151 !important; }
html[data-theme="light"] .text-gray-800 { color: #1f2937 !important; }
html[data-theme="light"] .text-gray-900 { color: #111827 !important; }
html[data-theme="light"] .text-black { color: #000000 !important; }

/* Forms - reset to light */
html[data-theme="light"] input[type="text"],
html[data-theme="light"] input[type="email"],
html[data-theme="light"] input[type="password"],
html[data-theme="light"] input[type="number"],
html[data-theme="light"] input[type="search"],
html[data-theme="light"] input[type="url"],
html[data-theme="light"] input[type="date"],
html[data-theme="light"] input[type="tel"],
html[data-theme="light"] textarea,
html[data-theme="light"] select {
  background-color: #ffffff !important;
  border-color: #d1d5db !important;
  color: #0f172a !important;
}

html[data-theme="light"] input:focus,
html[data-theme="light"] textarea:focus,
html[data-theme="light"] select:focus {
  border-color: #0b6e99 !important;
  box-shadow: 0 0 0 3px rgba(11, 110, 153, 0.15) !important;
}

html[data-theme="light"] label { color: #374151 !important; }

/* Tables */
html[data-theme="light"] table { color: #0f172a !important; }
html[data-theme="light"] th { background-color: #f9fafb !important; color: #0f172a !important; }
html[data-theme="light"] td { border-color: #e5e7eb !important; }
html[data-theme="light"] tr:nth-child(even) { background-color: #f9fafb !important; }

/* Code */
html[data-theme="light"] pre { background-color: #f3f4f6 !important; color: #0f172a !important; }
html[data-theme="light"] code { background-color: #f3f4f6 !important; color: #db2777 !important; }
html[data-theme="light"] pre code { background-color: transparent !important; color: #0f172a !important; }

/* Scrollbar */
html[data-theme="light"] ::-webkit-scrollbar-track { background: #f1f5f9 !important; }
html[data-theme="light"] ::-webkit-scrollbar-thumb { background: #0b6e99 !important; }
html[data-theme="light"] ::-webkit-scrollbar-thumb:hover { background: #095b7e !important; }

/* Footer - always dark background */
html[data-theme="light"] footer { background-color: #0f172a !important; color: #94a3b8 !important; }
html[data-theme="light"] footer a { color: #94a3b8 !important; }
html[data-theme="light"] footer a:hover { color: #38bdf8 !important; }

/* Django messages - force light */
html[data-theme="light"] #django-messages .bg-blue-100 { background: #dbeafe !important; color: #1e40af !important; }
html[data-theme="light"] #django-messages .bg-green-100 { background: #dcfce7 !important; color: #166534 !important; }
html[data-theme="light"] #django-messages .bg-yellow-100 { background: #fef9c3 !important; color: #854d0e !important; }
html[data-theme="light"] #django-messages .bg-red-100 { background: #fee2e2 !important; color: #991b1b !important; }

/* Errorlist */
html[data-theme="light"] .errorlist > li { color: #dc2626 !important; }

/* ===== CARDS - force light ===== */
html[data-theme="light"] .note-card { background-color: #ffffff !important; border-color: #d2e4ef !important; color: #0f172a !important; }
html[data-theme="light"] .note-card:hover { border-color: #0b6e99 !important; }
html[data-theme="light"] .blog-card { background-color: #ffffff !important; border-color: #d2e4ef !important; color: #0f172a !important; }
html[data-theme="light"] .nbd-card,
html[data-theme="light"] .nbd-article-shell,
html[data-theme="light"] .nbd-related-card,
html[data-theme="light"] .nbd-card-title { background-color: #ffffff !important; color: #0f172a !important; border-color: #d2e4ef !important; }
html[data-theme="light"] .pricing-card,
html[data-theme="light"] [class*="pricing"] { background-color: #ffffff !important; border-color: #d2e4ef !important; }
html[data-theme="light"] .dashboard-card,
html[data-theme="light"] [class*="dashboard"] { background-color: #ffffff !important; border-color: #d2e4ef !important; }
html[data-theme="light"] .auth-card,
html[data-theme="light"] [class*="login"],
html[data-theme="light"] [class*="register"],
html[data-theme="light"] [class*="auth"] { background-color: #ffffff !important; border-color: #d2e4ef !important; }
html[data-theme="light"] .quiz-option,
html[data-theme="light"] .mcq-option { background-color: #ffffff !important; border-color: #d1d5db !important; color: #0f172a !important; }
html[data-theme="light"] .quiz-option:active,
html[data-theme="light"] .mcq-option:active { border-color: #0b6e99 !important; background-color: rgba(11, 110, 153, 0.05) !important; }
html[data-theme="light"] .quiz-option.selected,
html[data-theme="light"] .mcq-option.selected { border-color: #0b6e99 !important; background-color: rgba(11, 110, 153, 0.08) !important; }
html[data-theme="light"] .empty-state { background-color: #ffffff !important; color: #4b5563 !important; }
html[data-theme="light"] .hero-section { background-color: transparent !important; color: #0f172a !important; }
html[data-theme="light"] .search-result-item { border-color: #e5e7eb !important; }
html[data-theme="light"] .search-result-item:hover { background-color: rgba(11, 110, 153, 0.04) !important; }
html[data-theme="light"] .sidebar { background-color: #ffffff !important; border-right-color: #d2e4ef !important; }
html[data-theme="light"] .badge { background-color: #f3f4f6 !important; color: #0f172a !important; }
html[data-theme="light"] .in-article-ad { background-color: #f9fafb !important; border-color: #e5e7eb !important; }
html[data-theme="light"] .brand-name { color: #0f172a !important; }

/* Logo — revert to original light variant */
html[data-theme="light"] img.logo-svg,
html[data-theme="light"] .mobile-header-logo img {
  content: url('/static/logo/logo.svg');
}

/* Prose - force light */
html[data-theme="light"] .prose { color: #0f172a !important; }
html[data-theme="light"] .prose h1, html[data-theme="light"] .prose h2, html[data-theme="light"] .prose h3,
html[data-theme="light"] .prose h4, html[data-theme="light"] .prose h5, html[data-theme="light"] .prose h6 { color: #0f172a !important; }
html[data-theme="light"] .prose a { color: #0b6e99 !important; }
html[data-theme="light"] .prose strong { color: #0f172a !important; }
html[data-theme="light"] .prose code { background-color: #f3f4f6 !important; color: #db2777 !important; }
html[data-theme="light"] .prose pre { background-color: #f3f4f6 !important; }
html[data-theme="light"] .prose blockquote { border-left-color: #d1d5db !important; color: #4b5563 !important; }
html[data-theme="light"] .prose hr { border-color: #e5e7eb !important; }
html[data-theme="light"] .prose td, html[data-theme="light"] .prose th { border-color: #e5e7eb !important; }

/* Gradients - let browser render naturally */
html[data-theme="light"] .bg-gradient-to-br { background-color: transparent !important; }
html[data-theme="light"] .bg-gradient-to-r { background-color: transparent !important; }

/* Shadows - light defaults */
html[data-theme="light"] .shadow,
html[data-theme="light"] .shadow-sm,
html[data-theme="light"] .shadow-md,
html[data-theme="light"] .shadow-lg,
html[data-theme="light"] .shadow-xl,
html[data-theme="light"] .shadow-2xl { box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1) !important; }

/* Tooltip */
html[data-theme="light"] [data-tooltip]::after { background-color: #ffffff !important; color: #0f172a !important; border: 1px solid #e5e7eb !important; }

/* Primary bg */
html[data-theme="light"] .bg-primary\/10,
html[data-theme="light"] [class*="bg-primary"] { background-color: rgba(11, 110, 153, 0.1) !important; color: #0b6e99 !important; }

/* CTA section */
html[data-theme="light"] .home-cta {
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent)) !important;
  border: none !important;
}
html[data-theme="light"] .home-cta h2 { color: white !important; }
html[data-theme="light"] .home-cta p { color: rgba(255,255,255,0.92) !important; opacity: 1 !important; }
html[data-theme="light"] .home-cta-btn { background: white !important; color: #0b6e99 !important; }
html[data-theme="light"] .home-cta-btn:hover { box-shadow: 0 10px 30px rgba(0,0,0,0.15) !important; }

/* Note page specific */
html[data-theme="light"] .nn-class-card { background-color: #ffffff !important; border-color: #d2e4ef !important; color: #0f172a !important; }
html[data-theme="light"] .nn-class-card:hover { border-color: #0b6e99 !important; }
html[data-theme="light"] .nn-subject-card { background-color: #ffffff !important; border-color: #d2e4ef !important; color: #0f172a !important; }
html[data-theme="light"] .nn-subject-card:hover { border-color: #0b6e99 !important; }
html[data-theme="light"] .PrakashNotes-note-page { background: transparent !important; }

/* Dropdown menu */
html[data-theme="light"] .dropdown-menu { background: #ffffff !important; }
html[data-theme="light"] .dropdown-item { color: #4b5563 !important; }
html[data-theme="light"] .dropdown-item:hover { background: rgba(11, 110, 153, 0.08) !important; color: #0b6e99 !important; }
html[data-theme="light"] .dropdown-item svg { color: #4b5563 !important; }
html[data-theme="light"] .dropdown-item:hover svg { color: #0b6e99 !important; }
html[data-theme="light"] .dropdown-note-title { color: #4b5563 !important; }
html[data-theme="light"] .dropdown-note-subtitle { color: #4b5563 !important; }

/* Profile */
html[data-theme="light"] .profile-btn { background: #ffffff !important; border-color: #d2e4ef !important; }
html[data-theme="light"] .profile-dropdown { background: #ffffff !important; border-color: #d2e4ef !important; }
html[data-theme="light"] .profile-item { color: #0f172a !important; }
html[data-theme="light"] .profile-item:hover { background: rgba(11, 110, 153, 0.08) !important; color: #0b6e99 !important; }

/* Icon button */
html[data-theme="light"] .icon-btn { background: #ffffff !important; border-color: #d2e4ef !important; color: #0f172a !important; }
html[data-theme="light"] .icon-btn:hover { border-color: #0b6e99 !important; color: #0b6e99 !important; }
