/* ==========================================================================
   ExamCare.org - Complete Dark Mode & Light Mode Design System
   Variables, Surface Hierarchy, Navigation, CBT Simulator & UI Components
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Theme Variables & Surface Definitions
   -------------------------------------------------------------------------- */
:root,
[data-theme="light"] {
  --ec-theme-mode: light;
  --ec-bg-page: #F8F9FA;
  --ec-bg-surface: #FFFFFF;
  --ec-bg-elevated: #FFFFFF;
  --ec-bg-light: #F8F9FA;
  --ec-dark: #212529;
  --ec-dark-title: #0f172a;
  --ec-dark-muted: #64748b;
  --ec-dark-light: #94a3b8;
  --ec-border: #e2e8f0;
  --ec-border-light: #f1f5f9;
  --ec-shadow-card: 0 2px 8px rgba(15, 23, 42, 0.06);
  --ec-shadow-card-hover: 0 8px 20px rgba(15, 23, 42, 0.12);
  --ec-primary: #2563eb;
  --ec-primary-hover: #1d4ed8;
  --ec-primary-active: #1e40af;
  --ec-primary-light: rgba(37, 99, 235, 0.08);
  --ec-primary-tint: rgba(37, 99, 235, 0.14);
  --ec-accent-yellow: #f59e0b;
  --ec-header-bg: #FFFFFF;
  --ec-header-border: #e2e8f0;
  --ec-footer-bg: #0b1329;
  --ec-input-bg: #FFFFFF;
  --ec-input-border: #cbd5e1;
  --ec-input-text: #0f172a;

  /* CBT Tokens */
  --cbt-bg: #f8fafc;
  --cbt-surface: #ffffff;
  --cbt-border: #e2e8f0;
  --cbt-navy: #0b1f44;
  --cbt-text: #1e293b;
  --cbt-text-muted: #64748b;
  --cbt-opt-bg: #ffffff;
  --cbt-opt-border: #e2e8f0;
  --cbt-opt-hover: #f1f5f9;
  --cbt-opt-selected-bg: #eff6ff;
  --cbt-opt-selected-border: #2563eb;
}

[data-theme="dark"],
.dark-theme {
  --ec-theme-mode: dark;
  /* Deep Navy & Charcoal Surfaces (Comfortable, high-contrast, zero pitch-black glare) */
  --ec-bg-page: #0f172a;       /* Slate 900 */
  --ec-bg-surface: #1e293b;    /* Slate 800 */
  --ec-bg-elevated: #334155;   /* Slate 700 */
  --ec-bg-light: #0f172a;
  --ec-dark: #f8fafc;          /* Slate 50 */
  --ec-dark-title: #ffffff;
  --ec-dark-muted: #94a3b8;     /* Slate 400 */
  --ec-dark-light: #64748b;     /* Slate 500 */
  --ec-border: #334155;        /* Slate 700 */
  --ec-border-light: #1e293b;
  --ec-shadow-card: 0 4px 14px rgba(0, 0, 0, 0.35);
  --ec-shadow-card-hover: 0 8px 24px rgba(0, 0, 0, 0.5);
  --ec-primary: #38bdf8;        /* Sky 400 - high contrast on dark */
  --ec-primary-hover: #60a5fa;  /* Blue 400 */
  --ec-primary-active: #2563eb;
  --ec-primary-light: rgba(56, 189, 248, 0.14);
  --ec-primary-tint: rgba(56, 189, 248, 0.22);
  --ec-accent-yellow: #fde047;
  --ec-header-bg: #1e293b;
  --ec-header-border: #334155;
  --ec-footer-bg: #090d16;
  --ec-input-bg: #0f172a;
  --ec-input-border: #334155;
  --ec-input-text: #f8fafc;

  /* CBT Tokens */
  --cbt-bg: #0f172a;
  --cbt-surface: #1e293b;
  --cbt-border: #334155;
  --cbt-navy: #f8fafc;
  --cbt-text: #f8fafc;
  --cbt-text-muted: #94a3b8;
  --cbt-opt-bg: #172033;
  --cbt-opt-border: #334155;
  --cbt-opt-hover: #233044;
  --cbt-opt-selected-bg: rgba(56, 189, 248, 0.18);
  --cbt-opt-selected-border: #38bdf8;
}

/* --------------------------------------------------------------------------
   2. Global Typography & Core Resets in Dark Mode
   -------------------------------------------------------------------------- */
