/* ============================================================
   DigInto — site-wide DARK theme (owner, 2026-09-27: "keep the dark colour of the home page").
   Loaded by _Layout after bootstrap + site.css, together with <html data-bs-theme="dark">
   (Bootstrap 5.3's own dark mode handles cards, tables, forms, dropdowns, modals, alerts).
   This file only maps everything onto the homepage palette (future.css):
     bg #070d1a · bg-2 #0b1526 · panel #0f1a30 · panel-2 #13203a · ink #f1f5f9 · soft #9fb0c9 · accent #fb923c
   To switch the whole site back to light: remove data-bs-theme="dark" and the site-dark.css link in _Layout.
   ============================================================ */

/* ---- 1. Bootstrap tokens → homepage palette ---- */
[data-bs-theme="dark"] {
  --bs-body-bg: #070d1a;               --bs-body-bg-rgb: 7,13,26;
  --bs-body-color: #cbd5e1;            --bs-body-color-rgb: 203,213,225;
  --bs-emphasis-color: #f1f5f9;        --bs-emphasis-color-rgb: 241,245,249;
  --bs-heading-color: #f1f5f9;
  --bs-secondary-color: #9fb0c9;       --bs-secondary-color-rgb: 159,176,201;
  --bs-secondary-bg: #0f1a30;          --bs-secondary-bg-rgb: 15,26,48;
  --bs-tertiary-bg: #0b1526;           --bs-tertiary-bg-rgb: 11,21,38;
  --bs-border-color: rgba(148,163,184,.18);
  --bs-border-color-translucent: rgba(148,163,184,.14);
  --bs-primary: #fb923c;               --bs-primary-rgb: 251,146,60;
  --bs-primary-text-emphasis: #fdba74;
  --bs-primary-bg-subtle: rgba(251,146,60,.14);
  --bs-primary-border-subtle: rgba(251,146,60,.4);
  --bs-link-color: #fb923c;            --bs-link-color-rgb: 251,146,60;
  --bs-link-hover-color: #fdba74;      --bs-link-hover-color-rgb: 253,186,116;
  --bs-code-color: #fdba74;

  /* ---- 2. Site variables (site.css) → dark ---- */
  --dt-primary: #fb923c;  --dt-primary-hover: #fdba74;  --dt-primary-active: #ea580c;
  --dt-primary-light: rgba(251,146,60,.14);  --dt-primary-muted: rgba(251,146,60,.14);  --dt-primary-glow: rgba(251,146,60,.22);
  --dt-blue-light: rgba(56,189,248,.14);
  --dt-orange: #fb923c;   --dt-orange-light: rgba(251,146,60,.14);
  --dt-amber-light: rgba(251,191,36,.14);
  --dt-red-light: rgba(248,113,113,.14);
  --dt-navy: #070d1a;     --dt-navy-mid: #0b1526;
  --dt-dark: #0b1526;     --dt-dark-2: #13203a;
  --dt-surface: #0b1526;  --dt-surface-2: #0f1a30;  --dt-surface-3: #13203a;
  --dt-white: #0f1a30;
  --dt-text: #f1f5f9;     --dt-text-muted: #9fb0c9;  --dt-text-sub: #6f7c96;
  --dt-border: rgba(148,163,184,.14);  --dt-border-dark: rgba(148,163,184,.14);
}

