/* ===================================
   Youth UI/UX Modernization
   Design Tokens System
   =================================== */

/* This file contains all design tokens for the Youth Platform
   following the requirements from the UI/UX modernization spec.
   These tokens provide a single source of truth for visual properties. */

:root {
  /* ===================================
     Color Palette - Light Theme
     =================================== */
  
  /* Primary Colors */
  --color-primary-50: #eef2ff;
  --color-primary-100: #e0e7ff;
  --color-primary-200: #c7d2fe;
  --color-primary-300: #a5b4fc;
  --color-primary-400: #818cf8;
  --color-primary-500: #6366f1;
  --color-primary-600: #4f46e5;
  --color-primary-700: #4338ca;
  --color-primary-800: #3730a3;
  --color-primary-900: #312e81;
  
  /* Secondary Colors */
  --color-secondary-50: #faf5ff;
  --color-secondary-100: #f3e8ff;
  --color-secondary-200: #e9d5ff;
  --color-secondary-300: #d8b4fe;
  --color-secondary-400: #c084fc;
  --color-secondary-500: #8b5cf6;
  --color-secondary-600: #7c3aed;
  --color-secondary-700: #6d28d9;
  --color-secondary-800: #5b21b6;
  --color-secondary-900: #4c1d95;
  
  /* Accent Colors */
  --color-accent-50: #fdf2f8;
  --color-accent-100: #fce7f3;
  --color-accent-200: #fbcfe8;
  --color-accent-300: #f9a8d4;
  --color-accent-400: #f472b6;
  --color-accent-500: #ec4899;
  --color-accent-600: #db2777;
  --color-accent-700: #be185d;
  --color-accent-800: #9f1239;
  --color-accent-900: #831843;
  
  /* Success Colors */
  --color-success-50: #ecfdf5;
  --color-success-100: #d1fae5;
  --color-success-200: #a7f3d0;
  --color-success-300: #6ee7b7;
  --color-success-400: #34d399;
  --color-success-500: #10b981;
  --color-success-600: #059669;
  --color-success-700: #047857;
  --color-success-800: #065f46;
  --color-success-900: #064e3b;
  
  /* Warning Colors */
  --color-warning-50: #fffbeb;
  --color-warning-100: #fef3c7;
  --color-warning-200: #fde68a;
  --color-warning-300: #fcd34d;
  --color-warning-400: #fbbf24;
  --color-warning-500: #f59e0b;
  --color-warning-600: #d97706;
  --color-warning-700: #b45309;
  --color-warning-800: #92400e;
  --color-warning-900: #78350f;
  
  /* Error Colors */
  --color-error-50: #fef2f2;
  --color-error-100: #fee2e2;
  --color-error-200: #fecaca;
  --color-error-300: #fca5a5;
  --color-error-400: #f87171;
  --color-error-500: #ef4444;
  --color-error-600: #dc2626;
  --color-error-700: #b91c1c;
  --color-error-800: #991b1b;
  --color-error-900: #7f1d1d;
  
  /* Neutral Colors */
  --color-neutral-50: #f9fafb;
  --color-neutral-100: #f3f4f6;
  --color-neutral-200: #e5e7eb;
  --color-neutral-300: #d1d5db;
  --color-neutral-400: #9ca3af;
  --color-neutral-500: #6b7280;
  --color-neutral-600: #4b5563;
  --color-neutral-700: #374151;
  --color-neutral-800: #1f2937;
  --color-neutral-900: #111827;
  
  /* ===================================
     Semantic Colors - Light Theme
     =================================== */
  
  --color-background: #ffffff;
  --color-surface: #f9fafb;
  --color-surface-elevated: #ffffff;
  --color-text-primary: #111827;
  --color-text-secondary: #6b7280;
  --color-text-tertiary: #9ca3af;
  --color-border: #e5e7eb;
  --color-border-hover: #d1d5db;
  --color-divider: #f3f4f6;
  
  /* Interactive States */
  --color-hover-overlay: rgba(0, 0, 0, 0.05);
  --color-active-overlay: rgba(0, 0, 0, 0.1);
  --color-focus-ring: rgba(99, 102, 241, 0.3);
  
  /* ===================================
     Typography Scale
     =================================== */
  
  /* Font Families - Plus Jakarta Sans: sharp, geometric, modern (designer pick for youth) */
  --font-family-base: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
  --font-family-heading: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
  --font-family-mono: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', 'Droid Sans Mono', 'Source Code Pro', monospace;
  
  /* Font Sizes */
  --font-size-xs: 0.75rem;      /* 12px */
  --font-size-sm: 0.875rem;     /* 14px */
  --font-size-base: 1rem;       /* 16px */
  --font-size-lg: 1.125rem;     /* 18px */
  --font-size-xl: 1.25rem;      /* 20px */
  --font-size-2xl: 1.5rem;      /* 24px */
  --font-size-3xl: 1.875rem;    /* 30px */
  --font-size-4xl: 2.25rem;     /* 36px */
  --font-size-5xl: 3rem;        /* 48px */
  --font-size-6xl: 3.75rem;     /* 60px */
  
  /* Font Weights */
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  --font-weight-extrabold: 800;
  
  /* Line Heights */
  --line-height-tight: 1.25;
  --line-height-snug: 1.375;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.625;
  --line-height-loose: 2;
  
  /* Letter Spacing */
  --letter-spacing-tight: -0.025em;
  --letter-spacing-normal: 0;
  --letter-spacing-wide: 0.025em;
  --letter-spacing-wider: 0.05em;
  --letter-spacing-widest: 0.1em;
  
  /* ===================================
     Spacing System (8px base)
     =================================== */
  
  --space-0: 0;
  --space-1: 0.5rem;      /* 8px */
  --space-2: 1rem;        /* 16px */
  --space-3: 1.5rem;      /* 24px */
  --space-4: 2rem;        /* 32px */
  --space-5: 2.5rem;      /* 40px */
  --space-6: 3rem;        /* 48px */
  --space-7: 3.5rem;      /* 56px */
  --space-8: 4rem;        /* 64px */
  --space-10: 5rem;       /* 80px */
  --space-12: 6rem;       /* 96px */
  --space-16: 8rem;       /* 128px */
  --space-20: 10rem;      /* 160px */
  --space-24: 12rem;      /* 192px */
  
  /* ===================================
     Border Radius
     =================================== */
  
  --radius-none: 0;
  --radius-sm: 0.375rem;    /* 6px */
  --radius-md: 0.5rem;      /* 8px */
  --radius-lg: 0.75rem;     /* 12px */
  --radius-xl: 1rem;        /* 16px */
  --radius-2xl: 1.5rem;     /* 24px */
  --radius-3xl: 2rem;       /* 32px */
  --radius-full: 9999px;
  
  /* ===================================
     Shadows
     =================================== */
  
  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  --shadow-inner: inset 0 2px 4px 0 rgba(0, 0, 0, 0.05);
  
  /* ===================================
     Animation Durations
     =================================== */
  
  --duration-instant: 0ms;
  --duration-fast: 150ms;
  --duration-base: 300ms;
  --duration-slow: 500ms;
  --duration-slower: 700ms;
  --duration-slowest: 1000ms;
  
  /* ===================================
     Animation Easing 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);
  --ease-elastic: cubic-bezier(0.68, -0.6, 0.32, 1.6);
  
  /* ===================================
     Z-Index Scale
     =================================== */
  
  --z-index-dropdown: 1000;
  --z-index-sticky: 1020;
  --z-index-fixed: 1030;
  --z-index-modal-backdrop: 1040;
  --z-index-modal: 1050;
  --z-index-popover: 1060;
  --z-index-tooltip: 1070;
  --z-index-notification: 1080;
  
  /* ===================================
     Breakpoints (for reference in JS)
     =================================== */
  
  --breakpoint-sm: 640px;
  --breakpoint-md: 768px;
  --breakpoint-lg: 1024px;
  --breakpoint-xl: 1280px;
  --breakpoint-2xl: 1536px;
  
  /* ===================================
     Gradients
     =================================== */
  
  --gradient-primary: linear-gradient(135deg, var(--color-primary-500), var(--color-secondary-500));
  --gradient-accent: linear-gradient(135deg, var(--color-accent-500), var(--color-warning-500));
  --gradient-success: linear-gradient(135deg, var(--color-success-500), var(--color-primary-500));
  --gradient-shimmer: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  
  /* ===================================
     Glassmorphism Effects
     =================================== */
  
  --glass-background: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(255, 255, 255, 0.3);
  --glass-blur: blur(10px);
  
  /* ===================================
     Resources Warm Bento Theme
     =================================== */
  
  /* Warm Color Palette */
  --resources-coral: #FF7B6B;
  --resources-coral-light: #FFA598;
  --resources-coral-lighter: #FFD4CD;
  --resources-amber: #F4A261;
  --resources-amber-light: #F8C291;
  --resources-amber-lighter: #FCDFC1;
  --resources-mint: #81B29A;
  --resources-mint-light: #A8D0C0;
  --resources-mint-lighter: #D4EAE0;
  --resources-lavender: #9B8EC2;
  --resources-lavender-light: #BDB3D4;
  --resources-lavender-lighter: #DED9E8;
  --resources-sky: #7EC8E3;
  --resources-sky-light: #A8DCEF;
  --resources-sky-lighter: #D4EBF4;
  
  /* Background Colors */
  --resources-bg-warm: #FFFBF7;
  --resources-bg-warm-secondary: #FFF5EB;
  --resources-text-warm: #5C4D4D;
  --resources-text-warm-secondary: #8B7B7B;
  
  /* Typography for Resources */
  --resources-font-heading: 'Fraunces', Georgia, serif;
  --resources-font-base: 'DM Sans', -apple-system, sans-serif;
}

