/* ============================================
   G7X DEFENSE — Light Mode Theme Override
   Default = Dark (as-is). Light = cream/black/green
   Activated by html.light class
   ============================================ */

/* ===== SMOOTH TRANSITION ===== */
html:not(.no-transition) body,
html:not(.no-transition) nav,
html:not(.no-transition) header,
html:not(.no-transition) footer,
html:not(.no-transition) section,
html:not(.no-transition) div,
html:not(.no-transition) a,
html:not(.no-transition) span,
html:not(.no-transition) p,
html:not(.no-transition) h1,
html:not(.no-transition) h2,
html:not(.no-transition) h3,
html:not(.no-transition) h4,
html:not(.no-transition) h5,
html:not(.no-transition) h6 {
  transition: background-color 0.4s ease, color 0.3s ease, border-color 0.4s ease, box-shadow 0.3s ease;
}

html.no-transition *,
html.no-transition *::before,
html.no-transition *::after {
  transition: none !important;
}

/* ===== LIGHT MODE: BODY ===== */
html.light {
  color-scheme: light;
}

html.light body {
  background-color: #FAF7F0 !important;
  color: #1a2e12 !important;
}

/* ===== BACKGROUNDS → CREAM ===== */
html.light [style*="background"],
html.light [class*="bg-"] {
  /* Let specific rules below override */
}

/* Main dark backgrounds → cream */
html.light body,
html.light main,
html.light [style*="background: rgb(0"],
html.light [style*="background: #0"],
html.light [style*="background:#0"],
html.light [style*="background-color: rgb(0"],
html.light [style*="background: #1"],
html.light [style*="background:#1"] {
  background-color: #FAF7F0 !important;
}

/* Slightly darker sections → warm cream */
html.light section {
  background-color: #FAF7F0 !important;
}

/* ===== NAVIGATION BAR ===== */
html.light nav,
html.light header {
  background-color: #FAF7F0 !important;
  border-bottom: 1px solid #111 !important;
}

html.light nav a,
html.light header a {
  color: #111 !important;
}

html.light nav a:hover,
html.light header a:hover {
  color: #4a7c2e !important;
}

/* ACCESS PORTAL button in nav */
html.light nav a[href*="portal"],
html.light nav a[href*="quotes"],
html.light header a[href*="portal"],
html.light header a[href*="quotes"] {
  border-color: #111 !important;
  color: #111 !important;
}

/* ===== LOGO ===== */
html.light img[alt*="G7X"],
html.light img[alt*="g7x"],
html.light img[alt*="Defense"],
html.light img[alt*="defense"] {
  filter: brightness(0) !important;
}

/* ===== TEXT COLORS → GREEN ===== */
/* Headings - bold green */
html.light h1,
html.light h2,
html.light h3 {
  color: #2a5a18 !important;
}

html.light h4,
html.light h5,
html.light h6 {
  color: #1a3a10 !important;
}

/* Body text */
html.light p,
html.light span,
html.light li,
html.light td,
html.light label,
html.light div {
  color: #1a3a10 !important;
}

/* Links */
html.light a {
  color: #2a5a18 !important;
}

html.light a:hover {
  color: #4a8c2e !important;
}

/* Muted/secondary text */
html.light [class*="text-gray"],
html.light [class*="text-slate"],
html.light [class*="text-zinc"],
html.light [class*="text-neutral"],
html.light [class*="text-muted"] {
  color: #4a6a3a !important;
}

/* White text on dark → green on cream */
html.light [class*="text-white"],
html.light [style*="color: #fff"],
html.light [style*="color:#fff"],
html.light [style*="color: white"],
html.light [style*="color: rgb(255"] {
  color: #1a3a10 !important;
}

/* The lime/green accent color — keep but adjust for light bg */
html.light [style*="color: rgb(200, 230"],
html.light [style*="color: #c8e6"],
html.light [class*="text-lime"],
html.light [class*="text-green"],
html.light [class*="text-yellow-green"] {
  color: #3a7a22 !important;
}

/* ===== HUD ELEMENTS ===== */
/* The military HUD labels (SECTION, STATUS, MODE, SCROLL, CONFIDENTIAL, LIVE FEED) */
html.light [style*="font-family"][style*="JetBrains"],
html.light [class*="mono"],
html.light [class*="tracking-"] {
  color: #2a5a18 !important;
}

/* ===== BORDERS → BLACK ===== */
html.light [style*="border"],
html.light [class*="border"] {
  border-color: #111 !important;
}

