/**
 * Cognitive Assessment Platform - Design System
 * PRD-2: Typeform-Killer Theme System
 *
 * @package CognitiveAssessmentPlatform
 * @since 2.0.0
 */

/* ═══════════════════════════════════════════════════════════════════════════
   BASE DESIGN TOKENS
   These are the foundation - overridden by theme presets
   ═══════════════════════════════════════════════════════════════════════════ */

:root,
[data-cca-theme="default"] {
  /* ─────────────────────────────────────────────────────────────────────────
     COLOR SYSTEM
     ───────────────────────────────────────────────────────────────────────── */
  
  /* Primary - Main brand/action color */
  --cca-primary: #6366f1;
  --cca-primary-hover: #4f46e5;
  --cca-primary-active: #4338ca;
  --cca-primary-light: rgba(99, 102, 241, 0.1);
  --cca-primary-lighter: rgba(99, 102, 241, 0.05);
  
  /* Secondary - Supporting accent */
  --cca-secondary: #10b981;
  --cca-secondary-hover: #059669;
  --cca-secondary-light: rgba(16, 185, 129, 0.1);
  
  /* Accent - Highlights, badges */
  --cca-accent: #f59e0b;
  --cca-accent-light: rgba(245, 158, 11, 0.1);
  
  /* Backgrounds */
  --cca-bg: #ffffff;
  --cca-bg-alt: #f8fafc;
  --cca-bg-elevated: #ffffff;
  --cca-bg-overlay: rgba(0, 0, 0, 0.5);
  
  /* Surfaces (cards, modals, etc.) */
  --cca-surface: #ffffff;
  --cca-surface-hover: #f8fafc;
  --cca-surface-active: #f1f5f9;
  --cca-surface-elevated: #ffffff;
  
  /* Text */
  --cca-text: #0f172a;
  --cca-text-secondary: #475569;
  --cca-text-muted: #94a3b8;
  --cca-text-inverse: #ffffff;
  --cca-text-link: var(--cca-primary);
  
  /* Borders */
  --cca-border: #e2e8f0;
  --cca-border-hover: #cbd5e1;
  --cca-border-focus: var(--cca-primary);
  --cca-border-light: #f1f5f9;
  
  /* Status Colors */
  --cca-success: #10b981;
  --cca-success-light: rgba(16, 185, 129, 0.1);
  --cca-warning: #f59e0b;
  --cca-warning-light: rgba(245, 158, 11, 0.1);
  --cca-error: #ef4444;
  --cca-error-light: rgba(239, 68, 68, 0.1);
  --cca-info: #3b82f6;
  --cca-info-light: rgba(59, 130, 246, 0.1);
  
  /* ─────────────────────────────────────────────────────────────────────────
     TYPOGRAPHY
     ───────────────────────────────────────────────────────────────────────── */
  
  /* Font Families */
  --cca-font-display: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --cca-font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --cca-font-mono: 'JetBrains Mono', 'Fira Code', 'SF Mono', Consolas, monospace;
  
  /* Font Sizes - Using a modular scale (1.25 ratio) */
  --cca-text-xs: 0.75rem;     /* 12px */
  --cca-text-sm: 0.875rem;    /* 14px */
  --cca-text-base: 1rem;      /* 16px */
  --cca-text-lg: 1.125rem;    /* 18px */
  --cca-text-xl: 1.25rem;     /* 20px */
  --cca-text-2xl: 1.5rem;     /* 24px */
  --cca-text-3xl: 1.875rem;   /* 30px */
  --cca-text-4xl: 2.25rem;    /* 36px */
  --cca-text-5xl: 3rem;       /* 48px */
  --cca-text-6xl: 3.75rem;    /* 60px */
  
  /* Font Weights */
  --cca-font-light: 300;
  --cca-font-normal: 400;
  --cca-font-medium: 500;
  --cca-font-semibold: 600;
  --cca-font-bold: 700;
  
  /* Line Heights */
  --cca-leading-none: 1;
  --cca-leading-tight: 1.25;
  --cca-leading-snug: 1.375;
  --cca-leading-normal: 1.5;
  --cca-leading-relaxed: 1.625;
  --cca-leading-loose: 2;
  
  /* Letter Spacing */
  --cca-tracking-tighter: -0.05em;
  --cca-tracking-tight: -0.025em;
  --cca-tracking-normal: 0;
  --cca-tracking-wide: 0.025em;
  --cca-tracking-wider: 0.05em;
  --cca-tracking-widest: 0.1em;
  
  /* ─────────────────────────────────────────────────────────────────────────
     SPACING SYSTEM (8px base)
     ───────────────────────────────────────────────────────────────────────── */
  
  --cca-space-0: 0;
  --cca-space-px: 1px;
  --cca-space-0\.5: 0.125rem;  /* 2px */
  --cca-space-1: 0.25rem;      /* 4px */
  --cca-space-1\.5: 0.375rem;  /* 6px */
  --cca-space-2: 0.5rem;       /* 8px */
  --cca-space-2\.5: 0.625rem;  /* 10px */
  --cca-space-3: 0.75rem;      /* 12px */
  --cca-space-3\.5: 0.875rem;  /* 14px */
  --cca-space-4: 1rem;         /* 16px */
  --cca-space-5: 1.25rem;      /* 20px */
  --cca-space-6: 1.5rem;       /* 24px */
  --cca-space-7: 1.75rem;      /* 28px */
  --cca-space-8: 2rem;         /* 32px */
  --cca-space-9: 2.25rem;      /* 36px */
  --cca-space-10: 2.5rem;      /* 40px */
  --cca-space-11: 2.75rem;     /* 44px */
  --cca-space-12: 3rem;        /* 48px */
  --cca-space-14: 3.5rem;      /* 56px */
  --cca-space-16: 4rem;        /* 64px */
  --cca-space-20: 5rem;        /* 80px */
  --cca-space-24: 6rem;        /* 96px */
  --cca-space-28: 7rem;        /* 112px */
  --cca-space-32: 8rem;        /* 128px */
  
  /* ─────────────────────────────────────────────────────────────────────────
     LAYOUT
     ───────────────────────────────────────────────────────────────────────── */
  
  --cca-max-width-xs: 20rem;     /* 320px */
  --cca-max-width-sm: 24rem;     /* 384px */
  --cca-max-width-md: 28rem;     /* 448px */
  --cca-max-width-lg: 32rem;     /* 512px */
  --cca-max-width-xl: 36rem;     /* 576px */
  --cca-max-width-2xl: 42rem;    /* 672px */
  --cca-max-width-3xl: 48rem;    /* 768px */
  --cca-max-width-4xl: 56rem;    /* 896px */
  --cca-max-width-5xl: 64rem;    /* 1024px */
  --cca-max-width-6xl: 72rem;    /* 1152px */
  --cca-max-width-7xl: 80rem;    /* 1280px */
  
  /* Quiz-specific layout */
  --cca-quiz-max-width: 720px;
  --cca-quiz-padding: var(--cca-space-6);
  --cca-question-gap: var(--cca-space-6);
  
  /* ─────────────────────────────────────────────────────────────────────────
     BORDERS & RADIUS
     ───────────────────────────────────────────────────────────────────────── */
  
  --cca-radius-none: 0;
  --cca-radius-sm: 0.25rem;     /* 4px */
  --cca-radius-md: 0.375rem;    /* 6px */
  --cca-radius-lg: 0.5rem;      /* 8px */
  --cca-radius-xl: 0.75rem;     /* 12px */
  --cca-radius-2xl: 1rem;       /* 16px */
  --cca-radius-3xl: 1.5rem;     /* 24px */
  --cca-radius-full: 9999px;
  
  /* Border widths */
  --cca-border-width: 1px;
  --cca-border-width-2: 2px;
  --cca-border-width-4: 4px;
  
  /* ─────────────────────────────────────────────────────────────────────────
     SHADOWS
     ───────────────────────────────────────────────────────────────────────── */
  
  --cca-shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --cca-shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
  --cca-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --cca-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --cca-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  --cca-shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  --cca-shadow-inner: inset 0 2px 4px 0 rgba(0, 0, 0, 0.05);
  
  /* Colored shadows for glow effects */
  --cca-shadow-glow: 0 0 40px rgba(99, 102, 241, 0.15);
  --cca-shadow-glow-lg: 0 0 60px rgba(99, 102, 241, 0.25);
  
  /* Option-specific shadows */
  --cca-shadow-option: 0 2px 8px rgba(0, 0, 0, 0.06);
  --cca-shadow-option-hover: 0 8px 24px rgba(0, 0, 0, 0.1);
  --cca-shadow-option-selected: 0 0 0 3px var(--cca-primary-light), 0 8px 24px rgba(0, 0, 0, 0.1);
  
  /* ─────────────────────────────────────────────────────────────────────────
     MOTION / ANIMATION
     ───────────────────────────────────────────────────────────────────────── */
  
  /* Durations */
  --cca-duration-instant: 50ms;
  --cca-duration-fast: 150ms;
  --cca-duration-normal: 250ms;
  --cca-duration-slow: 400ms;
  --cca-duration-slower: 600ms;
  --cca-duration-slowest: 1000ms;
  
  /* Easings */
  --cca-ease-linear: linear;
  --cca-ease-in: cubic-bezier(0.4, 0, 1, 1);
  --cca-ease-out: cubic-bezier(0, 0, 0.2, 1);
  --cca-ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --cca-ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --cca-ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
  
  /* Common transitions */
  --cca-transition-colors: color var(--cca-duration-fast) var(--cca-ease-out),
                           background-color var(--cca-duration-fast) var(--cca-ease-out),
                           border-color var(--cca-duration-fast) var(--cca-ease-out);
  --cca-transition-transform: transform var(--cca-duration-normal) var(--cca-ease-out);
  --cca-transition-shadow: box-shadow var(--cca-duration-normal) var(--cca-ease-out);
  --cca-transition-all: all var(--cca-duration-normal) var(--cca-ease-out);
  
  /* ─────────────────────────────────────────────────────────────────────────
     Z-INDEX SCALE
     ───────────────────────────────────────────────────────────────────────── */
  
  --cca-z-base: 0;
  --cca-z-dropdown: 100;
  --cca-z-sticky: 200;
  --cca-z-fixed: 300;
  --cca-z-modal-backdrop: 400;
  --cca-z-modal: 500;
  --cca-z-popover: 600;
  --cca-z-tooltip: 700;
  --cca-z-notification: 800;
  
  /* ─────────────────────────────────────────────────────────────────────────
     BACKGROUND EFFECTS
     ───────────────────────────────────────────────────────────────────────── */
  
  --cca-bg-gradient: none;
  --cca-bg-pattern: none;
  --cca-bg-image: none;
  --cca-bg-image-overlay: linear-gradient(to bottom, rgba(255,255,255,0.9), rgba(255,255,255,0.95));
}


