/* ==========================================================================
   CSS Custom Properties (Design Tokens)
   RL/MDP Inspired Color System
   
   Color Theory:
   - Primary: Electric cyan → Represents STATES in MDP
   - Secondary: Amber/Gold → Represents REWARDS
   - Tertiary: Violet → Represents VALUE FUNCTIONS
   - Success: Emerald → Represents optimal ACTIONS
   ========================================================================== */

:root {
  /* Typography - Font Families */
  --font-display: 'Space Grotesk', 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Typography - Font Scale */
  --text-xs: 0.75rem;      /* 12px - tags, labels */
  --text-sm: 0.875rem;     /* 14px - metadata, captions */
  --text-base: 1rem;       /* 16px - body text */
  --text-lg: 1.125rem;     /* 18px - lead paragraphs */
  --text-xl: 1.25rem;      /* 20px - card titles */
  --text-2xl: 1.5rem;      /* 24px - section subtitles */
  --text-3xl: 2rem;        /* 32px - section titles */
  --text-4xl: 2.5rem;      /* 40px - page titles */
  --text-5xl: 3.5rem;      /* 56px - hero name */
  --text-6xl: 4.5rem;      /* 72px - huge display */

  /* Spacing System */
  --space-1: 0.25rem;      /* 4px */
  --space-2: 0.5rem;       /* 8px */
  --space-3: 0.75rem;      /* 12px */
  --space-4: 1rem;         /* 16px */
  --space-5: 1.25rem;      /* 20px */
  --space-6: 1.5rem;       /* 24px */
  --space-8: 2rem;         /* 32px */
  --space-10: 2.5rem;      /* 40px */
  --space-12: 3rem;        /* 48px */
  --space-16: 4rem;        /* 64px */
  --space-20: 5rem;        /* 80px */
  --space-24: 6rem;        /* 96px */

  /* Layout */
  --max-width: 1200px;
  --content-width: 65ch;
  --nav-height: 4rem;
  --border-radius-sm: 0.375rem;   /* 6px */
  --border-radius-md: 0.5rem;     /* 8px */
  --border-radius-lg: 0.75rem;    /* 12px */
  --border-radius-xl: 1rem;       /* 16px */
  --border-radius-full: 9999px;

  /* Animation Timing */
  --transition-fast: 150ms ease;
  --transition-base: 200ms ease;
  --transition-slow: 300ms ease;
  --transition-slower: 500ms ease;
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-back: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);

  /* ==========================================================================
     Default Colors (Dark Mode - Default)
     ========================================================================== */
  
  /* Deep space background */
  --bg-primary: #0a0e14;
  --bg-secondary: #0f1419;
  --bg-tertiary: #151c25;
  --bg-elevated: #1a2332;

  /* Borders with subtle glow potential */
  --border-primary: #1e2a3a;
  --border-secondary: #2d3f52;
  --border-glow: rgba(0, 212, 255, 0.2);

  /* Text hierarchy */
  --text-primary: #e6edf3;
  --text-secondary: #9ba8b5;
  --text-tertiary: #6b7a8a;
  --text-muted: #4a5868;

  /* RL-Themed Accent Colors */
  /* State color - Electric Cyan (represents states in MDP) */
  --accent-state: #00d4ff;
  --accent-state-dim: rgba(0, 212, 255, 0.15);
  --accent-state-glow: rgba(0, 212, 255, 0.3);
  
  /* Reward color - Amber Gold (represents rewards) */
  --accent-reward: #ffb800;
  --accent-reward-dim: rgba(255, 184, 0, 0.15);
  --accent-reward-glow: rgba(255, 184, 0, 0.3);
  
  /* Value color - Violet (represents value functions) */
  --accent-value: #a855f7;
  --accent-value-dim: rgba(168, 85, 247, 0.15);
  --accent-value-glow: rgba(168, 85, 247, 0.3);
  
  /* Action color - Emerald (represents actions) */
  --accent-action: #10b981;
  --accent-action-dim: rgba(16, 185, 129, 0.15);
  --accent-action-glow: rgba(16, 185, 129, 0.3);

  /* Primary accent (defaults to state color) */
  --accent-primary: var(--accent-state);
  --accent-secondary: var(--accent-reward);
  --accent-hover: #33ddff;

  /* Special effects */
  --glow-color: rgba(0, 212, 255, 0.15);
  --glow-color-strong: rgba(0, 212, 255, 0.25);
  --shadow-color: rgba(0, 0, 0, 0.4);
  --gradient-mesh: radial-gradient(ellipse at 20% 80%, var(--accent-value-dim) 0%, transparent 50%),
                   radial-gradient(ellipse at 80% 20%, var(--accent-state-dim) 0%, transparent 50%),
                   radial-gradient(ellipse at 50% 50%, var(--accent-reward-dim) 0%, transparent 70%);
  
  --nav-bg: rgba(10, 14, 20, 0.85);
  --overlay-bg: rgba(0, 0, 0, 0.7);

  /* Grid pattern for backgrounds */
  --grid-color: rgba(30, 42, 58, 0.5);
}

