/* =========================================================================
   DARK MODE — Nuclear Override
   Uses html.dark-theme selector to beat body { !important } in hillyGo.css
   Since html.dark-theme body has higher specificity than body alone,
   these !important rules WIN over all existing !important rules.
   ========================================================================= */

/* ---------- Smooth transitions on everything ---------- */
html.dark-theme *,
html.dark-theme *::before,
html.dark-theme *::after {
  transition: background-color 0.35s ease, color 0.35s ease,
    border-color 0.35s ease, box-shadow 0.35s ease !important;
}

/* ---------- ROOT background / text ---------- */
html.dark-theme,
html.dark-theme body {
  background-color: #111827 !important;
  color: #E5E7EB !important;
}

/* ---------- Headings ---------- */
html.dark-theme h1,
html.dark-theme h2,
html.dark-theme h3,
html.dark-theme h4,
html.dark-theme h5,
html.dark-theme h6 {
  color: #F9FAFB !important;
}

/* ---------- Paragraphs / spans ---------- */
html.dark-theme p,
html.dark-theme li,
html.dark-theme label {
  color: #D1D5DB !important;
}

/* ---------- Links ---------- */
html.dark-theme a:not(.hg-btn):not(.hg-cta) {
  color: #9CA3AF !important;
}
html.dark-theme a:not(.hg-btn):not(.hg-cta):hover {
  color: #8CB42E !important;
}

/* ======== NAVBAR ======== */
html.dark-theme #hillygo-nav,
html.dark-theme .hg-navbar {
  background-color: #1F2937 !important;
  border-bottom: 1px solid #374151 !important;
  box-shadow: 0 2px 16px rgba(0,0,0,0.5) !important;
}
html.dark-theme .hg-action-link {
  color: #D1D5DB !important;
}
html.dark-theme .hg-action-link:hover {
  color: #8CB42E !important;
  background: rgba(140,180,46,0.12) !important;
}
html.dark-theme .hg-icon-link {
  color: #D1D5DB !important;
}
html.dark-theme .hg-icon-link:hover {
  background: rgba(140,180,46,0.12) !important;
}

/* Navbar dropdowns */
html.dark-theme .hg-dropdown-panel,
html.dark-theme .hg-lang-dropdown {
  background-color: #1F2937 !important;
  border: 1px solid #374151 !important;
  box-shadow: 0 12px 30px rgba(0,0,0,0.6) !important;
}
html.dark-theme .hg-dropdown-item,
html.dark-theme .hg-dropdown-panel a,
html.dark-theme .hg-dropdown-panel button {
  color: #E5E7EB !important;
}
html.dark-theme .hg-dropdown-item:hover,
html.dark-theme .hg-dropdown-panel a:hover,
html.dark-theme .hg-dropdown-panel button:hover {
  background-color: #374151 !important;
  color: #8CB42E !important;
}
html.dark-theme .hg-dropdown-divider {
  border-color: #374151 !important;
}

/* ======== PROMO BAR ======== */
html.dark-theme .promo-bar,
html.dark-theme [class*="promo"] {
  background-color: #374151 !important;
  color: #E5E7EB !important;
}

/* ======== ALL SECTION BACKGROUNDS ======== */
html.dark-theme section,
html.dark-theme .hg-section,
html.dark-theme .bah-section,
html.dark-theme [class*="-section"] {
  background-color: #111827 !important;
}

/* Gray-tinted sections */
html.dark-theme .hg-section--gray,
html.dark-theme .bah-section--gray,
html.dark-theme [class*="section--gray"],
html.dark-theme [class*="section-gray"] {
  background-color: #1F2937 !important;
}

/* ======== CARDS ======== */
html.dark-theme .hg-card,
html.dark-theme .bah-benefit-card,
html.dark-theme .bah-testi-card,
html.dark-theme [class*="-card"] {
  background-color: #1F2937 !important;
  border-color: #374151 !important;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4) !important;
}
html.dark-theme [class*="-title"],
html.dark-theme [class*="-name"] {
  color: #F9FAFB !important;
}
html.dark-theme [class*="-desc"],
html.dark-theme [class*="-text"],
html.dark-theme [class*="-sub"] {
  color: #9CA3AF !important;
}

/* ======== ICON BOXES ======== */
html.dark-theme .bah-benefit-icon,
html.dark-theme [class*="-icon"]:not(i) {
  background-color: #374151 !important;
  border-color: #4B5563 !important;
}

/* ======== HERO / BANNER ======== */
html.dark-theme .hg-hero,
html.dark-theme [class*="hero"] {
  background-color: #111827 !important;
}

/* ======== SEARCH BAR ======== */
html.dark-theme .hg-search-bar,
html.dark-theme [class*="search-bar"],
html.dark-theme [class*="search-pill"] {
  background-color: #1F2937 !important;
  border-color: #374151 !important;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4) !important;
}
html.dark-theme .hg-search-bar input,
html.dark-theme [class*="search"] input {
  background-color: transparent !important;
  color: #F9FAFB !important;
}

/* ======== INPUTS / FORMS ======== */
html.dark-theme input,
html.dark-theme textarea,
html.dark-theme select {
  background-color: #1F2937 !important;
  color: #F9FAFB !important;
  border-color: #374151 !important;
}
html.dark-theme input::placeholder,
html.dark-theme textarea::placeholder {
  color: #6B7280 !important;
}
html.dark-theme input:focus,
html.dark-theme textarea:focus,
html.dark-theme select:focus {
  border-color: #8CB42E !important;
  box-shadow: 0 0 0 3px rgba(140,180,46,0.25) !important;
}

/* ======== FOOTER ======== */
html.dark-theme footer,
html.dark-theme .hg-footer,
html.dark-theme [class*="footer"] {
  background-color: #0D1117 !important;
  border-top: 1px solid #374151 !important;
  color: #9CA3AF !important;
}

/* ======== MODALS / OVERLAYS ======== */
html.dark-theme .hg-modal,
html.dark-theme [class*="modal"],
html.dark-theme [class*="overlay-panel"],
html.dark-theme [class*="sidebar"] {
  background-color: #1F2937 !important;
  border-color: #374151 !important;
}

/* ======== TABS / PILLS ======== */
html.dark-theme [class*="-tab"],
html.dark-theme [class*="-pill"]:not(.hg-search-pill) {
  background-color: #1F2937 !important;
  color: #D1D5DB !important;
  border-color: #374151 !important;
}
html.dark-theme [class*="-tab"].active,
html.dark-theme [class*="-tab"]:hover {
  background-color: #8CB42E !important;
  color: #fff !important;
}

/* ======== DIVIDERS ======== */
html.dark-theme hr {
  border-color: #374151 !important;
}

/* ======== SCROLLBAR ======== */
html.dark-theme ::-webkit-scrollbar-track {
  background: #1F2937 !important;
}
html.dark-theme ::-webkit-scrollbar-thumb {
  background: #4B5563 !important;
}
html.dark-theme ::-webkit-scrollbar-thumb:hover {
  background: #8CB42E !important;
}