/* Same dot grid as the homepage */
[data-bs-theme="dark"] body {
  background: #070d1a radial-gradient(rgba(148,163,184,.07) 1px, transparent 1px) 0 0 / 26px 26px;
  color: #cbd5e1;
}
[data-bs-theme="dark"] h1, [data-bs-theme="dark"] h2, [data-bs-theme="dark"] h3,
[data-bs-theme="dark"] h4, [data-bs-theme="dark"] h5, [data-bs-theme="dark"] h6 { color: #f1f5f9; }

/* ---- 3. Components ---- */
[data-bs-theme="dark"] .card { --bs-card-bg: #0f1a30; --bs-card-cap-bg: #13203a; --bs-card-border-color: rgba(148,163,184,.18); }
[data-bs-theme="dark"] .table { --bs-table-bg: transparent; --bs-table-striped-bg: rgba(148,163,184,.05); --bs-table-hover-bg: rgba(148,163,184,.08); }
[data-bs-theme="dark"] .table-light { --bs-table-bg: #13203a; --bs-table-color: #f1f5f9; --bs-table-border-color: rgba(148,163,184,.18); }
[data-bs-theme="dark"] .form-control, [data-bs-theme="dark"] .form-select { background-color: #0b1526; border-color: rgba(148,163,184,.26); color: #f1f5f9; }
[data-bs-theme="dark"] .form-control:focus, [data-bs-theme="dark"] .form-select:focus { border-color: #fb923c; box-shadow: 0 0 0 .2rem rgba(251,146,60,.2); }
[data-bs-theme="dark"] .dropdown-menu { --bs-dropdown-bg: #0f1a30; --bs-dropdown-border-color: rgba(148,163,184,.2); }
[data-bs-theme="dark"] .modal-content { background: #0f1a30; }
[data-bs-theme="dark"] .text-muted { color: #9fb0c9 !important; }
[data-bs-theme="dark"] .text-secondary { color: #9fb0c9 !important; }
[data-bs-theme="dark"] .border, [data-bs-theme="dark"] .border-top, [data-bs-theme="dark"] .border-bottom { border-color: rgba(148,163,184,.16) !important; }

/* Buttons: primary = homepage orange */
[data-bs-theme="dark"] .btn-primary {
  --bs-btn-color: #1a0d02; --bs-btn-bg: #fb923c; --bs-btn-border-color: #fb923c;
  --bs-btn-hover-color: #1a0d02; --bs-btn-hover-bg: #fdba74; --bs-btn-hover-border-color: #fdba74;
  --bs-btn-active-color: #1a0d02; --bs-btn-active-bg: #ea580c; --bs-btn-active-border-color: #ea580c;
  --bs-btn-disabled-color: #1a0d02; --bs-btn-disabled-bg: #fb923c; --bs-btn-disabled-border-color: #fb923c;
  color: #1a0d02 !important; background: linear-gradient(180deg,#fb923c,#ea580c); border: none;
}
[data-bs-theme="dark"] .btn-primary:hover { background: linear-gradient(180deg,#fdba74,#fb923c); }
[data-bs-theme="dark"] .btn-outline-primary { --bs-btn-color: #fb923c; --bs-btn-border-color: #fb923c; --bs-btn-hover-bg: #fb923c; --bs-btn-hover-border-color: #fb923c; --bs-btn-hover-color: #1a0d02; }
/* "dark" buttons were dark-on-light; on a dark page they become light outline buttons */
[data-bs-theme="dark"] .btn-outline-dark { --bs-btn-color: #e2e8f0; --bs-btn-border-color: rgba(148,163,184,.4); --bs-btn-hover-color: #1a0d02; --bs-btn-hover-bg: #fb923c; --bs-btn-hover-border-color: #fb923c; }
[data-bs-theme="dark"] .btn-light { --bs-btn-color: #f1f5f9; --bs-btn-bg: #13203a; --bs-btn-border-color: rgba(148,163,184,.26); --bs-btn-hover-bg: #1a2a4a; --bs-btn-hover-color: #fff; }

/* ---- 4. Bootstrap light utilities used across the views ---- */
[data-bs-theme="dark"] .bg-white { background-color: #0f1a30 !important; }
[data-bs-theme="dark"] .bg-light { background-color: #0b1526 !important; }
[data-bs-theme="dark"] .bg-body { background-color: #070d1a !important; }
[data-bs-theme="dark"] .bg-dark { background-color: #0b1526 !important; }
[data-bs-theme="dark"] .text-dark, [data-bs-theme="dark"] .text-black { color: #f1f5f9 !important; }
[data-bs-theme="dark"] .link-dark { color: #f1f5f9 !important; }

/* ---- 5. Colours typed directly into views (style="…") ---- */
/* white / near-white section and card backgrounds → panels */
[data-bs-theme="dark"] [style*="background:#fff;"], [data-bs-theme="dark"] [style*="background: #fff;"],
[data-bs-theme="dark"] [style$="background:#fff"],  [data-bs-theme="dark"] [style*="background:#ffffff"],
[data-bs-theme="dark"] [style*="background:white"], [data-bs-theme="dark"] [style*="background: white"],
[data-bs-theme="dark"] [style*="background:#f9fafb"], [data-bs-theme="dark"] [style*="background:#f1f5f9"],
[data-bs-theme="dark"] [style*="background: #f1f5f9"] { background: #0f1a30 !important; }
[data-bs-theme="dark"] [style*="background:#f8fafc"], [data-bs-theme="dark"] [style*="background: #f8fafc"],
[data-bs-theme="dark"] [style*="background:#f8f9fa"], [data-bs-theme="dark"] [style*="background: #f8f9fa"],
[data-bs-theme="dark"] [style*="background:var(--dt-surface)"] { background: #0b1526 !important; }
[data-bs-theme="dark"] [style*="background:#e2e8f0"] { background: #13203a !important; }
/* dark text meant for light backgrounds → light text */
[data-bs-theme="dark"] [style*="color:#111827"], [data-bs-theme="dark"] [style*="color: #111827"],
[data-bs-theme="dark"] [style*="color:#0f172a"], [data-bs-theme="dark"] [style*="color: #0f172a"] { color: #f1f5f9 !important; }

/* pastel badges / tiles → soft tint of the same colour with bright text (like the homepage badges) */
[data-bs-theme="dark"] [style*="#dcfce7"], [data-bs-theme="dark"] [style*="#f0fdf4"] { background: rgba(52,211,153,.14) !important; color: #6ee7b7 !important; }
[data-bs-theme="dark"] [style*="#fef3c7"], [data-bs-theme="dark"] [style*="#fff7ed"], [data-bs-theme="dark"] [style*="#ffedd5"] { background: rgba(251,191,36,.13) !important; color: #fcd34d !important; }
[data-bs-theme="dark"] [style*="#ede9fe"] { background: rgba(167,139,250,.15) !important; color: #c4b5fd !important; }
[data-bs-theme="dark"] [style*="#fee2e2"] { background: rgba(248,113,113,.14) !important; color: #fca5a5 !important; }
[data-bs-theme="dark"] [style*="#e0f2fe"], [data-bs-theme="dark"] [style*="#eff6ff"] { background: rgba(56,189,248,.13) !important; color: #7dd3fc !important; }

/* ---- 6. Site pieces that assumed a light page ---- */
[data-bs-theme="dark"] .dt-admin-nav { background: #0b1526; border-color: rgba(148,163,184,.14); }
[data-bs-theme="dark"] .dt-navbar { background: rgba(7,13,26,.92) !important; border-bottom: 1px solid rgba(148,163,184,.14); }
[data-bs-theme="dark"] .dt-footer { background: #070d1a; border-top: 1px solid rgba(148,163,184,.14); }
[data-bs-theme="dark"] hr { border-color: rgba(148,163,184,.2); opacity: 1; }
[data-bs-theme="dark"] ::selection { background: rgba(251,146,60,.35); color: #fff; }

/* Exception: Google / Microsoft sign-in buttons stay white (provider brand buttons) */
[data-bs-theme="dark"] [style*="background:#fff;color:#1f2937"] { background: #fff !important; }

/* ---- 7. GNSS Tutorials pages (their own <style> blocks in Views/Tutorials) ---- */
[data-bs-theme="dark"] .tut-page, [data-bs-theme="dark"] .live-tut-page { background: transparent; }
[data-bs-theme="dark"] .topic-card, [data-bs-theme="dark"] .path-card, [data-bs-theme="dark"] .chart-card,
[data-bs-theme="dark"] .controls-bar { background: #0f1a30; border-color: rgba(148,163,184,.18); }
[data-bs-theme="dark"] .lesson-row { background: #0b1526; border-color: rgba(148,163,184,.14); }
[data-bs-theme="dark"] .lesson-row:hover { background: #13203a; border-color: rgba(251,146,60,.45); }
[data-bs-theme="dark"] .lesson-title { color: #f1f5f9; }
[data-bs-theme="dark"] .lesson-time, [data-bs-theme="dark"] .lesson-code, [data-bs-theme="dark"] .lesson-arrow { color: #9fb0c9; }
[data-bs-theme="dark"] .badge-soon { background: #13203a; color: #9fb0c9; }
[data-bs-theme="dark"] .pill-beginner     { background: rgba(52,211,153,.14); color: #6ee7b7; }
[data-bs-theme="dark"] .pill-intermediate { background: rgba(251,191,36,.13); color: #fcd34d; }
[data-bs-theme="dark"] .pill-advanced     { background: rgba(248,113,113,.14); color: #fca5a5; }
[data-bs-theme="dark"] .prereq-badge { background: rgba(251,191,36,.13); color: #fcd34d; }
[data-bs-theme="dark"] .filter-btn { background: #0f1a30; border-color: rgba(148,163,184,.26); color: #cbd5e1; }
[data-bs-theme="dark"] .filter-btn:hover, [data-bs-theme="dark"] .filter-btn.active { background: #fb923c; border-color: #fb923c; color: #1a0d02; }
[data-bs-theme="dark"] .edu-panel p { color: #cbd5e1; }
[data-bs-theme="dark"] .edu-panel h6 { color: #c4b5fd; }
/* lesson / article body text */
[data-bs-theme="dark"] .tutorial-content, [data-bs-theme="dark"] .tutorial-content strong { color: #dbe3ee; }
[data-bs-theme="dark"] .tutorial-content h2, [data-bs-theme="dark"] .tutorial-content h3 { color: #f1f5f9; }
[data-bs-theme="dark"] .tutorial-content code { background: #13203a; border-color: rgba(148,163,184,.2); color: #fdba74; }
[data-bs-theme="dark"] .tutorial-content .tut-table th { background: #13203a; color: #f1f5f9; border-color: rgba(148,163,184,.2); }
[data-bs-theme="dark"] .tutorial-content .tut-table td { color: #cbd5e1; border-color: rgba(148,163,184,.2); }

/* "dark" buttons on a dark page → the homepage's ghost button */
[data-bs-theme="dark"] .btn-dark {
  --bs-btn-color: #f1f5f9; --bs-btn-bg: rgba(15,26,48,.6); --bs-btn-border-color: rgba(148,163,184,.4);
  --bs-btn-hover-color: #fb923c; --bs-btn-hover-bg: rgba(15,26,48,.8); --bs-btn-hover-border-color: #fb923c;
  --bs-btn-active-bg: #13203a; --bs-btn-active-border-color: #fb923c; --bs-btn-active-color: #fb923c;
}
[data-bs-theme="dark"] .tutorial-content .tut-table tr:nth-child(even) td { background: rgba(148,163,184,.06); }
[data-bs-theme="dark"] .tutorial-content .callout      { background: rgba(56,189,248,.10); color: #bae6fd; }
[data-bs-theme="dark"] .tutorial-content .callout-warn { background: rgba(251,191,36,.10); color: #fde68a; }
[data-bs-theme="dark"] .tutorial-content blockquote    { color: #b6c3d6; }
/* near-black heading colour typed into Tutorials/Index */
[data-bs-theme="dark"] [style*="color:#212529"], [data-bs-theme="dark"] [style*="color: #212529"] { color: #f1f5f9 !important; }
/* light gradient panels (Tutorials "New to GNSS?" strip, Live tutorial edu panel) */
[data-bs-theme="dark"] .start-here-banner { background: linear-gradient(135deg, rgba(56,189,248,.12), rgba(56,189,248,.05)); border-color: rgba(56,189,248,.35); color: #cbd5e1; }
[data-bs-theme="dark"] .start-here-banner [style*="color:#1d4ed8"] { color: #7dd3fc !important; }
[data-bs-theme="dark"] .edu-panel { background: linear-gradient(135deg, rgba(167,139,250,.12), rgba(167,139,250,.04)); border-color: rgba(167,139,250,.3); }