[data-theme="dark"],
[data-theme="dark"] body,
.dark-theme,
.dark-theme body {
  background-color: #0f172a !important;
  color: #f8fafc !important;
}

[data-theme="dark"] h1, [data-theme="dark"] h2, [data-theme="dark"] h3,
[data-theme="dark"] h4, [data-theme="dark"] h5, [data-theme="dark"] h6,
.dark-theme h1, .dark-theme h2, .dark-theme h3,
.dark-theme h4, .dark-theme h5, .dark-theme h6 {
  color: #f8fafc !important;
}

[data-theme="dark"] p,
[data-theme="dark"] span:not([class*="badge"]):not([class*="tag"]):not([class*="icon"]):not(.cep-logo span),
[data-theme="dark"] li,
.dark-theme p,
.dark-theme span:not([class*="badge"]):not([class*="tag"]):not([class*="icon"]):not(.cep-logo span),
.dark-theme li {
  color: inherit;
}

[data-theme="dark"] a:not([class*="btn"]):not([class*="badge"]):not(.cep-logo):not(.cep-nav-links a):not(.cep-trend-link),
.dark-theme a:not([class*="btn"]):not([class*="badge"]):not(.cep-logo):not(.cep-nav-links a):not(.cep-trend-link) {
  color: #38bdf8;
}

[data-theme="dark"] a:not([class*="btn"]):hover,
.dark-theme a:not([class*="btn"]):hover {
  color: #60a5fa;
}

/* --------------------------------------------------------------------------
   3. Theme Switcher Component Styles (Desktop & Mobile)
   -------------------------------------------------------------------------- */
.ec-theme-switcher {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.ec-theme-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1.5px solid var(--ec-border);
  background: var(--ec-bg-page);
  color: var(--ec-dark);
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
  outline: none;
}

.ec-theme-btn:hover,
.ec-theme-btn:focus-visible {
  border-color: var(--ec-primary);
  background: var(--ec-primary-light);
  color: var(--ec-primary);
}

.ec-theme-btn .ec-theme-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Theme Dropdown */
.ec-theme-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 170px;
  background: var(--ec-bg-surface);
  border: 1px solid var(--ec-border);
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
  padding: 6px;
  display: none;
  flex-direction: column;
  gap: 2px;
  z-index: 1000;
  animation: ecDropdownIn 0.15s ease-out forwards;
}

.ec-theme-dropdown.active {
  display: flex;
}

@keyframes ecDropdownIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.ec-theme-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 12px;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--ec-dark);
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.ec-theme-opt:hover,
.ec-theme-opt:focus-visible {
  background: var(--ec-primary-light);
  color: var(--ec-primary);
}

.ec-theme-opt .ec-theme-check {
  margin-left: auto;
  opacity: 0;
  color: var(--ec-primary);
}

.ec-theme-opt.active {
  background: var(--ec-primary-light);
  color: var(--ec-primary);
}

.ec-theme-opt.active .ec-theme-check {
  opacity: 1;
}

/* Mobile Drawer Segmented Theme Control */
.ec-drawer-theme-box {
  padding: 16px;
  margin: 12px 14px 16px;
  background: var(--ec-bg-surface);
  border: 1px solid var(--ec-border);
  border-radius: 12px;
}

.ec-drawer-theme-title {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--ec-dark-muted);
  margin-bottom: 10px;
}

.ec-segmented-theme {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  background: var(--ec-bg-page);
  padding: 4px;
  border-radius: 8px;
  border: 1px solid var(--ec-border);
}

.ec-seg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ec-dark-muted);
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.ec-seg-btn svg {
  flex-shrink: 0;
}

.ec-seg-btn.active {
  background: var(--ec-primary);
  color: #ffffff !important;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(46, 129, 247, 0.35);
}

/* --------------------------------------------------------------------------
   4. Header & Navigation in Dark Mode (Desktop, Mobile & Sticky)
   -------------------------------------------------------------------------- */
[data-theme="dark"] .cep-navbar,
[data-theme="dark"] header.cep-navbar,
[data-theme="dark"] .examcare-header,
[data-theme="dark"] .examcare-header-sticky,
.dark-theme .cep-navbar,
.dark-theme header.cep-navbar,
.dark-theme .examcare-header,
.dark-theme .examcare-header-sticky {
  background: #1e293b !important;
  background-color: #1e293b !important;
  border-bottom: 1px solid #334155 !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25) !important;
}

