/* ChessDepth Academy - night mode.
   Applied when <html> has the "dark" class (set by the toggle in the header,
   or by the visitor's device setting until they choose). */

/* Theme toggle button (shown in both modes) */
.cd-theme-btn { display: inline-flex; align-items: center; justify-content: center; width: 2.4rem; height: 2.4rem; border-radius: 9999px; border: 1px solid #e5e7eb; color: #4338ca; background: #fff; transition: background .2s, color .2s, border-color .2s; flex-shrink: 0; }
.cd-theme-btn:hover { border-color: #6366f1; }
.cd-theme-btn .cd-moon { display: inline; } .cd-theme-btn .cd-sun { display: none; }
html.dark .cd-theme-btn { background: #1e293b; border-color: #334155; color: #fcd34d; }
html.dark .cd-theme-btn .cd-moon { display: none; } html.dark .cd-theme-btn .cd-sun { display: inline; }

html.dark { color-scheme: dark; }
html.dark body { background-color: #0b1120 !important; color: #cbd5e1; }

/* ---------- Surfaces ---------- */
html.dark .bg-white, html.dark .rs-card, html.dark .ab-card, html.dark .blog-card { background-color: #162032 !important; }
html.dark .bg-gray-50, html.dark .bg-gray-100 { background-color: #0f172a !important; }
html.dark .hover\:bg-gray-50:hover, html.dark .hover\:bg-indigo-50:hover { background-color: #1e293b !important; }
html.dark .bg-gray-700, html.dark .bg-gray-800 { background-color: #020617 !important; }
html.dark .cd-header, html.dark .cd-mobile-menu { background-color: #0f1424 !important; border-color: #222a44; }
html.dark .cd-topbar { background: #080b16; }
html.dark .cd-brand-name, html.dark .cd-mark, html.dark .cd-brand { color: #eef0fa; }
html.dark .cd-brand-sub { color: #9aa0bd; }
html.dark .cd-nav .cd-link, html.dark .cd-mobile-menu nav > a { color: #b9bfd8; }
html.dark .cd-nav .cd-link:hover, html.dark .cd-nav .cd-link[aria-current], html.dark .cd-mobile-menu nav > a[aria-current] { color: #fff; }
html.dark .cd-mobile-menu nav > a { border-color: #222a44; }
html.dark .cd-hdr-cta { background: #e9dcc4; color: #1f2547; }
html.dark .cd-hdr-cta:hover { background: #f3ead8; color: #1f2547; }
html.dark .cd-mobile-login { border-color: #b9bfd8; color: #eef0fa; }
html.dark .cd-menu-btn { color: #eef0fa; }
html.dark .shadow, html.dark .shadow-sm, html.dark .shadow-md, html.dark .shadow-lg, html.dark .shadow-xl,
html.dark .rs-card, html.dark .ab-card, html.dark .blog-card { box-shadow: 0 1px 3px rgba(0,0,0,.5) !important; }

/* Light tinted panels -> dark tints */
html.dark .bg-indigo-50, html.dark .bg-indigo-100 { background-color: rgba(99,102,241,.14) !important; }
html.dark .bg-purple-50, html.dark .bg-purple-100 { background-color: rgba(168,85,247,.14) !important; }
html.dark .bg-green-100 { background-color: rgba(34,197,94,.15) !important; }
html.dark .bg-yellow-50, html.dark .bg-yellow-100 { background-color: rgba(234,179,8,.13) !important; }
html.dark .bg-red-100 { background-color: rgba(239,68,68,.15) !important; }
html.dark .bg-blue-100 { background-color: rgba(59,130,246,.15) !important; }
html.dark .bg-pink-100 { background-color: rgba(236,72,153,.15) !important; }
html.dark .bg-teal-100 { background-color: rgba(20,184,166,.15) !important; }
html.dark .bg-orange-100 { background-color: rgba(249,115,22,.15) !important; }

/* ---------- Text ---------- */
html.dark .text-gray-900, html.dark .text-gray-800 { color: #f1f5f9 !important; }
html.dark .text-gray-700 { color: #cbd5e1 !important; }
html.dark .text-gray-600 { color: #a8b3c4 !important; }
html.dark .text-gray-500, html.dark .text-gray-400 { color: #8a96a8 !important; }
html.dark .text-indigo-900, html.dark .text-indigo-800, html.dark .text-indigo-700, html.dark .text-indigo-600 { color: #a5b4fc !important; }
html.dark .text-indigo-500 { color: #818cf8 !important; }
html.dark .text-purple-900, html.dark .text-purple-800, html.dark .text-purple-700, html.dark .text-purple-600 { color: #d8b4fe !important; }
html.dark .text-green-800, html.dark .text-green-700, html.dark .text-green-600 { color: #86efac !important; }
html.dark .text-yellow-900, html.dark .text-yellow-800, html.dark .text-yellow-700, html.dark .text-yellow-600 { color: #fde68a !important; }
html.dark .text-red-800, html.dark .text-red-600 { color: #fca5a5 !important; }
html.dark .text-blue-800, html.dark .text-blue-700, html.dark .text-blue-600 { color: #93c5fd !important; }
html.dark .text-pink-800, html.dark .text-pink-700 { color: #f9a8d4 !important; }
html.dark .text-teal-800, html.dark .text-teal-700 { color: #5eead4 !important; }
html.dark .text-orange-800, html.dark .text-orange-700, html.dark .text-orange-600 { color: #fdba74 !important; }
html.dark .hover\:text-indigo-600:hover, html.dark .hover\:text-indigo-800:hover, html.dark .hover\:text-gray-800:hover { color: #c7d2fe !important; }
/* Keep white text white on coloured buttons and banners */
html.dark .text-white { color: #fff !important; }

/* ---------- Borders ---------- */
html.dark .border, html.dark .border-t, html.dark .border-b, html.dark .border-gray-100, html.dark .border-gray-300,
html.dark .border-indigo-100, html.dark .border-indigo-200, html.dark .border-purple-100, html.dark .border-yellow-200,
html.dark .divide-gray-100 > * + * { border-color: #273449 !important; }
html.dark hr { border-color: #273449; }

/* ---------- Forms ---------- */
html.dark input:not([type=checkbox]):not([type=radio]), html.dark select, html.dark textarea {
  background-color: #0b1120 !important; color: #e2e8f0 !important; border-color: #334155 !important; }
html.dark input::placeholder, html.dark textarea::placeholder { color: #64748b; }

/* ---------- Shared components ---------- */
html.dark .cd-login-btn { border-color: #818cf8; color: #c7d2fe; }
html.dark .cd-login-btn:hover, html.dark .cd-login-btn.cd-active-btn { background: #4f46e5; color: #fff; }
html.dark .cd-footer { background-color: #020617 !important; }
html.dark .cd-form-msg.error { background: rgba(239,68,68,.12); color: #fecaca; }
html.dark .cd-form-msg.success { background: rgba(34,197,94,.12); color: #bbf7d0; }

/* Resources page */
html.dark .rs-subnav { background: rgba(15,23,42,.96); box-shadow: 0 1px 0 #1e293b; }
html.dark .rs-subnav a { color: #a8b3c4; }
html.dark .rs-subnav a:hover, html.dark .rs-subnav a.is-current { color: #c7d2fe; }
html.dark .rs-eyebrow, html.dark .ab-eyebrow { color: #a5b4fc; }
html.dark .rs-list { color: #a8b3c4; }
html.dark .rs-focus { background: rgba(99,102,241,.16); color: #c7d2fe; }
html.dark .rs-chip { background: rgba(99,102,241,.18); color: #c7d2fe; }
html.dark .rs-chip-gray { background: #273449; color: #cbd5e1; }
html.dark .rs-tab, html.dark .blog-filter { background: #162032; border-color: #3b4a6b; color: #c7d2fe; }
html.dark .rs-tab.is-active, html.dark .rs-tab:hover, html.dark .blog-filter.is-active, html.dark .blog-filter:hover { background: #4f46e5; border-color: #4f46e5; color: #fff; }
html.dark .rs-btn { background: #162032; border-color: #334155; color: #e2e8f0; }
html.dark .rs-btn:hover { border-color: #818cf8; color: #c7d2fe; }
html.dark .rs-btn-primary { background: #4f46e5; border-color: #4f46e5; color: #fff; }
html.dark .rs-check { color: #cbd5e1; }
html.dark .rs-stat { background: rgba(99,102,241,.14); }
html.dark .rs-bar { background: #273449; }
html.dark table thead { background: rgba(99,102,241,.14) !important; color: #c7d2fe !important; }
html.dark #analysis-results a.border { border-color: #273449 !important; }
html.dark #analysis-results a.border:hover { border-color: #6366f1 !important; }

/* About page */
html.dark .ab-step:not(:last-child):after { background: #3b4a6b; }

/* Blog articles */
html.dark .cd-prose { color: #cbd5e1; }
html.dark .cd-prose h2, html.dark .cd-prose h3, html.dark .cd-prose strong { color: #f1f5f9; }
html.dark .cd-prose a { color: #a5b4fc; }
html.dark .cd-prose blockquote { background: rgba(99,102,241,.14); color: #e0e7ff; }
html.dark .cd-prose th { background: rgba(99,102,241,.16); color: #c7d2fe; }
html.dark .cd-prose td { border-color: #273449; }
html.dark .cd-board figcaption { color: #a8b3c4; }
html.dark .cd-answer { background: rgba(34,197,94,.1); border-color: rgba(34,197,94,.35); }
html.dark .cd-answer summary { color: #86efac; }
html.dark .blog-share { border-color: #334155; color: #cbd5e1; }
html.dark .blog-share:hover { border-color: #818cf8; color: #c7d2fe; }

/* Course cards, pricing, misc older page styles */
html.dark .course-card-hover:hover, html.dark .blog-card:hover { box-shadow: 0 12px 24px -8px rgba(0,0,0,.7) !important; }
html.dark img.rounded-full { border-color: #334155; }

/* Smooth switch (skipped for people who prefer less motion) */
@media (prefers-reduced-motion: no-preference) {
  html.cd-theme-anim body, html.cd-theme-anim body * { transition: background-color .25s ease, color .25s ease, border-color .25s ease !important; }
}
html.dark .cd-topbar .cd-theme-btn { background: transparent; border-color: rgba(255,255,255,.18); color: #e9dcc4; }
html.dark .cd-soon { color: #e9dcc4; border-color: #b08a4e; }
