/* ==========================================================================
   Dark Web Academy — Design System
   THE single source of truth for brand tokens + reusable component primitives.
   Loaded globally in base.html (before any inline styles). Page-level :root
   blocks may still override any token locally; this sheet guarantees every
   token resolves site-wide. Values ported 1:1 from the former base.html :root.
   ========================================================================== */

:root {
  /* --- Brand palette (logo-inspired) --- */
  --primary-purple: #7B3FF2;
  --primary-teal:   #06B6D4;
  --primary-green:  #10B981;
  --terminal-green: #00FF41;
  --accent-cyan:    #00FFFF;

  /* --- Backgrounds (deep navy, layered) --- */
  --bg-primary:   #0a0e27;   /* page background */
  --bg-secondary: #1a1f3a;   /* cards / panels */
  --bg-tertiary:  #252a48;   /* elevated surface */
  --bg-elevated:  #2d325a;   /* most-forward surface / hover */
  --dark-bg:      #0a0e27;   /* alias of --bg-primary */
  --darker-bg:    #060a1f;   /* sunken areas / code blocks */

  /* --- Primary accent (green) --- */
  --accent-primary:       var(--terminal-green);  /* bright terminal green */
  --accent-primary-bright:#00FF41;
  --accent-primary-dim:   var(--primary-green);   /* softer green */
  --accent-green:         var(--terminal-green);  /* success / done / primary CTA */

  /* --- Secondary accent (cyan / teal) --- */
  --accent-secondary:        var(--primary-teal);
  --accent-secondary-bright: var(--accent-cyan);
  --accent-secondary-dim:    #0891B2;

  /* --- Purple accent (advanced / premium) --- */
  --accent-purple:        var(--primary-purple);
  --accent-purple-bright: #8B5CF6;
  --accent-purple-dim:    #6D28D9;

  /* --- Extra semantic accents --- */
  --accent-red:    #FF4757;   /* danger / destructive */
  --accent-yellow: #FFD93D;   /* highlight yellow */
  --lab-amber:     #F5A623;   /* warning / in-progress / intermediate */
  --xp-gold:       #FFD700;   /* XP / rewards / gamification */

  /* --- Status colors --- */
  --color-success: var(--primary-green);
  --color-info:    var(--primary-teal);
  --color-warning: #FBBF24;
  --color-danger:  #EF4444;

  /* --- Text hierarchy --- */
  --text-primary:   #E5E7EB;
  --text-secondary: #9CA3AF;
  --text-dim:       #6B7280;
  --text-muted:     #4B5563;

  /* --- Borders and surfaces --- */
  --border-color:  #2a2f4a;   /* default */
  --border-subtle: #1e2340;   /* faint dividers */
  --hover-bg:      #1a1f3a;
  --card-bg:       #1a1f3a;

  /* --- Shadows --- */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.7);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.7);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.7);

  /* --- Glows (COMPLETE box-shadow values — apply as `box-shadow: var(--glow-*)`) --- */
  --glow-primary:   0 0 20px rgba(0, 255, 65, 0.5);
  --glow-secondary: 0 0 20px rgba(0, 217, 255, 0.4);
  --glow-purple:    0 0 20px rgba(123, 63, 242, 0.4);
  --glow-green:     var(--glow-primary);
  --glow-cyan:      var(--glow-secondary);

  /* --- Radii --- */
  --radius-sm:   4px;
  --radius:      6px;
  --radius-lg:   8px;
  --radius-pill: 999px;

  /* --- Typography --- */
  --font-mono: 'Source Code Pro', 'Courier New', Consolas, monospace;  /* headings, UI, code — the brand identity */
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;          /* long-form reading */

  /* Difficulty scale: beginner=green -> intermediate=amber -> advanced=red -> expert=purple */
}

/* ==========================================================================
   Reusable component primitives (opt-in — add the class, get on-brand styling)
   ========================================================================== */

/* Card */
.ds-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
}
.ds-card--interactive { transition: border-color .2s ease, box-shadow .2s ease; }
.ds-card--interactive:hover {
  border-color: var(--accent-cyan);
  box-shadow: var(--glow-cyan);
}

/* Badge / pill */
.ds-badge {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .35rem .8rem;
  border-radius: var(--radius-pill);
  border: 1px solid currentColor;
  font-family: var(--font-mono);
  font-size: .72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em;
}
.ds-badge--green  { color: var(--accent-green);         background: rgba(0, 255, 65, .12); }
.ds-badge--cyan   { color: var(--accent-cyan);          background: rgba(0, 255, 255, .10); }
.ds-badge--amber  { color: var(--lab-amber);            background: rgba(245, 166, 35, .15); }
.ds-badge--red    { color: var(--accent-red);           background: rgba(255, 71, 87, .15); }
.ds-badge--purple { color: var(--accent-purple-bright); background: rgba(139, 92, 246, .15); }

/* Difficulty pills (semantic aliases of the badge scale) */
.ds-difficulty-beginner     { color: var(--primary-green);         border-color: var(--primary-green);         background: rgba(16, 185, 129, .18); }
.ds-difficulty-intermediate { color: var(--lab-amber);             border-color: var(--lab-amber);             background: rgba(245, 166, 35, .18); }
.ds-difficulty-advanced     { color: var(--accent-red);            border-color: var(--accent-red);            background: rgba(255, 71, 87, .18); }
.ds-difficulty-expert       { color: var(--accent-purple-bright);  border-color: var(--accent-purple-bright);  background: rgba(139, 92, 246, .18); }

/* Button */
.ds-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .6rem 1.2rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-family: var(--font-mono); font-weight: 700; font-size: .9rem;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: all .2s ease;
}
.ds-btn--primary   { background: var(--accent-green); color: var(--bg-primary); }
.ds-btn--primary:hover   { box-shadow: var(--glow-green); transform: translateY(-1px); }
.ds-btn--secondary { background: transparent; color: var(--accent-cyan); border-color: var(--accent-cyan); }
.ds-btn--secondary:hover { background: var(--accent-cyan); color: var(--bg-primary); }
.ds-btn--danger    { background: var(--accent-red); color: #fff; }
.ds-btn:disabled   { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }

/* Progress bar */
.ds-progress { height: 6px; background: var(--darker-bg); border-radius: var(--radius-pill); overflow: hidden; }
.ds-progress > span { display: block; height: 100%; border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-green)); transition: width .4s ease; }