[data-theme="dark"] .cep-topbar,
[data-theme="dark"] .cep-topbar-wrap,
[data-theme="dark"] .examcare-topbar,
.dark-theme .cep-topbar,
.dark-theme .cep-topbar-wrap,
.dark-theme .examcare-topbar {
  background: #090d16 !important;
  background-color: #090d16 !important;
  border-bottom: 1px solid #1e293b !important;
}

[data-theme="dark"] .cep-logo,
[data-theme="dark"] .examcare-brand-title,
.dark-theme .cep-logo,
.dark-theme .examcare-brand-title {
  color: #f8fafc !important;
}

[data-theme="dark"] .cep-logo span,
[data-theme="dark"] .examcare-brand-tld,
.dark-theme .cep-logo span,
.dark-theme .examcare-brand-tld {
  color: #38bdf8 !important;
}

[data-theme="dark"] .cep-trend-link,
.dark-theme .cep-trend-link {
  color: #94a3b8 !important;
}

[data-theme="dark"] .cep-trend-link:hover,
.dark-theme .cep-trend-link:hover {
  color: #38bdf8 !important;
}

[data-theme="dark"] .cep-nav-links a,
[data-theme="dark"] .examcare-nav-link,
.dark-theme .cep-nav-links a,
.dark-theme .examcare-nav-link {
  color: #f8fafc !important;
}

[data-theme="dark"] .cep-nav-links a:hover,
[data-theme="dark"] .cep-nav-links a.active,
[data-theme="dark"] .examcare-nav-link:hover,
[data-theme="dark"] .examcare-nav-link.active,
.dark-theme .cep-nav-links a:hover,
.dark-theme .cep-nav-links a.active,
.dark-theme .examcare-nav-link:hover,
.dark-theme .examcare-nav-link.active {
  color: #38bdf8 !important;
  background: rgba(56, 189, 248, 0.12) !important;
}

/* Search Box Desktop */
[data-theme="dark"] .cep-nav-search,
[data-theme="dark"] .cep-search-input,
[data-theme="dark"] .examcare-search-input,
.dark-theme .cep-nav-search,
.dark-theme .cep-search-input,
.dark-theme .examcare-search-input {
  background-color: #0f172a !important;
  color: #f8fafc !important;
  border-color: #334155 !important;
}

[data-theme="dark"] .cep-search-icon,
.dark-theme .cep-search-icon {
  color: #94a3b8 !important;
}

[data-theme="dark"] .cep-search-dropdown,
[data-theme="dark"] .examcare-search-dropdown,
.dark-theme .cep-search-dropdown,
.dark-theme .examcare-search-dropdown {
  background-color: #1e293b !important;
  border-color: #334155 !important;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5) !important;
}

[data-theme="dark"] .search-drop-item,
[data-theme="dark"] .cep-search-dropdown a,
.dark-theme .search-drop-item,
.dark-theme .cep-search-dropdown a {
  border-bottom-color: #334155 !important;
  color: #f8fafc !important;
}

[data-theme="dark"] .search-drop-item:hover,
[data-theme="dark"] .cep-search-dropdown a:hover,
.dark-theme .search-drop-item:hover,
.dark-theme .cep-search-dropdown a:hover {
  background: #334155 !important;
}

/* Mobile Bottom Bar & Mobile Drawer */
[data-theme="dark"] .cep-mob-bottom-bar,
[data-theme="dark"] .cep-mob-bottom-appbar,
.dark-theme .cep-mob-bottom-bar,
.dark-theme .cep-mob-bottom-appbar {
  background: #1e293b !important;
  background-color: #1e293b !important;
  border-top: 1px solid #334155 !important;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.3) !important;
}

[data-theme="dark"] .cep-mob-bottom-bar a,
.dark-theme .cep-mob-bottom-bar a {
  color: #94a3b8 !important;
}

[data-theme="dark"] .cep-mob-bottom-bar a.active,
.dark-theme .cep-mob-bottom-bar a.active {
  color: #38bdf8 !important;
}

[data-theme="dark"] .cep-mob-drawer,
[data-theme="dark"] .examcare-mobile-drawer,
.dark-theme .cep-mob-drawer,
.dark-theme .examcare-mobile-drawer {
  background: #1e293b !important;
  background-color: #1e293b !important;
  color: #f8fafc !important;
  border-right: 1px solid #334155 !important;
}

