/* Dark mode overrides — applied when html.dark class is present */
html.dark { color-scheme: dark; }
html.dark body { background-color: #0f172a !important; color: #e2e8f0 !important; }

/* Surfaces */
html.dark .bg-white { background-color: #1e293b !important; }
html.dark .bg-gray-50 { background-color: #0f172a !important; }
html.dark .bg-gray-100 { background-color: #334155 !important; }
html.dark .bg-gray-900 { background-color: #020617 !important; }

/* Borders */
html.dark .border-gray-100,
html.dark .border-gray-200,
html.dark .border-gray-300 { border-color: #334155 !important; }
html.dark .border-purple-100 { border-color: rgba(124, 58, 237, 0.35) !important; }
html.dark .border-yellow-200 { border-color: rgba(217, 119, 6, 0.45) !important; }
html.dark .border-red-200 { border-color: rgba(239, 68, 68, 0.45) !important; }
html.dark .divide-gray-200 > * + * { border-color: #334155 !important; }

/* Text */
html.dark .text-gray-400 { color: #94a3b8 !important; }
html.dark .text-gray-500 { color: #94a3b8 !important; }
html.dark .text-gray-600 { color: #cbd5e1 !important; }
html.dark .text-gray-700 { color: #cbd5e1 !important; }
html.dark .text-gray-800 { color: #f1f5f9 !important; }
html.dark .text-brand-textLight { color: #94a3b8 !important; }
html.dark .text-brand-text { color: #e2e8f0 !important; }
html.dark .text-brand-purple { color: #c4b5fd !important; }

/* Colored accent backgrounds — desaturate for dark mode */
html.dark .bg-purple-50 { background-color: rgba(76, 29, 149, 0.25) !important; }
html.dark .bg-purple-100 { background-color: rgba(124, 58, 237, 0.3) !important; color: #ddd6fe !important; }
html.dark .bg-yellow-50 { background-color: rgba(180, 83, 9, 0.2) !important; }
html.dark .bg-yellow-100 { background-color: rgba(217, 119, 6, 0.25) !important; color: #fde68a !important; }
html.dark .bg-red-50 { background-color: rgba(185, 28, 28, 0.2) !important; }
html.dark .bg-red-100 { background-color: rgba(220, 38, 38, 0.25) !important; color: #fecaca !important; }
html.dark .bg-green-50 { background-color: rgba(20, 83, 45, 0.25) !important; }
html.dark .bg-green-100 { background-color: rgba(22, 163, 74, 0.25) !important; color: #bbf7d0 !important; }
html.dark .bg-orange-50 { background-color: rgba(154, 52, 18, 0.2) !important; }
html.dark .from-red-50 { --tw-gradient-from: rgba(185, 28, 28, 0.2) !important; }
html.dark .to-orange-50 { --tw-gradient-to: rgba(154, 52, 18, 0.2) !important; }

/* Strong colored text in dark */
html.dark .text-red-700 { color: #fca5a5 !important; }
html.dark .text-green-700 { color: #86efac !important; }
html.dark .text-amber-700 { color: #fcd34d !important; }
html.dark .text-brand-goldDark { color: #fbbf24 !important; }

/* Footer */
html.dark footer.bg-gray-900 { background-color: #020617 !important; }

/* Form inputs (checkboxes in checklists) */
html.dark input[type="checkbox"] { accent-color: #fbbf24; }

/* Theme-toggle active button uses inline classes; ensure contrast */
html.dark [data-theme-btn].bg-brand-gold { color: #4c1d95 !important; }

/* Subtle smoother transition (avoid jarring flash) */
html, body { transition: background-color 0.2s ease, color 0.2s ease; }
.bg-white, .bg-gray-50, .bg-gray-100 { transition: background-color 0.2s ease; }
