/* StarCraft: Brood War themed overrides for the BWAPI guide */
/* Scope all overrides under .sc-theme to avoid leaking into other pages */

:root {
  --sc-bg: #071813;            /* deep space (green hue) */
  --sc-bg-2: #0a1f19;          /* panel base */
  --sc-panel: #071a15;         /* panel gradient end */
  --sc-surface: #0c1f19;       /* nav/sidebar */
  --sc-primary: #22ff99;       /* neon holo green */
  --sc-primary-700: #0fbf7a;   /* darker green */
  --sc-accent: #c8ff54;        /* lime accent */
  --sc-danger: #ff5757;        /* alert red */
  --sc-ring: rgba(34, 255, 153, 0.25);
  --sc-text: #e6fff4;
  --sc-text-muted: #9de2c5;
}

.sc-theme {
  color: var(--sc-text);
  background:
    radial-gradient(1200px 600px at 70% -10%, rgba(34, 255, 153, 0.12) 0%, transparent 60%) no-repeat,
    radial-gradient(900px 400px at 10% 110%, rgba(34, 255, 153, 0.10) 0%, transparent 70%) no-repeat,
    var(--sc-bg);
}

/* Page-specific background: Battlecruiser backdrop with green tint for readability */
.sc-theme.sc-bc-bg {
  background:
    radial-gradient(1200px 600px at 70% -10%, rgba(34, 255, 153, 0.10) 0%, transparent 60%) no-repeat,
    radial-gradient(900px 400px at 10% 110%, rgba(34, 255, 153, 0.08) 0%, transparent 70%) no-repeat,
    linear-gradient(180deg, rgba(5, 20, 17, 0.85), rgba(5, 20, 17, 0.92)),
    linear-gradient(180deg, rgba(8, 32, 22, 0.45), rgba(8, 32, 22, 0.45)),
    url('../images/starcraft-bc-bg.jpg') center / cover fixed no-repeat,
    var(--sc-bg);
}

/* Ensure all major containers inherit light text on dark UI */
.sc-theme main,
.sc-theme section,
.sc-theme header,
.sc-theme nav,
.sc-theme #main-nav,
.sc-theme .bg-white {
  color: var(--sc-text);
}

/* Normalize common Tailwind text utilities to themed colors on dark */
.sc-theme .text-black,
.sc-theme .text-gray-900,
.sc-theme .text-slate-900 { color: var(--sc-text) !important; }
.sc-theme .text-gray-500 { color: var(--sc-text-muted) !important; }

/* Headings default to themed text (can be overridden by .text-primary etc.) */
.sc-theme h1, .sc-theme h2, .sc-theme h3, .sc-theme h4, .sc-theme h5, .sc-theme h6 { color: var(--sc-text); }

/* Header */
.sc-theme header.bg-primary {
  position: relative;
  background: linear-gradient(180deg, #082016 0%, #051411 100%);
  border-bottom: 1px solid rgba(148, 163, 184, 0.20);
  box-shadow: 0 8px 24px -18px rgba(0,0,0,.8), 0 0 0 4px var(--sc-ring);
}
.sc-theme header.bg-primary::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(0deg, rgba(34,255,153,0.08) 0 1px, transparent 1px 8px),
    repeating-linear-gradient(90deg, rgba(34,255,153,0.06) 0 1px, transparent 1px 12px);
  pointer-events: none;
  mix-blend-mode: screen;
}
.sc-theme .text-primary { color: var(--sc-primary); }
.sc-theme .border-primary { border-color: var(--sc-primary); }