[data-theme="dark"] .cep-mob-drawer-header,
[data-theme="dark"] .drawer-header,
.dark-theme .cep-mob-drawer-header,
.dark-theme .drawer-header {
  background: #0f172a !important;
  border-bottom: 1px solid #334155 !important;
}

[data-theme="dark"] .cep-mob-drawer-links a,
.dark-theme .cep-mob-drawer-links a {
  color: #f8fafc !important;
  border-bottom: 1px solid #334155 !important;
}

[data-theme="dark"] .cep-mob-drawer-links a:hover,
.dark-theme .cep-mob-drawer-links a:hover {
  background: #334155 !important;
  color: #38bdf8 !important;
}

[data-theme="dark"] .cep-mob-search-btn,
[data-theme="dark"] .cep-mob-toggle,
[data-theme="dark"] .mobile-hamburger-btn,
.dark-theme .cep-mob-search-btn,
.dark-theme .cep-mob-toggle,
.dark-theme .mobile-hamburger-btn {
  background: #0f172a !important;
  color: #f8fafc !important;
  border: 1px solid #334155 !important;
}

/* --------------------------------------------------------------------------
   5. Hero, Section Headers & Hub Navigation in Dark Mode
   -------------------------------------------------------------------------- */
[data-theme="dark"] .cep-hero,
[data-theme="dark"] .cep-blog-hero,
[data-theme="dark"] .pyq-hero,
[data-theme="dark"] .ts-details-hero,
.dark-theme .cep-hero,
.dark-theme .cep-blog-hero,
.dark-theme .pyq-hero,
.dark-theme .ts-details-hero {
  background: #0b1329 !important;
  border-bottom: 1px solid #334155 !important;
}

[data-theme="dark"] .cep-sec,
.dark-theme .cep-sec {
  background: transparent !important;
}

[data-theme="dark"] .cep-sec-title,
[data-theme="dark"] .ts-heading,
[data-theme="dark"] .exam-dir-title,
.dark-theme .cep-sec-title,
.dark-theme .ts-heading,
.dark-theme .exam-dir-title {
  color: #f8fafc !important;
}

[data-theme="dark"] .cep-sec-sub,
[data-theme="dark"] .exam-dir-desc,
[data-theme="dark"] .ts-dir-desc,
.dark-theme .cep-sec-sub,
.dark-theme .exam-dir-desc,
.dark-theme .ts-dir-desc {
  color: #94a3b8 !important;
}

[data-theme="dark"] .hub-subnav,
[data-theme="dark"] .hub-subnav-sticky,
.dark-theme .hub-subnav,
.dark-theme .hub-subnav-sticky {
  background: #1e293b !important;
  border-bottom: 1px solid #334155 !important;
}

/* --------------------------------------------------------------------------
   6. Cards & Grids in Dark Mode (All Exam, Series, PYQ & Blog Cards)
   -------------------------------------------------------------------------- */
[data-theme="dark"] .cat-card,
[data-theme="dark"] .exam-dir-card,
[data-theme="dark"] .cep-featured-card,
[data-theme="dark"] .cep-post-card,
[data-theme="dark"] .series-card,
[data-theme="dark"] .series-item-card,
[data-theme="dark"] .ts-test-card,
[data-theme="dark"] .pyq-card,
[data-theme="dark"] .pyq-card-box,
[data-theme="dark"] .pyq-item-card,
[data-theme="dark"] .dash-kpi-card,
[data-theme="dark"] .exam-tag-card,
[data-theme="dark"] .cep-takeaways-box,
[data-theme="dark"] .cep-pass-widget,
[data-theme="dark"] .cep-gate-card,
.dark-theme .cat-card,
.dark-theme .exam-dir-card,
.dark-theme .cep-featured-card,
.dark-theme .cep-post-card,
.dark-theme .series-card,
.dark-theme .series-item-card,
.dark-theme .ts-test-card,
.dark-theme .pyq-card,
.dark-theme .pyq-card-box,
.dark-theme .pyq-item-card,
.dark-theme .dash-kpi-card,
.dark-theme .exam-tag-card,
.dark-theme .cep-takeaways-box,
.dark-theme .cep-pass-widget,
.dark-theme .cep-gate-card {
  background-color: #1e293b !important;
  background: #1e293b !important;
  border: 1px solid #334155 !important;
  color: #f8fafc !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35) !important;
}

