/**
 * Custom dark-theme color overrides layered on top of vendored Bootstrap
 * 5.3.8 (bootstrap.min.css, loaded before this file). Bootstrap's own
 * dark-mode palette lives at the [data-bs-theme=dark] selector — these
 * overrides target the same selector so they win by cascade order (this
 * file must be <link>ed AFTER bootstrap.min.css on every page).
 *
 * Root theme variables here (--bs-body-bg, --bs-border-color, etc.) are
 * picked up automatically by components that reference them at runtime
 * (.form-control, .alert-*, .card, borders, body text). Buttons and
 * nav-tabs do NOT inherit from root variables — Bootstrap bakes literal
 * hex values into .btn-primary/.btn-danger/.btn-success/.btn-secondary and
 * .nav-tabs .nav-link.active at compile time, so those need their own
 * direct --bs-btn-*/--bs-nav-tabs-* overrides below.
 *
 * Palette: blue/green-tinted grays (hue ~195-200°, matching #1ac3ff's own
 * hue of 194°) instead of Bootstrap's neutral near-black dark palette.
 */

[data-bs-theme="dark"] {
  --bs-body-bg: #12181c;
  --bs-body-color: #dde4e7;
  --bs-emphasis-color: #ffffff;
  --bs-secondary-color: #8ea0a8;
  --bs-secondary-bg: #182126;
  --bs-tertiary-color: #6c8189;
  --bs-tertiary-bg: #0d1417;
  --bs-border-color: #2a3a42;
  --bs-border-color-translucent: #2a3a4266;
  --bs-primary: #1ac3ff;
  --bs-primary-rgb: 26, 195, 255;
  --bs-primary-text-emphasis: #7adfff;
  --bs-primary-bg-subtle: #072330;
  --bs-primary-border-subtle: #0d3a4d;
  --bs-danger: #e5484d;
  --bs-danger-rgb: 229, 72, 77;
  --bs-danger-text-emphasis: #f5a3a6;
  --bs-danger-bg-subtle: #2c1214;
  --bs-danger-border-subtle: #4a1f22;
  --bs-success: #3ddc97;
  --bs-success-rgb: 61, 220, 151;
  --bs-success-text-emphasis: #9aecc9;
  --bs-success-bg-subtle: #0e2a20;
  --bs-success-border-subtle: #16452f;
  --bs-link-color: #1ac3ff;
  --bs-link-color-rgb: 26, 195, 255;
  --bs-link-hover-color: #4fd1ff;
  --bs-link-hover-color-rgb: 79, 209, 255;
}

/* .form-control/.form-select default to --bs-body-bg (same as the page) —
   override so inputs read as a distinct, slightly darker surface, matching
   the old design's --input-bg being darker than --card-bg. */
[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
  background-color: var(--bs-tertiary-bg);
}

[data-bs-theme="dark"] .btn-primary {
  --bs-btn-color: #06202b;
  --bs-btn-bg: #1ac3ff;
  --bs-btn-border-color: #1ac3ff;
  --bs-btn-hover-color: #06202b;
  --bs-btn-hover-bg: #4fd1ff;
  --bs-btn-hover-border-color: #4fd1ff;
  --bs-btn-active-color: #06202b;
  --bs-btn-active-bg: #0aa8e0;
  --bs-btn-active-border-color: #0aa8e0;
  --bs-btn-disabled-color: #06202b;
  --bs-btn-disabled-bg: #1ac3ff;
  --bs-btn-disabled-border-color: #1ac3ff;
}

[data-bs-theme="dark"] .btn-danger {
  --bs-btn-bg: #e5484d;
  --bs-btn-border-color: #e5484d;
  --bs-btn-hover-bg: #ea6a6e;
  --bs-btn-hover-border-color: #ea6a6e;
  --bs-btn-active-bg: #c93a3f;
  --bs-btn-active-border-color: #c93a3f;
  --bs-btn-disabled-bg: #e5484d;
  --bs-btn-disabled-border-color: #e5484d;
}

[data-bs-theme="dark"] .btn-success {
  --bs-btn-color: #06231a;
  --bs-btn-bg: #3ddc97;
  --bs-btn-border-color: #3ddc97;
  --bs-btn-hover-color: #06231a;
  --bs-btn-hover-bg: #63e3ab;
  --bs-btn-hover-border-color: #63e3ab;
  --bs-btn-active-color: #06231a;
  --bs-btn-active-bg: #2fc082;
  --bs-btn-active-border-color: #2fc082;
  --bs-btn-disabled-bg: #3ddc97;
  --bs-btn-disabled-border-color: #3ddc97;
}

[data-bs-theme="dark"] .btn-secondary {
  --bs-btn-color: #dde4e7;
  --bs-btn-bg: #2a3a42;
  --bs-btn-border-color: #2a3a42;
  --bs-btn-hover-color: #ffffff;
  --bs-btn-hover-bg: #3a4d57;
  --bs-btn-hover-border-color: #3a4d57;
  --bs-btn-active-color: #ffffff;
  --bs-btn-active-bg: #465e69;
  --bs-btn-active-border-color: #465e69;
}

[data-bs-theme="dark"] .nav-tabs {
  --bs-nav-tabs-border-color: #2a3a42;
  --bs-nav-tabs-link-hover-border-color: #2a3a42 #2a3a42 transparent;
  --bs-nav-tabs-link-active-color: #06202b;
  --bs-nav-tabs-link-active-bg: #1ac3ff;
  --bs-nav-tabs-link-active-border-color: #1ac3ff #1ac3ff #1ac3ff;
}
