/* ============================================
   Strux Labs Design System - CSS Variables
   Version: 1.0.0
   Last Updated: 2025-10-23
   
   ADHD-Optimized Dark Theme Design System
   ============================================ */

:root {
  /* ==========================================
     COLOR SYSTEM
     ========================================== */
  
  /* Brand Colors */
  --brand-primary: #5873CB;        /* Cool blue - focus & trust */
  --brand-primary-light: #7A91D4;  /* Hover states */
  --brand-primary-dark: #4A63B8;   /* Pressed states */
  --brand-secondary: #367C28;      /* Success green - achievement */
  --brand-secondary-light: #4A9E3A;
  --brand-secondary-dark: #2D6B20;
  
  /* Neutral Palette - Dark Mode First */
  --gray-50: #FAFAFA;
  --gray-100: #E0E0E0;
  --gray-200: #C6C6C6;
  --gray-300: #A8A8A8;
  --gray-400: #8E8E8E;
  --gray-500: #707070;
  --gray-600: #525252;
  --gray-700: #393939;
  --gray-800: #262626;
  --gray-900: #171717;
  
  --white: #FFFFFF;
  --black: #000000;
  
  /* Background Colors */
  --bg-primary: #0a0a0a;      /* Main canvas */
  --bg-secondary: #1E1E1E;    /* Cards, elevated surfaces */
  --bg-tertiary: #2A2A2A;     /* Nested components */
  --bg-surface: #1E1E1E;      /* Alias for secondary */
  
  /* Text Colors */
  --text-primary: #E0E0E0;    /* Main text */
  --text-secondary: #A0A0A0;  /* Secondary text */
  --text-muted: #707070;      /* Disabled/muted text */
  --text-accent: #5873CB;     /* Links and accents */
  --text-on-dark: #E0E0E0;    /* High contrast on dark */
  --text-on-light: #171717;   /* High contrast on light */
  
  /* Status Colors */
  --success: #4CAF50;
  --success-light: #81C784;
  --success-dark: #388E3C;
  --success-bg: rgba(76, 175, 80, 0.12);
  
  --warning: #FF9800;
  --warning-light: #FFB74D;
  --warning-dark: #F57C00;
  --warning-bg: rgba(255, 152, 0, 0.12);
  
  --error: #F44336;
  --error-light: #E57373;
  --error-dark: #D32F2F;
  --error-bg: rgba(244, 67, 54, 0.12);
  
  --info: #2196F3;
  --info-light: #64B5F6;
  --info-dark: #1976D2;
  --info-bg: rgba(33, 150, 243, 0.12);
  
  /* Quest System Colors */
  --quest-pending: #757575;
  --quest-in-progress: #5873CB;
  --quest-completed: #4CAF50;
  --quest-approved: #00C853;
  
  /* Priority Levels - ADHD Friendly */
  --priority-critical: #FF6B6B;  /* Warm red, not panic-inducing */
  --priority-high: #FF9800;      /* Orange - important */
  --priority-medium: #5873CB;    /* Blue - normal */
  --priority-low: #9E9E9E;       /* Gray - can wait */
  
  /* Urgency Spectrum */
  --urgency-overdue: #D32F2F;
  --urgency-overdue-bg: rgba(211, 47, 47, 0.15);
  --urgency-today: #D32F2F;
  --urgency-today-bg: rgba(211, 47, 47, 0.15);
  --urgency-tomorrow: #F57C00;
  --urgency-tomorrow-bg: rgba(245, 124, 0, 0.15);
  --urgency-this-week: #5873CB;
  --urgency-upcoming: #9E9E9E;
  
  /* Cognitive Load / Difficulty */
  --difficulty-very-easy: #81C784;
  --difficulty-easy: #66BB6A;
  --difficulty-medium: #5873CB;
  --difficulty-hard: #FF9800;
  --difficulty-very-hard: #FF6B6B;
  
  /* AI/Automation Colors */
  --ai-primary: #9C27B0;
  --ai-secondary: #BA68C8;
  --ai-bg: rgba(139, 92, 246, 0.15);
  --ai-confidence-high: #4CAF50;
  --ai-confidence-medium: #FF9800;
  --ai-confidence-low: #F44336;
  --ai-accent: #E1BEE7;
  
  /* Subject Colors */
  --subject-math: #3F51B5;
  --subject-science: #4CAF50;
  --subject-english: #FF5722;
  --subject-social-studies: #795548;
  --subject-language: #9C27B0;
  --subject-arts: #E91E63;
  --subject-pe: #00BCD4;
  --subject-elective: #607D8B;
  --subject-other: #9E9E9E;

  /* Custom Course Colors - User Assignable Palette
     Carefully selected to avoid conflicts with semantic colors:
     - Not red/orange (urgency, priority, error)
     - Not purple (AI)
     - Not green (success, quest-completed)
     - Not brand blue shades
  */
  --course-color-1: #EC407A;   /* Hot Pink - distinct from error reds */
  --course-color-2: #AB47BC;   /* Medium Purple - lighter than AI purple */
  --course-color-3: #7E57C2;   /* Deep Purple - violet lean */
  --course-color-4: #5C6BC0;   /* Indigo - between purple and blue */
  --course-color-5: #42A5F5;   /* Light Blue - brighter than brand */
  --course-color-6: #29B6F6;   /* Sky Blue - distinct cyan lean */
  --course-color-7: #26C6DA;   /* Cyan - aqua tone */
  --course-color-8: #26A69A;   /* Teal - sea green */
  --course-color-9: #66BB6A;   /* Light Green - spring green */
  --course-color-10: #9CCC65;  /* Lime - yellow-green */
  --course-color-11: #D4E157;  /* Lime Yellow - bright chartreuse */
  --course-color-12: #FFCA28;  /* Golden Yellow - distinct from warning */
  --course-color-13: #FFA726;  /* Soft Orange - lighter than priority */
  --course-color-14: #FF7043;  /* Coral - pink-orange blend */
  --course-color-15: #8D6E63;  /* Warm Brown - earthy */
  --course-color-16: #78909C;  /* Blue Grey - cool neutral */

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #5873CB, #4A63B8);
  --gradient-success: linear-gradient(135deg, #367C28, #2D6B20);
  --gradient-warning: linear-gradient(135deg, #FF9800, #F57C00);
  --gradient-error: linear-gradient(135deg, #F44336, #D32F2F);
  --gradient-ai: linear-gradient(135deg, #9C27B0, #7B1FA2);
  --gradient-blue: linear-gradient(135deg, #5873CB, #4A63B8);
  --gradient-green: linear-gradient(135deg, #367C28, #2D6B20);
  --gradient-orange: linear-gradient(135deg, #FF9800, #F57C00);
  --gradient-purple: linear-gradient(135deg, #9C27B0, #7B1FA2);
  --gradient-red: linear-gradient(135deg, #F44336, #D32F2F);
  --gradient-bg: linear-gradient(135deg, #0a0a0a 0%, #1E1E1E 100%);
  
  /* Data Visualization */
  --chart-1: #5873CB;
  --chart-2: #4CAF50;
  --chart-3: #FF9800;
  --chart-4: #9C27B0;
  --chart-5: #00BCD4;
  --chart-6: #FF5722;
  --chart-7: #795548;
  --chart-8: #607D8B;
  
  /* Grade Colors */
  --grade-a: #4CAF50;
  --grade-b: #2196F3;
  --grade-c: #FFC107;
  --grade-d: #FF9800;
  --grade-f: #F44336;
  
  /* ==========================================
     TYPOGRAPHY
     ========================================== */
  
  /* Font Families */
  --font-primary: 'Lexend', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Cascadia Code', 'Fira Code', monospace;
  
  /* Type Scale - 1.25 ratio */
  --text-xs: 0.64rem;     /* 10.24px */
  --text-sm: 0.8rem;      /* 12.8px */
  --text-base: 1rem;      /* 16px */
  --text-lg: 1.25rem;     /* 20px */
  --text-xl: 1.563rem;    /* 25px */
  --text-2xl: 1.953rem;   /* 31px */
  --text-3xl: 2.441rem;   /* 39px */
  --text-4xl: 3.052rem;   /* 49px */
  
  /* Font Weights */
  --font-normal: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;
  
  /* Line Heights */
  --leading-tight: 1.25;
  --leading-snug: 1.375;
  --leading-normal: 1.5;
  --leading-relaxed: 1.625;
  --leading-loose: 2;
  
  /* Letter Spacing */
  --tracking-tighter: -0.05em;
  --tracking-tight: -0.025em;
  --tracking-normal: 0;
  --tracking-wide: 0.025em;
  --tracking-wider: 0.05em;
  --tracking-widest: 0.1em;
  
  /* ==========================================
     SPACING & LAYOUT
     ========================================== */
  
  /* Spacing Scale - 4px base */
  --space-0: 0;
  --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 */
  
  /* Grid System */
  --grid-columns: 12;
  --grid-gutter: var(--space-6);
  --grid-margin: var(--space-8);
  
  /* Container Widths */
  --container-sm: 640px;
  --container-md: 768px;
  --container-lg: 1024px;
  --container-xl: 1280px;
  --container-2xl: 1400px;
  
  /* Content Width */
  --content-prose: 65ch;
  --content-narrow: 45ch;
  --content-wide: 85ch;
  
  /* ==========================================
     BORDERS & RADIUS
     ========================================== */
  
  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;
  
  /* Border Widths */
  --border-thin: 1px;
  --border-base: 2px;
  --border-thick: 4px;
  
  /* Border Colors */
  --border-color: rgba(255, 255, 255, 0.1);
  --border-color-hover: rgba(255, 255, 255, 0.15);
  --border-color-focus: var(--brand-primary);
  
  /* ==========================================
     SHADOWS & EFFECTS
     ========================================== */
  
  /* Shadows */
  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 2px 4px 0 rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
  --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
  
  /* Glow Effects */
  --glow-primary: 0 0 20px rgba(88, 115, 203, 0.4);
  --glow-success: 0 0 20px rgba(76, 175, 80, 0.4);
  --glow-warning: 0 0 20px rgba(255, 152, 0, 0.4);
  --glow-error: 0 0 20px rgba(244, 67, 54, 0.4);
  
  /* ==========================================
     TRANSITIONS & ANIMATIONS
     ========================================== */
  
  /* Transition Durations */
  --transition-fast: 150ms;
  --transition-base: 200ms;
  --transition-slow: 300ms;
  --transition-slower: 500ms;
  
  /* Transition Timing Functions */
  --ease-linear: linear;
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
  
  /* ==========================================
     BREAKPOINTS
     ========================================== */
  
  --breakpoint-sm: 640px;
  --breakpoint-md: 768px;
  --breakpoint-lg: 1024px;
  --breakpoint-xl: 1280px;
  --breakpoint-2xl: 1400px;
  
  /* ==========================================
     Z-INDEX SCALE
     ========================================== */
  
  --z-below: -1;
  --z-base: 0;
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-fixed: 300;
  --z-modal-backdrop: 400;
  --z-modal: 500;
  --z-popover: 600;
  --z-tooltip: 700;
  --z-toast: 800;
  --z-max: 9999;
}

/* ============================================
   LIGHT MODE OVERRIDES (Optional)
   ============================================ */

@media (prefers-color-scheme: light) {
  .auto-theme {
    --bg-primary: #FFFFFF;
    --bg-secondary: #F5F5F5;
    --bg-tertiary: #E0E0E0;
    --text-primary: #212121;
    --text-secondary: #757575;
    --text-muted: #9E9E9E;
    --border-color: rgba(0, 0, 0, 0.12);
    --border-color-hover: rgba(0, 0, 0, 0.2);
  }
}

/* Explicit dark mode class */
.dark-mode {
  /* Already using dark mode values by default */
}

/* Explicit light mode class */
.light-mode {
  --bg-primary: #FFFFFF;
  --bg-secondary: #F5F5F5;
  --bg-tertiary: #E0E0E0;
  --text-primary: #212121;
  --text-secondary: #757575;
  --text-muted: #9E9E9E;
  --border-color: rgba(0, 0, 0, 0.12);
  --border-color-hover: rgba(0, 0, 0, 0.2);
}

/* ============================================
   UTILITY CUSTOM PROPERTIES
   ============================================ */

/* Aspect Ratios */
:root {
  --aspect-square: 1 / 1;
  --aspect-video: 16 / 9;
  --aspect-photo: 4 / 3;
  --aspect-portrait: 3 / 4;
}

/* Opacity Values */
:root {
  --opacity-0: 0;
  --opacity-10: 0.1;
  --opacity-25: 0.25;
  --opacity-50: 0.5;
  --opacity-75: 0.75;
  --opacity-90: 0.9;
  --opacity-100: 1;
}