[data-theme="dark"] .cat-card:hover,
[data-theme="dark"] .exam-dir-card:hover,
[data-theme="dark"] .series-card:hover,
[data-theme="dark"] .ts-test-card:hover,
[data-theme="dark"] .pyq-card:hover,
.dark-theme .cat-card:hover,
.dark-theme .exam-dir-card:hover,
.dark-theme .series-card:hover,
.dark-theme .ts-test-card:hover,
.dark-theme .pyq-card:hover {
  border-color: #38bdf8 !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45) !important;
}

[data-theme="dark"] .cat-card-name,
[data-theme="dark"] .exam-card-title,
[data-theme="dark"] .ts-card-title,
[data-theme="dark"] .pyq-title,
[data-theme="dark"] .cep-featured-title,
[data-theme="dark"] .cep-post-title,
.dark-theme .cat-card-name,
.dark-theme .exam-card-title,
.dark-theme .ts-card-title,
.dark-theme .pyq-title,
.dark-theme .cep-featured-title,
.dark-theme .cep-post-title {
  color: #f8fafc !important;
}

[data-theme="dark"] .cat-card-desc,
[data-theme="dark"] .exam-card-desc,
[data-theme="dark"] .ts-card-desc,
[data-theme="dark"] .cep-featured-excerpt,
[data-theme="dark"] .cep-post-excerpt,
[data-theme="dark"] .pyq-info-sub,
.dark-theme .cat-card-desc,
.dark-theme .exam-card-desc,
.dark-theme .ts-card-desc,
.dark-theme .cep-featured-excerpt,
.dark-theme .cep-post-excerpt,
.dark-theme .pyq-info-sub {
  color: #94a3b8 !important;
}

[data-theme="dark"] .cat-card-count,
[data-theme="dark"] .exam-card-body-meta,
[data-theme="dark"] .ts-card-meta,
[data-theme="dark"] .pyq-meta,
[data-theme="dark"] .cep-post-footer,
.dark-theme .cat-card-count,
.dark-theme .exam-card-body-meta,
.dark-theme .ts-card-meta,
.dark-theme .pyq-meta,
.dark-theme .cep-post-footer {
  color: #cbd5e1 !important;
  border-top-color: #334155 !important;
}

/* --------------------------------------------------------------------------
   7. Category Chips, State Pills & Tabs in Dark Mode
   -------------------------------------------------------------------------- */
[data-theme="dark"] .cat-pill,
[data-theme="dark"] .cat-tab-btn,
[data-theme="dark"] .exam-pill-btn,
[data-theme="dark"] .ts-pill-btn,
[data-theme="dark"] .cep-cat-tab,
.dark-theme .cat-pill,
.dark-theme .cat-tab-btn,
.dark-theme .exam-pill-btn,
.dark-theme .ts-pill-btn,
.dark-theme .cep-cat-tab {
  background: #1e293b !important;
  background-color: #1e293b !important;
  border: 1px solid #334155 !important;
  color: #cbd5e1 !important;
}

[data-theme="dark"] .cat-pill:hover,
[data-theme="dark"] .cat-tab-btn:hover,
[data-theme="dark"] .exam-pill-btn:hover,
[data-theme="dark"] .ts-pill-btn:hover,
[data-theme="dark"] .cep-cat-tab:hover,
.dark-theme .cat-pill:hover,
.dark-theme .cat-tab-btn:hover,
.dark-theme .exam-pill-btn:hover,
.dark-theme .ts-pill-btn:hover,
.dark-theme .cep-cat-tab:hover {
  background: #334155 !important;
  border-color: #38bdf8 !important;
  color: #ffffff !important;
}

[data-theme="dark"] .cat-pill.active,
[data-theme="dark"] .cat-tab-btn.active,
[data-theme="dark"] .exam-pill-btn.active,
[data-theme="dark"] .ts-pill-btn.active,
[data-theme="dark"] .cep-cat-tab.active,
.dark-theme .cat-pill.active,
.dark-theme .cat-tab-btn.active,
.dark-theme .exam-pill-btn.active,
.dark-theme .ts-pill-btn.active,
.dark-theme .cep-cat-tab.active {
  background: #38bdf8 !important;
  background-color: #38bdf8 !important;
  color: #0f172a !important;
  font-weight: 700 !important;
  border-color: #38bdf8 !important;
}

/* --------------------------------------------------------------------------
   8. Tables, Specifications & Dashboard in Dark Mode
   -------------------------------------------------------------------------- */