/* Top back bar */
.sc-theme .w-full.bg-gray-200 {
  background: linear-gradient(180deg, #0a1d16 0%, #081611 100%);
  color: var(--sc-text-muted);
  border-bottom: 1px solid rgba(148,163,184,0.18);
}
.sc-theme a { color: var(--sc-primary); }
.sc-theme a:hover { color: #b5ffd9; }

/* Sidebar/nav */
.sc-theme #main-nav {
  background: linear-gradient(180deg, #0a1f19 0%, #071a15 100%);
  outline: 1px solid rgba(34, 255, 153, 0.25);
  border-radius: 12px;
  position: relative;
}
.sc-theme #main-nav::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(0deg, rgba(34,255,153,0.06) 0 1px, transparent 1px 10px),
    repeating-linear-gradient(90deg, rgba(34,255,153,0.05) 0 1px, transparent 1px 12px);
  pointer-events: none;
  mix-blend-mode: screen;
  border-radius: 12px;
}
.sc-theme .nav-link {
  color: var(--sc-text);
  background: transparent;
  border: 1px solid transparent;
  transition: background .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.sc-theme .nav-link:hover {
  background: rgba(34, 255, 153, 0.06);
  border-color: rgba(34,255,153,0.25);
  box-shadow: inset 0 0 0 1px rgba(34,255,153,0.25);
}
.sc-theme .nav-link.active {
  background: rgba(34, 255, 153, 0.12);
  border-left: 4px solid var(--sc-primary);
}

/* Panels and utility color overrides to escape Tailwind's light scheme */
.sc-theme .bg-white {
  background: linear-gradient(180deg, var(--sc-bg-2) 0%, var(--sc-panel) 100%) !important;
  position: relative;
  overflow: hidden;
}
.sc-theme .bg-white::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(0deg, rgba(34,255,153,0.05) 0 1px, transparent 1px 10px),
    repeating-linear-gradient(90deg, rgba(34,255,153,0.04) 0 1px, transparent 1px 12px);
  pointer-events: none;
  mix-blend-mode: screen;
}
.sc-theme .bg-blue-50 { background: rgba(34, 255, 153, 0.06) !important; }
.sc-theme .bg-yellow-50 { background: rgba(245, 158, 11, 0.08) !important; }
.sc-theme .text-gray-800, .sc-theme .text-gray-700 { color: var(--sc-text) !important; }
.sc-theme .text-gray-600 { color: var(--sc-text-muted) !important; }
.sc-theme .text-blue-600 { color: var(--sc-primary) !important; }
.sc-theme .text-yellow-600 { color: var(--sc-accent) !important; }
.sc-theme .text-red-600 { color: var(--sc-danger) !important; }
.sc-theme .border-gray-200 { border-color: rgba(148,163,184,0.18) !important; }
.sc-theme .border-blue-500 { border-color: var(--sc-primary) !important; }
.sc-theme .border-yellow-400 { border-color: var(--sc-accent) !important; }

/* Code and chips */
.sc-theme code {
  background: rgba(2, 6, 23, 0.8);
  color: #c7d2fe;
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: 6px;
}

/* Cards and content blocks */
.sc-theme .rounded-lg, .sc-theme .rounded-md {
  border-radius: 12px;
}
.sc-theme .shadow-lg, .sc-theme .shadow-md {
  box-shadow: 0 12px 28px -14px rgba(0,0,0,.55), 0 0 0 6px var(--sc-ring);
}
.sc-theme .hover\:shadow-lg:hover {
  box-shadow: 0 16px 36px -16px rgba(0,0,0,.65), 0 0 0 6px var(--sc-ring);
}

/* Buttons */
.sc-theme .bg-blue-100 { background: rgba(34, 255, 153, 0.12) !important; }
.sc-theme .hover\:bg-blue-200:hover { background: rgba(181, 255, 217, 0.16) !important; }
.sc-theme .text-blue-700 { color: #b5ffd9 !important; }
.sc-theme .focus\:ring-blue-500 { box-shadow: 0 0 0 3px var(--sc-ring) !important; }

/* Tailwind gray hover on dark theme */
.sc-theme .hover\:bg-gray-50:hover { background: rgba(34, 255, 153, 0.06) !important; }

/* Alerts and callouts */
.sc-theme .bg-blue-50.border-l-4 { box-shadow: inset 4px 0 0 0 var(--sc-primary); }
.sc-theme .bg-yellow-50.border-l-4 { box-shadow: inset 4px 0 0 0 var(--sc-accent); }

/* Images */
.sc-theme img { border-radius: 10px; }
.sc-theme .border { border-color: rgba(148,163,184,0.18) !important; }

/* Main content area */
.sc-theme main { padding-bottom: 60px; }

/* Lucide icons tint */
.sc-theme i[data-lucide] { color: var(--sc-primary); }