/* ═══════════════════════════════════════════════════════════════════════════
   THEME: SERENE CLINICAL
   Clean, trustworthy, medical-grade
   ═══════════════════════════════════════════════════════════════════════════ */

[data-cca-theme="serene-clinical"] {
  /* Colors */
  --cca-primary: #0ea5e9;
  --cca-primary-hover: #0284c7;
  --cca-primary-active: #0369a1;
  --cca-primary-light: rgba(14, 165, 233, 0.1);
  --cca-primary-lighter: rgba(14, 165, 233, 0.05);
  
  --cca-secondary: #10b981;
  --cca-accent: #06b6d4;
  
  --cca-bg: #f0f9ff;
  --cca-bg-alt: #e0f2fe;
  --cca-surface: #ffffff;
  
  --cca-text: #0c4a6e;
  --cca-text-secondary: #0369a1;
  --cca-text-muted: #7dd3fc;
  
  --cca-border: #bae6fd;
  --cca-border-hover: #7dd3fc;
  
  /* Typography */
  --cca-font-display: 'DM Sans', -apple-system, system-ui, sans-serif;
  --cca-font-body: 'Inter', -apple-system, system-ui, sans-serif;
  
  /* Radius - Softer, friendlier */
  --cca-radius-lg: 1rem;
  --cca-radius-xl: 1.25rem;
  --cca-radius-2xl: 1.5rem;
  
  /* Shadows - Subtle blue tint */
  --cca-shadow-option: 0 2px 12px rgba(14, 165, 233, 0.08);
  --cca-shadow-option-hover: 0 8px 24px rgba(14, 165, 233, 0.12);
  --cca-shadow-option-selected: 0 0 0 3px rgba(14, 165, 233, 0.2), 0 8px 24px rgba(14, 165, 233, 0.15);
  --cca-shadow-glow: 0 0 40px rgba(14, 165, 233, 0.2);
  
  /* Background */
  --cca-bg-gradient: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 50%, #f0f9ff 100%);
}