/* ===================================
   Dark Theme Overrides for Resources
   =================================== */

[data-theme="dark"],
html.dark-mode {
  /* Warm theme dark mode colors */
  --resources-bg-warm: #1a1612;
  --resources-bg-warm-secondary: #2a2218;
  --resources-text-warm: #FFFBF7;
  --resources-text-warm-secondary: #D4EAE0;
  
  /* Slightly desaturated warm colors for dark backgrounds */
  --resources-coral: #E56B5B;
  --resources-coral-light: #FFA598;
  --resources-coral-lighter: #FFD4CD;
  --resources-amber: #E49251;
  --resources-amber-light: #F8C291;
  --resources-amber-lighter: #FCDFC1;
  --resources-mint: #71A28A;
  --resources-mint-light: #A8D0C0;
  --resources-mint-lighter: #D4EAE0;
  --resources-lavender: #8B7EB2;
  --resources-lavender-light: #BDB3D4;
  --resources-lavender-lighter: #DED9E8;
  --resources-sky: #6EB8D3;
  --resources-sky-light: #A8DCEF;
  --resources-sky-lighter: #D4EBF4;
}

/* ===================================
   Resources Warm Bento Theme
   =================================== */

/* ===================================
   Dark Theme Overrides
   Apply when either [data-theme="dark"] or .dark-mode is set so theme
   is consistent before/after paint and across all components.
   =================================== */