[data-theme="dark"] table,
[data-theme="dark"] .dash-table,
[data-theme="dark"] .pyq-table,
.dark-theme table,
.dark-theme .dash-table,
.dark-theme .pyq-table {
  background-color: #1e293b !important;
  border-color: #334155 !important;
}

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

[data-theme="dark"] td,
.dark-theme td {
  background-color: #1e293b !important;
  color: #cbd5e1 !important;
  border-color: #334155 !important;
}

[data-theme="dark"] tr:nth-child(even) td,
.dark-theme tr:nth-child(even) td {
  background-color: #172033 !important;
}

[data-theme="dark"] .dash-kpi-val,
.dark-theme .dash-kpi-val {
  color: #38bdf8 !important;
}

[data-theme="dark"] .dash-kpi-label,
.dark-theme .dash-kpi-label {
  color: #94a3b8 !important;
}

/* --------------------------------------------------------------------------
   9. Form Controls, Search Inputs & Modals in Dark Mode
   -------------------------------------------------------------------------- */
[data-theme="dark"] input[type="text"],
[data-theme="dark"] input[type="email"],
[data-theme="dark"] input[type="password"],
[data-theme="dark"] input[type="search"],
[data-theme="dark"] input[type="tel"],
[data-theme="dark"] select,
[data-theme="dark"] textarea,
.dark-theme input[type="text"],
.dark-theme input[type="email"],
.dark-theme input[type="password"],
.dark-theme input[type="search"],
.dark-theme input[type="tel"],
.dark-theme select,
.dark-theme textarea {
  background-color: #0f172a !important;
  color: #f8fafc !important;
  border: 1.5px solid #334155 !important;
}

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

[data-theme="dark"] .cep-modal-card,
[data-theme="dark"] .cep-modal-body,
[data-theme="dark"] .auth-modal-card,
.dark-theme .cep-modal-card,
.dark-theme .cep-modal-body,
.dark-theme .auth-modal-card {
  background-color: #1e293b !important;
  border: 1px solid #334155 !important;
  color: #f8fafc !important;
}

/* --------------------------------------------------------------------------
   10. CBT Simulator & Mock Test Interface in Dark Mode
   -------------------------------------------------------------------------- */
[data-theme="dark"] .cbt-header,
.dark-theme .cbt-header {
  background-color: #1e293b !important;
  background: #1e293b !important;
  border-bottom: 1.5px solid #334155 !important;
}

[data-theme="dark"] .cbt-test-name,
.dark-theme .cbt-test-name {
  color: #f8fafc !important;
}

[data-theme="dark"] .cbt-timer,
[data-theme="dark"] .cbt-timer-box,
.dark-theme .cbt-timer,
.dark-theme .cbt-timer-box {
  background-color: #0f172a !important;
  color: #38bdf8 !important;
  border-color: #334155 !important;
}

[data-theme="dark"] .cbt-sec-bar,
.dark-theme .cbt-sec-bar {
  background-color: #172033 !important;
  border-bottom-color: #334155 !important;
}

[data-theme="dark"] .cbt-sec-tab,
.dark-theme .cbt-sec-tab {
  background-color: #0f172a !important;
  color: #94a3b8 !important;
  border-color: #334155 !important;
}

[data-theme="dark"] .cbt-sec-tab.active,
.dark-theme .cbt-sec-tab.active {
  background-color: #38bdf8 !important;
  color: #0f172a !important;
  font-weight: 800 !important;
}

[data-theme="dark"] .cbt-q-col,
[data-theme="dark"] .cbt-q-container,
.dark-theme .cbt-q-col,
.dark-theme .cbt-q-container {
  background-color: #1e293b !important;
  border-color: #334155 !important;
}

[data-theme="dark"] .cbt-q-header,
.dark-theme .cbt-q-header {
  background-color: #172033 !important;
  border-bottom-color: #334155 !important;
  color: #f8fafc !important;
}

/* Question Stem & Text */
[data-theme="dark"] #qStem,
[data-theme="dark"] .q-stem,
[data-theme="dark"] .cep-q-text,
.dark-theme #qStem,
.dark-theme .q-stem,
.dark-theme .cep-q-text {
  color: #f8fafc !important;
}