/* ═══════════════════════════════════════════════════════════════════════════
   THEME: MIDNIGHT AURORA
   Dark, elegant, premium
   ═══════════════════════════════════════════════════════════════════════════ */

[data-cca-theme="midnight-aurora"] {
  /* Colors */
  --cca-primary: #a78bfa;
  --cca-primary-hover: #8b5cf6;
  --cca-primary-active: #7c3aed;
  --cca-primary-light: rgba(167, 139, 250, 0.15);
  --cca-primary-lighter: rgba(167, 139, 250, 0.08);
  
  --cca-secondary: #22d3ee;
  --cca-accent: #f472b6;
  
  --cca-bg: #0f0d1a;
  --cca-bg-alt: #1e1b4b;
  --cca-surface: rgba(255, 255, 255, 0.05);
  --cca-surface-hover: rgba(255, 255, 255, 0.08);
  --cca-surface-active: rgba(255, 255, 255, 0.1);
  --cca-surface-elevated: rgba(255, 255, 255, 0.08);
  --cca-bg-overlay: rgba(0, 0, 0, 0.7);
  
  --cca-text: #f8fafc;
  --cca-text-secondary: #c4b5fd;
  --cca-text-muted: #a78bfa;
  --cca-text-inverse: #0f0d1a;
  
  --cca-border: rgba(167, 139, 250, 0.2);
  --cca-border-hover: rgba(167, 139, 250, 0.4);
  --cca-border-focus: #a78bfa;
  
  /* Typography */
  --cca-font-display: 'Outfit', -apple-system, system-ui, sans-serif;
  
  /* Shadows - Glowing */
  --cca-shadow-option: 0 4px 20px rgba(0, 0, 0, 0.4);
  --cca-shadow-option-hover: 0 8px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(167, 139, 250, 0.2);
  --cca-shadow-option-selected: 0 0 0 2px var(--cca-primary), 0 0 40px rgba(167, 139, 250, 0.4);
  --cca-shadow-glow: 0 0 60px rgba(167, 139, 250, 0.3);
  --cca-shadow-glow-lg: 0 0 100px rgba(167, 139, 250, 0.4);
  
  /* Background */
  --cca-bg-gradient: linear-gradient(135deg, #0f0d1a 0%, #1e1b4b 50%, #0f172a 100%);
  --cca-bg-pattern: radial-gradient(circle at 20% 80%, rgba(167, 139, 250, 0.15) 0%, transparent 40%),
                    radial-gradient(circle at 80% 20%, rgba(34, 211, 238, 0.1) 0%, transparent 40%);
}


/* ═══════════════════════════════════════════════════════════════════════════
   THEME: WARM WELLNESS
   Calming, inviting, holistic
   ═══════════════════════════════════════════════════════════════════════════ */

[data-cca-theme="warm-wellness"] {
  /* Colors */
  --cca-primary: #f97316;
  --cca-primary-hover: #ea580c;
  --cca-primary-active: #c2410c;
  --cca-primary-light: rgba(249, 115, 22, 0.1);
  --cca-primary-lighter: rgba(249, 115, 22, 0.05);
  
  --cca-secondary: #84cc16;
  --cca-accent: #eab308;
  
  --cca-bg: #fffbeb;
  --cca-bg-alt: #fef3c7;
  --cca-surface: #ffffff;
  
  --cca-text: #422006;
  --cca-text-secondary: #92400e;
  --cca-text-muted: #d97706;
  
  --cca-border: #fed7aa;
  --cca-border-hover: #fdba74;
  
  /* Typography */
  --cca-font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --cca-font-body: 'Outfit', -apple-system, system-ui, sans-serif;
  
  /* Radius - Rounder, organic */
  --cca-radius-lg: 1.5rem;
  --cca-radius-xl: 2rem;
  --cca-radius-2xl: 2.5rem;
  
  /* Shadows - Warm tint */
  --cca-shadow-option: 0 2px 12px rgba(249, 115, 22, 0.08);
  --cca-shadow-option-hover: 0 8px 24px rgba(249, 115, 22, 0.12);
  --cca-shadow-option-selected: 0 0 0 3px rgba(249, 115, 22, 0.2), 0 8px 24px rgba(249, 115, 22, 0.15);
  --cca-shadow-glow: 0 0 40px rgba(249, 115, 22, 0.2);
  
  /* Background */
  --cca-bg-gradient: linear-gradient(180deg, #fffbeb 0%, #fef3c7 50%, #fffbeb 100%);
}


/* ═══════════════════════════════════════════════════════════════════════════
   THEME: NEURAL NETWORK
   Futuristic, AI-inspired, tech-forward
   ═══════════════════════════════════════════════════════════════════════════ */

[data-cca-theme="neural-network"] {
  /* Colors */
  --cca-primary: #06b6d4;
  --cca-primary-hover: #0891b2;
  --cca-primary-active: #0e7490;
  --cca-primary-light: rgba(6, 182, 212, 0.15);
  --cca-primary-lighter: rgba(6, 182, 212, 0.08);
  
  --cca-secondary: #8b5cf6;
  --cca-accent: #10b981;
  
  --cca-bg: #020617;
  --cca-bg-alt: #0f172a;
  --cca-surface: rgba(6, 182, 212, 0.05);
  --cca-surface-hover: rgba(6, 182, 212, 0.08);
  --cca-surface-active: rgba(6, 182, 212, 0.12);
  --cca-surface-elevated: rgba(6, 182, 212, 0.08);
  
  --cca-text: #e2e8f0;
  --cca-text-secondary: #06b6d4;
  --cca-text-muted: #0891b2;
  --cca-text-inverse: #020617;
  
  --cca-border: rgba(6, 182, 212, 0.3);
  --cca-border-hover: rgba(6, 182, 212, 0.5);
  --cca-border-focus: #06b6d4;
  
  /* Typography */
  --cca-font-display: 'Space Grotesk', -apple-system, system-ui, sans-serif;
  --cca-font-body: 'IBM Plex Sans', -apple-system, system-ui, sans-serif;
  --cca-font-mono: 'IBM Plex Mono', 'Fira Code', monospace;
  
  /* Shadows - Cyber glow */
  --cca-shadow-option: 0 4px 20px rgba(0, 0, 0, 0.4);
  --cca-shadow-option-hover: 0 0 30px rgba(6, 182, 212, 0.3);
  --cca-shadow-option-selected: 0 0 0 2px var(--cca-primary), 0 0 40px rgba(6, 182, 212, 0.4);
  --cca-shadow-glow: 0 0 60px rgba(6, 182, 212, 0.3);
  
  /* Background */
  --cca-bg-gradient: linear-gradient(135deg, #020617 0%, #0f172a 100%);
  --cca-bg-pattern: 
    radial-gradient(circle at 25% 25%, rgba(6, 182, 212, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 75% 75%, rgba(139, 92, 246, 0.1) 0%, transparent 50%);
}


/* ═══════════════════════════════════════════════════════════════════════════
   THEME: MINIMAL ZEN
   Ultra-clean, distraction-free, focused
   ═══════════════════════════════════════════════════════════════════════════ */

[data-cca-theme="minimal-zen"] {
  /* Colors - Monochrome */
  --cca-primary: #171717;
  --cca-primary-hover: #262626;
  --cca-primary-active: #404040;
  --cca-primary-light: rgba(23, 23, 23, 0.05);
  --cca-primary-lighter: rgba(23, 23, 23, 0.02);
  
  --cca-secondary: #525252;
  --cca-accent: #171717;
  
  --cca-bg: #fafafa;
  --cca-bg-alt: #f5f5f5;
  --cca-surface: #ffffff;
  
  --cca-text: #171717;
  --cca-text-secondary: #404040;
  --cca-text-muted: #737373;
  
  --cca-border: #e5e5e5;
  --cca-border-hover: #d4d4d4;
  
  /* Typography */
  --cca-font-display: 'Sora', -apple-system, system-ui, sans-serif;
  --cca-font-body: 'Inter', -apple-system, system-ui, sans-serif;
  
  /* Radius - Sharp, minimal */
  --cca-radius-sm: 0.125rem;
  --cca-radius-md: 0.25rem;
  --cca-radius-lg: 0.375rem;
  --cca-radius-xl: 0.5rem;
  --cca-radius-2xl: 0.75rem;
  
  /* Shadows - Subtle */
  --cca-shadow-option: none;
  --cca-shadow-option-hover: 0 0 0 1px var(--cca-border);
  --cca-shadow-option-selected: 0 0 0 2px var(--cca-primary);
  --cca-shadow-glow: none;
}


/* ═══════════════════════════════════════════════════════════════════════════
   GOOGLE FONTS LOADER
   Fonts are loaded dynamically based on theme
   ═══════════════════════════════════════════════════════════════════════════ */

/* Default fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@300;400;500;600;700&display=swap');

/* Theme-specific fonts - loaded conditionally */
/* Serene Clinical */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&display=swap');

/* Warm Wellness */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:wght@400;500;600;700&display=swap');

/* Neural Network */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=IBM+Plex+Sans:wght@400;500;600&family=IBM+Plex+Mono:wght@400;500&display=swap');

/* Minimal Zen */
@import url('https://fonts.googleapis.com/css2?family=Sora:wght@300;400;500;600;700&display=swap');