[data-theme="dark"],
html.dark-mode {
  /* Semantic Colors - Dark Theme */
  --color-background: #111827;
  --color-surface: #1f2937;
  --color-surface-elevated: #374151;
  --color-text-primary: #f9fafb;
  --color-text-secondary: #9ca3af;
  --color-text-tertiary: #6b7280;
  --color-border: #374151;
  --color-border-hover: #4b5563;
  --color-divider: #1f2937;
  
  /* Interactive States */
  --color-hover-overlay: rgba(255, 255, 255, 0.05);
  --color-active-overlay: rgba(255, 255, 255, 0.1);
  --color-focus-ring: rgba(99, 102, 241, 0.5);
  
  /* Glassmorphism Effects - Dark */
  --glass-background: rgba(31, 41, 55, 0.7);
  --glass-border: rgba(255, 255, 255, 0.1);
  
  /* Shadows - Dark Theme (more subtle) */
  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.4), 0 1px 2px -1px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -4px rgba(0, 0, 0, 0.4);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.4);
  --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* ===================================
   Neo-Brutalism Theme Overrides
   =================================== */

[data-theme="neo-brutalism"] {
  /* ===================================
     Neo-Brutalism Color System
     =================================== */
  
  /* Primary Color - Teal */
  --color-primary-50: #f0fdfa;
  --color-primary-100: #ccfbf1;
  --color-primary-200: #99f6e4;
  --color-primary-300: #5eead4;
  --color-primary-400: #2dd4bf;
  --color-primary-500: #14b8a6;
  --color-primary-600: #0d9488;
  --color-primary-700: #0f766e;
  --color-primary-800: #115e59;
  --color-primary-900: #134e4a;
  
  /* Secondary Color - Yellow */
  --color-secondary-50: #fefce8;
  --color-secondary-100: #fef9c3;
  --color-secondary-200: #fef08a;
  --color-secondary-300: #fde047;
  --color-secondary-400: #facc15;
  --color-secondary-500: #fcd34d;
  --color-secondary-600: #ca8a04;
  --color-secondary-700: #a16207;
  --color-secondary-800: #854d0e;
  --color-secondary-900: #713f12;
  
  /* Accent Color - Pink */
  --color-accent-50: #fdf2f8;
  --color-accent-100: #fce7f3;
  --color-accent-200: #fbcfe8;
  --color-accent-300: #f9a8d4;
  --color-accent-400: #f472b6;
  --color-accent-500: #ec4899;
  --color-accent-600: #db2777;
  --color-accent-700: #be185d;
  --color-accent-800: #9f1239;
  --color-accent-900: #831843;
  
  /* Warning Color - Orange */
  --color-warning-50: #fff7ed;
  --color-warning-100: #ffedd5;
  --color-warning-200: #fed7aa;
  --color-warning-300: #fdba74;
  --color-warning-400: #fb923c;
  --color-warning-500: #f97316;
  --color-warning-600: #ea580c;
  --color-warning-700: #c2410c;
  --color-warning-800: #9a3412;
  --color-warning-900: #7c2d12;
  
  /* ===================================
     Neo-Brutalism Semantic Colors
     =================================== */
  
  --color-background: #ffffff;
  --color-surface: #ffffff;
  --color-surface-elevated: #ffffff;
  --color-text-primary: #000000;
  --color-text-secondary: #000000;
  --color-text-tertiary: #4b5563;
  --color-border: #000000;
  --color-border-hover: #000000;
  --color-divider: #000000;
  
  /* Interactive States */
  --color-hover-overlay: rgba(0, 0, 0, 0.05);
  --color-active-overlay: rgba(0, 0, 0, 0.1);
  --color-focus-ring: rgba(20, 184, 166, 0.5);
  
  /* ===================================
     Neo-Brutalism Typography
     =================================== */
  
  /* Font Weights - Bolder for neo-brutalism */
  --font-weight-normal: 600;
  --font-weight-medium: 600;
  --font-weight-semibold: 700;
  --font-weight-bold: 800;
  --font-weight-extrabold: 800;
  
  /* Font Sizes - 12% increase */
  --font-size-xs: 0.84rem;      /* 13.44px */
  --font-size-sm: 0.98rem;      /* 15.68px */
  --font-size-base: 1.12rem;    /* 17.92px */
  --font-size-lg: 1.26rem;      /* 20.16px */
  --font-size-xl: 1.4rem;       /* 22.4px */
  --font-size-2xl: 1.68rem;     /* 26.88px */
  --font-size-3xl: 2.1rem;      /* 33.6px */
  --font-size-4xl: 2.52rem;     /* 40.32px */
  --font-size-5xl: 3.36rem;     /* 53.76px */
  --font-size-6xl: 4.2rem;      /* 67.2px */
  
  /* Line Heights - Optimized for readability */
  --line-height-tight: 1.25;
  --line-height-snug: 1.375;
  --line-height-normal: 1.6;
  --line-height-relaxed: 1.7;
  --line-height-loose: 2;
  
  /* ===================================
     Neo-Brutalism Borders
     =================================== */
  
  --border-width-thin: 2px;
  --border-width-base: 4px;
  --border-width-thick: 5px;
  --border-style: solid;
  --border-color: #000000;
  
  /* Border Radius - Sharp corners */
  --radius-none: 0;
  --radius-sm: 0;
  --radius-md: 0;
  --radius-lg: 2px;
  --radius-xl: 4px;
  --radius-2xl: 4px;
  --radius-3xl: 4px;
  --radius-full: 0;
  
  /* ===================================
     Neo-Brutalism Shadows (Hard, No Blur)
     =================================== */
  
  --shadow-xs: 2px 2px 0 #000000;
  --shadow-sm: 3px 3px 0 #000000;
  --shadow-md: 6px 6px 0 #000000;
  --shadow-lg: 8px 8px 0 #000000;
  --shadow-xl: 10px 10px 0 #000000;
  --shadow-2xl: 12px 12px 0 #000000;
  --shadow-inner: none;
  
  /* Shadow States */
  --shadow-hover: 3px 3px 0 #000000;
  --shadow-active: 1px 1px 0 #000000;
  --shadow-focus: 4px 4px 0 var(--color-primary-500);
  
  /* ===================================
     Neo-Brutalism Animation
     =================================== */
  
  --duration-instant: 0ms;
  --duration-fast: 150ms;
  --duration-base: 200ms;
  --duration-slow: 250ms;
  --duration-slower: 300ms;
  --duration-slowest: 400ms;
  
  /* Easing - Mechanical feel */
  --ease-linear: linear;
  --ease-in: ease-in;
  --ease-out: ease-out;
  --ease-in-out: ease-in-out;
  --ease-bounce: ease-in-out;
  --ease-elastic: ease-in-out;
  
  /* ===================================
     Neo-Brutalism Specific Properties
     =================================== */
  
  /* Gradients - None (flat colors only) */
  --gradient-primary: none;
  --gradient-accent: none;
  --gradient-success: none;
  --gradient-shimmer: none;
  
  /* Glassmorphism - Disabled */
  --glass-background: #ffffff;
  --glass-border: #000000;
  --glass-blur: none;
  
  /* Component-specific borders */
  --button-border: 4px solid #000000;
  --card-border: 4px solid #000000;
  --input-border: 4px solid #000000;
  --modal-border: 5px solid #000000;
  
  /* Component-specific shadows */
  --button-shadow: 6px 6px 0 #000000;
  --button-shadow-hover: 3px 3px 0 #000000;
  --button-shadow-active: 1px 1px 0 #000000;
  --card-shadow: 8px 8px 0 #000000;
  --modal-shadow: 10px 10px 0 #000000;
}

