/*
  Dark mode for every web panel page.

  Active when <html data-theme="dark"> is set. base.html sets it before the
  page paints (from the saved choice, or the device's dark-mode setting) and
  the moon/sun button in the navbar switches it. This file is loaded after
  Bootstrap so its rules win.
*/

html[data-theme="dark"] { color-scheme: dark; background-color: #0f1724; }

html[data-theme="dark"] body {
  background-color: #0f1724;
  color: #dbe4ee;
}

html[data-theme="dark"] a { color: #7cc4ff; }
html[data-theme="dark"] a:hover { color: #a9d8ff; }
html[data-theme="dark"] hr { border-top-color: #2a3a50; }
html[data-theme="dark"] .text-muted { color: #8fa3b8 !important; }

/* navbar */
html[data-theme="dark"] .navbar.bg-dark { background-color: #0a111c !important; border-bottom: 1px solid #1f2d40; }

/* tabs (admin) */
html[data-theme="dark"] .nav-tabs { border-bottom-color: #2a3a50; }
html[data-theme="dark"] .nav-tabs .nav-link:hover { border-color: #2a3a50 #2a3a50 transparent; }
html[data-theme="dark"] .nav-tabs .nav-link.active,
html[data-theme="dark"] .nav-tabs .nav-item.show .nav-link {
  background-color: #16202e;
  border-color: #2a3a50 #2a3a50 #16202e;
  color: #fff;
}

/* tables (passes, admin lists) */
html[data-theme="dark"] .table { color: #dbe4ee; }
html[data-theme="dark"] .table td,
html[data-theme="dark"] .table th,
html[data-theme="dark"] .table thead th { border-color: #2a3a50; }
html[data-theme="dark"] .table-bordered,
html[data-theme="dark"] .table-bordered td,
html[data-theme="dark"] .table-bordered th { border-color: #2a3a50; }
html[data-theme="dark"] .table-striped tbody tr:nth-of-type(odd) { background-color: rgba(255,255,255,0.04); }
html[data-theme="dark"] .table-hover tbody tr:hover { background-color: rgba(255,255,255,0.07); color: #fff; }
html[data-theme="dark"] .table .thead-dark th { background-color: #0a111c; border-color: #2a3a50; }
html[data-theme="dark"] .table .thead-light th { background-color: #1c2a3d; color: #dbe4ee; border-color: #2a3a50; }

/* Passes page (pass_list.css): same colours as the Meteor map */
html[data-theme="dark"] {
  --m23: #f2b33d; --m23-bg: rgba(242,179,61,0.16); --m23-text: #f2b33d;
  --m24: #4fd1c5; --m24-bg: rgba(79,209,197,0.16); --m24-text: #4fd1c5;
  --iss: #a78bfa; --iss-bg: rgba(167,139,250,0.16); --iss-text: #b9a3fb;
  --pl-line: #1f2d40; --pl-dim: #8fa3b8; --pl-faint: #5f7187; --pl-track: #1c2a3d;
  --pl-low: #4a5d74; --pl-hover: #131f30; --pl-card: #0e1826; --rec: #ff6b6b;
}
html[data-theme="dark"] .pass-row.live { background: rgba(255,107,107,0.08); }
html[data-theme="dark"] .st-done { color: #5fd38a; }
html[data-theme="dark"] .state-dot { background: #5fd38a; }
html[data-theme="dark"] .c-dn .fa-sun,
html[data-theme="dark"] .fa-sun.dn { color: #f2c94c; }
html[data-theme="dark"] .btn-icon:hover { color: #ff6b6b; }

/* cards (captures, capture images) */
html[data-theme="dark"] .card,
html[data-theme="dark"] .bg-light,
html[data-theme="dark"] div.card-group.capture-image-cards div.image-card {
  background-color: #16202e !important;
  border-color: #2a3a50 !important;
  color: #dbe4ee;
}
html[data-theme="dark"] .card-title { color: #fff; }

/* modals, alerts, forms */
html[data-theme="dark"] .modal-content { background-color: #16202e; color: #dbe4ee; border-color: #2a3a50; }
html[data-theme="dark"] .modal-header,
html[data-theme="dark"] .modal-footer { border-color: #2a3a50; }
html[data-theme="dark"] .close { color: #dbe4ee; text-shadow: none; opacity: 0.8; }
html[data-theme="dark"] .alert-success { background-color: #12321f; border-color: #1f5434; color: #9be7b4; }
html[data-theme="dark"] .alert-danger { background-color: #3a1518; border-color: #5c2328; color: #f5a3aa; }
html[data-theme="dark"] .alert-warning { background-color: #3a2e10; border-color: #5c4a1a; color: #f2d28b; }
html[data-theme="dark"] .alert-info { background-color: #10303a; border-color: #1a4b5c; color: #9bd9ef; }
html[data-theme="dark"] .form-control,
html[data-theme="dark"] .custom-select {
  background-color: #0f1724;
  border-color: #2a3a50;
  color: #dbe4ee;
}
html[data-theme="dark"] .form-control:focus { background-color: #0f1724; color: #fff; }
html[data-theme="dark"] .tooltip-inner { background-color: #2a3a50; }

/* site.css links that should keep the text colour, not the link blue */
html[data-theme="dark"] a.cap-card, html[data-theme="dark"] a.cap-card:hover,
html[data-theme="dark"] .pager a, html[data-theme="dark"] .pager a:hover,
html[data-theme="dark"] .subnav a.active, html[data-theme="dark"] .subnav a:hover { color: #dbe4ee; }
html[data-theme="dark"] .subnav a, html[data-theme="dark"] .back-link { color: #8fa3b8; }
html[data-theme="dark"] .rec-link { color: #c9d6e3; }

/* language menu */
html[data-theme="dark"] .lang-menu .dropdown-menu { background: #162030; border-color: #2a3a50; }
html[data-theme="dark"] .lang-menu .dropdown-item { color: #dbe4ee; }
html[data-theme="dark"] .lang-menu .dropdown-divider { border-top-color: #2a3a50; }
html[data-theme="dark"] .lang-menu .dropdown-item:hover { background: #1d2b3e; }
html[data-theme="dark"] .lang-menu .dropdown-item.active { background: #2f80ed; color: #fff; }

/* theme toggle button */
#theme-toggle { line-height: 1; padding: 0.3rem 0.5rem; }

/* footer logo: its lettering follows the text colour */
html[data-theme="dark"] footer .lrpt-logo { color: #dbe4ee; }
html[data-theme="dark"] footer .footer-credit, html[data-theme="dark"] footer .footer-credit a { color: #5f7187; }

/* small phones: the navbar has no room for the timezone next to the toggle */
@media (max-width: 575.98px) {
  header span.navbar-text.timezone { display: none; }
  #theme-toggle { margin-right: 0 !important; }
}
html[data-theme="dark"] .sat-info dd.si-good { color: #5fd38a; }
html[data-theme="dark"] .sat-info dd.si-warn { color: #f2b33d; }

/* Meteor and ISS switches (Admin > Passes): the off track */
html[data-theme="dark"] .sw-track { background: #34475f; }
html[data-theme="dark"] .set-jump a { color: var(--pl-dim); }