/* HUD corner brackets / decorative borders */
html.light [style*="border-color: rgb(200, 230"],
html.light [style*="border-color: #c8e6"] {
  border-color: #111 !important;
}

/* ===== PANELS / CARDS → BLACK BG ===== */
html.light [class*="card"],
html.light [class*="panel"],
html.light [role="dialog"],
html.light [data-radix-popper-content-wrapper] {
  background-color: #111 !important;
  color: #c8e64c !important;
  border: 1px solid #222 !important;
}

html.light [class*="card"] h1,
html.light [class*="card"] h2,
html.light [class*="card"] h3,
html.light [class*="card"] p,
html.light [class*="card"] span,
html.light [class*="panel"] p,
html.light [class*="panel"] span {
  color: #c8e64c !important;
}

/* ===== BUTTONS ===== */
/* Primary buttons → black with green text */
html.light button,
html.light [role="button"] {
  border-color: #111 !important;
}

/* Dark bg buttons → keep dark on light bg */
html.light [class*="bg-black"],
html.light [style*="background: #111"],
html.light [style*="background:#111"],
html.light [style*="background: rgb(17"] {
  background-color: #111 !important;
  color: #c8e64c !important;
}

/* ===== FORM ELEMENTS ===== */
html.light input,
html.light textarea,
html.light select {
  background-color: #F0EBE0 !important;
  color: #1a3a10 !important;
  border: 1px solid #111 !important;
}

html.light input::placeholder,
html.light textarea::placeholder {
  color: #6a8a5a !important;
}

html.light input:focus,
html.light textarea:focus,
html.light select:focus {
  border-color: #2a5a18 !important;
  box-shadow: 0 0 0 2px rgba(42, 90, 24, 0.2) !important;
}

/* ===== SHADOWS ===== */
html.light .shadow-lg,
html.light .shadow-md,
html.light .shadow-sm {
  box-shadow: 0 2px 12px rgba(0,0,0,0.08) !important;
}

/* ===== DIVIDERS ===== */
html.light hr {
  border-color: #111 !important;
}

/* ===== SCROLLBAR ===== */
html.light ::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

html.light ::-webkit-scrollbar-track {
  background: #F0EBE0;
}

html.light ::-webkit-scrollbar-thumb {
  background: #111;
  border-radius: 4px;
}

html.light ::-webkit-scrollbar-thumb:hover {
  background: #333;
}

/* ===== FOOTER ===== */
html.light footer {
  background-color: #111 !important;
  color: #c8e64c !important;
  border-top: 1px solid #111 !important;
}

html.light footer a,
html.light footer p,
html.light footer span,
html.light footer div {
  color: #c8e64c !important;
}

/* ===== 3D / CANVAS — Don't touch ===== */
html.light canvas {
  filter: none !important;
}

/* ===== THE TOGGLE SWITCH ITSELF ===== */
#g7x-theme-switch-wrap {
  position: fixed;
  top: 12px;
  left: 160px;
  z-index: 100000;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: 2px;
  text-transform: uppercase;
}

#g7x-theme-switch-wrap .g7x-switch-label {
  opacity: 0.6;
  user-select: none;
}

#g7x-theme-switch {
  position: relative;
  width: 48px;
  height: 24px;
  border-radius: 12px;
  cursor: pointer;
  border: 1.5px solid;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
}

#g7x-theme-switch .g7x-switch-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
}

#g7x-theme-switch .g7x-switch-knob svg {
  width: 11px;
  height: 11px;
}

/* Dark state (default) */
#g7x-theme-switch {
  background: #1a2a1a;
  border-color: #c8e64c;
}

#g7x-theme-switch .g7x-switch-knob {
  background: #c8e64c;
  left: 2px;
}

#g7x-theme-switch .g7x-switch-knob svg {
  color: #111;
  stroke: #111;
}

#g7x-theme-switch-wrap .g7x-switch-label {
  color: #c8e64c;
}

/* Light state */
html.light #g7x-theme-switch {
  background: #F0EBE0;
  border-color: #111;
}

html.light #g7x-theme-switch .g7x-switch-knob {
  background: #111;
  left: 24px;
}

html.light #g7x-theme-switch .g7x-switch-knob svg {
  color: #FAF7F0;
  stroke: #FAF7F0;
}

html.light #g7x-theme-switch-wrap .g7x-switch-label {
  color: #1a3a10;
}

/* ===== PRINT ===== */
@media print {
  html.light body {
    background-color: white !important;
    color: black !important;
  }
  #g7x-theme-switch-wrap { display: none !important; }
}