/* Diagrams and uploaded question images: White backing for transparent physics/math diagrams */
[data-theme="dark"] #qStem img,
[data-theme="dark"] .q-stem img,
[data-theme="dark"] .q-opt-text img,
.dark-theme #qStem img,
.dark-theme .q-stem img,
.dark-theme .q-opt-text img {
  background-color: #ffffff !important;
  padding: 6px !important;
  border-radius: 8px !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4) !important;
}

/* Question Options */
[data-theme="dark"] .q-opt-label,
.dark-theme .q-opt-label {
  background-color: #172033 !important;
  border-color: #334155 !important;
}

[data-theme="dark"] .q-opt-label:hover,
.dark-theme .q-opt-label:hover {
  background-color: #233044 !important;
  border-color: #475569 !important;
}

[data-theme="dark"] .q-opt-label.selected,
.dark-theme .q-opt-label.selected {
  background-color: rgba(56, 189, 248, 0.18) !important;
  border-color: #38bdf8 !important;
  box-shadow: 0 0 0 1px #38bdf8 !important;
}

[data-theme="dark"] .q-opt-text,
.dark-theme .q-opt-text {
  color: #f8fafc !important;
}

[data-theme="dark"] .q-opt-text-bn,
.dark-theme .q-opt-text-bn {
  color: #94a3b8 !important;
}

/* CBT Bottom Bar */
[data-theme="dark"] .cbt-footer-bar,
[data-theme="dark"] .cbt-bottom-bar,
.dark-theme .cbt-footer-bar,
.dark-theme .cbt-bottom-bar {
  background-color: #1e293b !important;
  border-top-color: #334155 !important;
}

[data-theme="dark"] .cbt-btn-secondary,
.dark-theme .cbt-btn-secondary {
  background-color: #0f172a !important;
  color: #cbd5e1 !important;
  border-color: #334155 !important;
}

[data-theme="dark"] .cbt-btn-secondary:hover,
.dark-theme .cbt-btn-secondary:hover {
  background-color: #334155 !important;
  color: #ffffff !important;
}

/* Question Palette Drawer */
[data-theme="dark"] .cbt-palette-drawer,
[data-theme="dark"] .cbt-palette-col,
.dark-theme .cbt-palette-drawer,
.dark-theme .cbt-palette-col {
  background-color: #1e293b !important;
  border-left-color: #334155 !important;
}

/* Palette Question Buttons */
[data-theme="dark"] .palette-btn.s-notvisited,
.dark-theme .palette-btn.s-notvisited {
  background-color: #0f172a !important;
  color: #94a3b8 !important;
  border-color: #334155 !important;
}

[data-theme="dark"] .palette-btn.s-notanswered,
.dark-theme .palette-btn.s-notanswered {
  background-color: rgba(234, 88, 12, 0.22) !important;
  color: #fb923c !important;
  border-color: #ea580c !important;
}

[data-theme="dark"] .palette-btn.s-answered,
.dark-theme .palette-btn.s-answered {
  background-color: rgba(16, 185, 129, 0.22) !important;
  color: #34d399 !important;
  border-color: #10b981 !important;
}

[data-theme="dark"] .palette-btn.s-review,
.dark-theme .palette-btn.s-review {
  background-color: rgba(139, 92, 246, 0.22) !important;
  color: #c084fc !important;
  border-color: #8b5cf6 !important;
}

[data-theme="dark"] .palette-btn.s-ans-review,
.dark-theme .palette-btn.s-ans-review {
  background-color: rgba(139, 92, 246, 0.22) !important;
  color: #c084fc !important;
  border-color: #8b5cf6 !important;
}

/* CBT Pretest & Gate Card */
[data-theme="dark"] .cbt-modal-card,
[data-theme="dark"] .cbt-pretest-card,
.dark-theme .cbt-modal-card,
.dark-theme .cbt-pretest-card {
  background-color: #1e293b !important;
  border-color: #334155 !important;
  color: #f8fafc !important;
}

/* --------------------------------------------------------------------------
   11. Footer & Legal in Dark Mode
   -------------------------------------------------------------------------- */
[data-theme="dark"] .cep-footer,
[data-theme="dark"] .examcare-footer,
.dark-theme .cep-footer,
.dark-theme .examcare-footer {
  background-color: #090d16 !important;
  border-top: 1px solid #1e293b !important;
}

[data-theme="dark"] .cep-footer-bottom,
[data-theme="dark"] .examcare-footer-bottom,
.dark-theme .cep-footer-bottom,
.dark-theme .examcare-footer-bottom {
  border-top-color: #1e293b !important;
  color: #64748b !important;
}
