/*
 * Program-a-Day Theme Pack
 * Aspirational Retro-Futuristic CSS Themes for C# Learning
 *
 * Themes:
 *   1. neon-horizon     — Synthwave pioneer (grids, neon, sunset energy)
 *   2. atomic-pioneer   — Optimistic atomic age / Googie (cream, chrome, starbursts)
 *   3. circuit-dawn     — Bright Tron / digital frontier (cyan + amber circuits)
 *
 * Usage:
 *   1. Link this stylesheet.
 *   2. Add a theme class to <body> or <html>:
 *        <body class="theme-neon-horizon">
 *   3. Use the selector snippet below (or your own) to switch classes.
 *   4. Persist with localStorage if desired (see example).
 *
 * All colors, glows, radii, and shadows are driven by custom properties
 * so you can override or extend any theme easily.
 *
 * Selector Snippet (copy into your page):
 * ------------------------------------------------------------------
 * <div class="theme-selector" role="group" aria-label="Theme selector">
 *   <button type="button" data-theme="neon-horizon" class="active">Neon Horizon</button>
 *   <button type="button" data-theme="atomic-pioneer">Atomic Pioneer</button>
 *   <button type="button" data-theme="circuit-dawn">Circuit Dawn</button>
 * </div>
 *
 * <script>
 *   const selector = document.querySelector('.theme-selector');
 *   const buttons = selector.querySelectorAll('button');
 *   const saved = localStorage.getItem('pad-theme') || 'neon-horizon';
 *
 *   function applyTheme(name) {
 *     document.body.className = document.body.className
 *       .replace(/theme-\S+/g, '')
 *       .trim();
 *     document.body.classList.add('theme-' + name);
 *     buttons.forEach(b => b.classList.toggle('active', b.dataset.theme === name));
 *     localStorage.setItem('pad-theme', name);
 *   }
 *
 *   applyTheme(saved);
 *
 *   selector.addEventListener('click', (e) => {
 *     const btn = e.target.closest('button[data-theme]');
 *     if (btn) applyTheme(btn.dataset.theme);
 *   });
 * </script>
 * ------------------------------------------------------------------
 *
 * Custom Properties Reference (per theme):
 *   --bg-primary, --bg-secondary, --bg-elevated
 *   --text-primary, --text-secondary, --text-muted
 *   --accent-primary, --accent-secondary, --accent-tertiary
 *   --border, --border-strong
 *   --shadow, --glow, --glow-soft
 *   --radius, --radius-sm
 *   --font-display, --font-body, --font-mono
 *   --progress-track, --progress-fill
 *   --success, --warning
 *
 * Extend a theme by adding rules under the theme class, e.g.:
 *   .theme-neon-horizon .special-card { border-color: var(--accent-primary); }
 */

/* ==========================================================================
   Base / Reset-ish
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  transition: background-color 0.4s ease, color 0.3s ease;
}
img, svg { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ==========================================================================
   Theme: Neon Horizon (Synthwave Pioneer)
   ========================================================================== */