/* ===================================
   Neo-Brutalism Responsive Adjustments
   =================================== */

@media (max-width: 768px) {
  [data-theme="neo-brutalism"] {
    /* Reduce border thickness on mobile */
    --border-width-base: 3px;
    --border-width-thick: 4px;
    
    /* Reduce shadow offsets by 50% */
    --shadow-xs: 1px 1px 0 #000000;
    --shadow-sm: 2px 2px 0 #000000;
    --shadow-md: 3px 3px 0 #000000;
    --shadow-lg: 4px 4px 0 #000000;
    --shadow-xl: 5px 5px 0 #000000;
    --shadow-2xl: 6px 6px 0 #000000;
    
    --shadow-hover: 2px 2px 0 #000000;
    --shadow-active: 1px 1px 0 #000000;
    
    --button-shadow: 3px 3px 0 #000000;
    --button-shadow-hover: 2px 2px 0 #000000;
    --button-shadow-active: 1px 1px 0 #000000;
    --card-shadow: 4px 4px 0 #000000;
    --modal-shadow: 5px 5px 0 #000000;
  }
}

/* ===================================
   Reduced Motion Support
   =================================== */

@media (prefers-reduced-motion: reduce) {
  :root {
    --duration-instant: 0ms;
    --duration-fast: 0ms;
    --duration-base: 0ms;
    --duration-slow: 0ms;
    --duration-slower: 0ms;
    --duration-slowest: 0ms;
  }
}

/* ===================================
   High Contrast Mode Support
   =================================== */

@media (prefers-contrast: high) {
  :root {
    --color-border: #000000;
    --color-text-secondary: #000000;
  }
  
  [data-theme="dark"] {
    --color-border: #ffffff;
    --color-text-secondary: #ffffff;
  }
}