/* ==========================================================================
   Dark Mode (Explicit)
   ========================================================================== */

:root[data-theme="dark"] {
  --bg-primary: #0a0e14;
  --bg-secondary: #0f1419;
  --bg-tertiary: #151c25;
  --bg-elevated: #1a2332;

  --border-primary: #1e2a3a;
  --border-secondary: #2d3f52;
  --border-glow: rgba(0, 212, 255, 0.2);

  --text-primary: #e6edf3;
  --text-secondary: #9ba8b5;
  --text-tertiary: #6b7a8a;
  --text-muted: #4a5868;

  --accent-state: #00d4ff;
  --accent-state-dim: rgba(0, 212, 255, 0.15);
  --accent-state-glow: rgba(0, 212, 255, 0.3);
  
  --accent-reward: #ffb800;
  --accent-reward-dim: rgba(255, 184, 0, 0.15);
  --accent-reward-glow: rgba(255, 184, 0, 0.3);
  
  --accent-value: #a855f7;
  --accent-value-dim: rgba(168, 85, 247, 0.15);
  --accent-value-glow: rgba(168, 85, 247, 0.3);
  
  --accent-action: #10b981;
  --accent-action-dim: rgba(16, 185, 129, 0.15);
  --accent-action-glow: rgba(16, 185, 129, 0.3);

  --accent-primary: var(--accent-state);
  --accent-secondary: var(--accent-reward);
  --accent-hover: #33ddff;

  --glow-color: rgba(0, 212, 255, 0.15);
  --glow-color-strong: rgba(0, 212, 255, 0.25);
  --shadow-color: rgba(0, 0, 0, 0.4);
  --gradient-mesh: radial-gradient(ellipse at 20% 80%, var(--accent-value-dim) 0%, transparent 50%),
                   radial-gradient(ellipse at 80% 20%, var(--accent-state-dim) 0%, transparent 50%),
                   radial-gradient(ellipse at 50% 50%, var(--accent-reward-dim) 0%, transparent 70%);
  
  --nav-bg: rgba(10, 14, 20, 0.85);
  --overlay-bg: rgba(0, 0, 0, 0.7);
  --grid-color: rgba(30, 42, 58, 0.5);
}

/* ==========================================================================
   Light Mode
   ========================================================================== */

html[data-theme="light"],
:root[data-theme="light"] {
  --bg-primary: #fafbfc;
  --bg-secondary: #f0f3f6;
  --bg-tertiary: #e4e9ed;
  --bg-elevated: #ffffff;

  --border-primary: #d1d9e0;
  --border-secondary: #b8c4cf;
  --border-glow: rgba(0, 150, 200, 0.15);

  --text-primary: #1a1f26;
  --text-secondary: #4a5568;
  --text-tertiary: #718096;
  --text-muted: #a0aec0;

  /* Slightly deeper accents for light mode readability */
  --accent-state: #0096c8;
  --accent-state-dim: rgba(0, 150, 200, 0.1);
  --accent-state-glow: rgba(0, 150, 200, 0.2);
  
  --accent-reward: #d97706;
  --accent-reward-dim: rgba(217, 119, 6, 0.1);
  --accent-reward-glow: rgba(217, 119, 6, 0.2);
  
  --accent-value: #7c3aed;
  --accent-value-dim: rgba(124, 58, 237, 0.1);
  --accent-value-glow: rgba(124, 58, 237, 0.2);
  
  --accent-action: #059669;
  --accent-action-dim: rgba(5, 150, 105, 0.1);
  --accent-action-glow: rgba(5, 150, 105, 0.2);

  --accent-primary: var(--accent-state);
  --accent-secondary: var(--accent-reward);
  --accent-hover: #007aa3;

  --glow-color: rgba(0, 150, 200, 0.08);
  --glow-color-strong: rgba(0, 150, 200, 0.15);
  --shadow-color: rgba(0, 0, 0, 0.08);
  --gradient-mesh: radial-gradient(ellipse at 20% 80%, var(--accent-value-dim) 0%, transparent 50%),
                   radial-gradient(ellipse at 80% 20%, var(--accent-state-dim) 0%, transparent 50%),
                   radial-gradient(ellipse at 50% 50%, var(--accent-reward-dim) 0%, transparent 70%);
  
  --nav-bg: rgba(250, 251, 252, 0.9);
  --overlay-bg: rgba(0, 0, 0, 0.3);
  --grid-color: rgba(209, 217, 224, 0.5);
}