.theme-neon-horizon {
  --bg-primary: #0d0221;
  --bg-secondary: #1a0a2e;
  --bg-elevated: #220b3a;
  --text-primary: #f0f4ff;
  --text-secondary: #c7b8ff;
  --text-muted: #8a7aa8;
  --accent-primary: #ff2e97;
  --accent-secondary: #00f0ff;
  --accent-tertiary: #ff6b35;
  --border: rgba(255, 46, 151, 0.35);
  --border-strong: #ff2e97;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  --glow: 0 0 20px rgba(255, 46, 151, 0.6), 0 0 40px rgba(0, 240, 255, 0.3);
  --glow-soft: 0 0 12px rgba(0, 240, 255, 0.4);
  --radius: 16px;
  --radius-sm: 8px;
  --font-display: "Orbitron", "Audiowide", system-ui, sans-serif;
  --font-body: "Inter", "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", ui-monospace, monospace;
  --progress-track: rgba(255, 255, 255, 0.12);
  --progress-fill: linear-gradient(90deg, #ff2e97, #00f0ff);
  --success: #39ff14;
  --warning: #ffb800;
  background-image:
    radial-gradient(ellipse at 50% 100%, rgba(255, 100, 50, 0.15), transparent 60%),
    linear-gradient(180deg, #0d0221 0%, #1a0a2e 100%);
}

.theme-neon-horizon .card,
.theme-neon-horizon .code-window {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  box-shadow: var(--glow-soft);
}
.theme-neon-horizon .btn-primary {
  background: linear-gradient(90deg, #ff2e97, #00c8ff);
  box-shadow: var(--glow);
}
.theme-neon-horizon h1, .theme-neon-horizon .display {
  text-shadow: 0 0 20px rgba(255, 46, 151, 0.5);
}

/* ==========================================================================
   Theme: Atomic Pioneer (Optimistic Googie / Space Age)
   ========================================================================== */
.theme-atomic-pioneer {
  --bg-primary: #f7f3ea;
  --bg-secondary: #ffffff;
  --bg-elevated: #ffffff;
  --text-primary: #1a2a4a;
  --text-secondary: #3d5a80;
  --text-muted: #6b7c93;
  --accent-primary: #0033a0;
  --accent-secondary: #e63946;
  --accent-tertiary: #00a8e8;
  --border: #d4cfc4;
  --border-strong: #0033a0;
  --shadow: 0 4px 16px rgba(0, 51, 160, 0.12);
  --glow: none;
  --glow-soft: 0 2px 8px rgba(0, 51, 160, 0.08);
  --radius: 12px;
  --radius-sm: 6px;
  --font-display: "Bebas Neue", "Oswald", "Arial Black", sans-serif;
  --font-body: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --progress-track: #e8e4dc;
  --progress-fill: linear-gradient(90deg, #0033a0, #00a8e8);
  --success: #2a9d8f;
  --warning: #e9c46a;
  background-image: radial-gradient(circle at 80% 20%, rgba(0, 168, 232, 0.08), transparent 50%);
}

.theme-atomic-pioneer .card {
  background: var(--bg-elevated);
  border: 2px solid var(--border);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
}
.theme-atomic-pioneer .btn-primary {
  background: var(--accent-primary);
  color: #fff;
  border: none;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.theme-atomic-pioneer h1, .theme-atomic-pioneer .display {
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--accent-primary);
}

/* ==========================================================================
   Theme: Circuit Dawn (Bright Tron / Digital Frontier)
   ========================================================================== */
.theme-circuit-dawn {
  --bg-primary: #050c18;
  --bg-secondary: #0a1628;
  --bg-elevated: #0f1f38;
  --text-primary: #e0f7ff;
  --text-secondary: #a0d8ff;
  --text-muted: #6a8aaa;
  --accent-primary: #00d4ff;
  --accent-secondary: #ff9f1c;
  --accent-tertiary: #7b61ff;
  --border: rgba(0, 212, 255, 0.35);
  --border-strong: #00d4ff;
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
  --glow: 0 0 18px rgba(0, 212, 255, 0.55);
  --glow-soft: 0 0 10px rgba(255, 159, 28, 0.4);
  --radius: 10px;
  --radius-sm: 6px;
  --font-display: "Exo 2", "Rajdhani", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: "Share Tech Mono", "JetBrains Mono", ui-monospace, monospace;
  --progress-track: rgba(0, 212, 255, 0.15);
  --progress-fill: linear-gradient(90deg, #00d4ff, #ff9f1c);
  --success: #00ff9f;
  --warning: #ff9f1c;
  background-image:
    radial-gradient(circle at 20% 80%, rgba(0, 212, 255, 0.08), transparent 40%),
    radial-gradient(circle at 80% 20%, rgba(255, 159, 28, 0.06), transparent 40%);
}

.theme-circuit-dawn .card,
.theme-circuit-dawn .code-window {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  box-shadow: var(--glow-soft);
}
.theme-circuit-dawn .btn-primary {
  background: transparent;
  border: 2px solid var(--accent-primary);
  color: var(--accent-primary);
  box-shadow: var(--glow);
}
.theme-circuit-dawn .btn-primary:hover {
  background: var(--accent-primary);
  color: #050c18;
}
.theme-circuit-dawn h1, .theme-circuit-dawn .display {
  text-shadow: 0 0 16px rgba(0, 212, 255, 0.5);
}

/* ==========================================================================
   Shared Components
   ========================================================================== */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.4rem;
  letter-spacing: 0.05em;
}
.nav a {
  margin-left: 1.5rem;
  color: var(--text-secondary);
  font-weight: 500;
}
.nav a:hover { color: var(--accent-primary); }

.hero {
  padding: 4rem 2rem;
  text-align: center;
  max-width: 900px;
  margin: 0 auto;
}
.hero h1, .display {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  line-height: 1.05;
  margin: 0 0 1rem;
}
.subtitle {
  font-size: 1.25rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  font-weight: 600;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { color: #fff; }
.btn-secondary {
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
}

.lesson-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  padding: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}
.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--glow, var(--shadow));
}
.card h3 {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: 1.25rem;
}
.card p { color: var(--text-secondary); margin: 0 0 1rem; }

.progress {
  height: 8px;
  background: var(--progress-track);
  border-radius: 99px;
  overflow: hidden;
  margin: 0.75rem 0;
}
.progress-fill {
  height: 100%;
  background: var(--progress-fill);
  border-radius: inherit;
  transition: width 0.4s ease;
}

.code-window {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.code-window header {
  padding: 0.5rem 1rem;
  background: rgba(0, 0, 0, 0.2);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-secondary);
  display: flex;
  justify-content: space-between;
}
.code-window pre {
  margin: 0;
  padding: 1rem;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  overflow-x: auto;
  color: var(--text-primary);
}

.streak-bar {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  padding: 1.5rem;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.streak-item {
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-secondary);
}
.streak-item strong {
  display: block;
  font-size: 1.5rem;
  color: var(--accent-primary);
  font-family: var(--font-display);
}

/* Theme selector styling */
.theme-selector {
  display: flex;
  gap: 0.5rem;
  padding: 0.5rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 200;
  box-shadow: var(--shadow);
}
.theme-selector button {
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
}
.theme-selector button.active,
.theme-selector button:hover {
  background: var(--accent-primary);
  color: #fff;
  border-color: var(--accent-primary);
}

/* Responsive */
@media (max-width: 768px) {
  .site-header { flex-direction: column; gap: 1rem; padding: 1rem; }
  .nav a { margin: 0 0.75rem; }
  .hero { padding: 2rem 1rem; }
  .lesson-grid { padding: 1rem; }
  .theme-selector { bottom: 1rem; right: 1rem; flex-direction: column; }
}
