/**
 * Friktionskompasset Design Tokens
 * Nordic Clarity Design System
 *
 * Usage: Import this file FIRST in all stylesheets
 */

:root {
  /* ============================================
   * TYPOGRAPHY
   * ============================================ */
  --font-heading: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, monospace;

  /* Font Sizes */
  --text-xs: 0.75rem;     /* 12px */
  --text-sm: 0.875rem;    /* 14px */
  --text-base: 1rem;      /* 16px */
  --text-lg: 1.125rem;    /* 18px */
  --text-xl: 1.25rem;     /* 20px */
  --text-2xl: 1.5rem;     /* 24px */
  --text-3xl: 1.875rem;   /* 30px */
  --text-4xl: 2.25rem;    /* 36px */
  --text-5xl: 3rem;       /* 48px */

  /* Font Weights */
  --font-normal: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;

  /* Line Heights */
  --leading-none: 1;
  --leading-tight: 1.25;
  --leading-snug: 1.375;
  --leading-normal: 1.5;
  --leading-relaxed: 1.625;
  --leading-loose: 2;

  /* ============================================
   * NORDIC INDIGO PALETTE
   * Primary brand color with depth
   * ============================================ */
  --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;  /* Main primary */
  --color-primary-700: #4338ca;
  --color-primary-800: #3730a3;
  --color-primary-900: #312e81;

  /* Primary shortcuts */
  --color-primary: var(--color-primary-600);
  --color-primary-hover: var(--color-primary-700);
  --color-primary-light: var(--color-primary-50);
  --color-primary-dark: var(--color-primary-800);

  /* ============================================
   * SEMANTIC COLORS - SCORE SYSTEM
   * CRITICAL: 7-point Likert scale thresholds
   * Green: >= 4.9 (70%+)
   * Yellow: >= 3.5, < 4.9 (50-70%)
   * Red: < 3.5 (<50%)
   * ============================================ */

  /* Green - Good/Success (>= 4.9) */
  --score-green-50: #ecfdf5;
  --score-green-100: #d1fae5;
  --score-green-200: #a7f3d0;
  --score-green-500: #10b981;
  --score-green-600: #059669;
  --score-green-700: #047857;
  --score-green: var(--score-green-600);
  --score-green-light: var(--score-green-100);
  --score-green-text: #065f46;

  /* Yellow - Warning/Caution (>= 3.5, < 4.9) */
  --score-yellow-50: #fffbeb;
  --score-yellow-100: #fef3c7;
  --score-yellow-200: #fde68a;
  --score-yellow-500: #f59e0b;
  --score-yellow-600: #d97706;
  --score-yellow-700: #b45309;
  --score-yellow: var(--score-yellow-600);
  --score-yellow-light: var(--score-yellow-100);
  --score-yellow-text: #92400e;

  /* Red - Crisis/Danger (< 3.5) */
  --score-red-50: #fef2f2;
  --score-red-100: #fee2e2;
  --score-red-200: #fecaca;
  --score-red-500: #ef4444;
  --score-red-600: #dc2626;
  --score-red-700: #b91c1c;
  --score-red: var(--score-red-600);
  --score-red-light: var(--score-red-100);
  --score-red-text: #991b1b;

  /* Legacy semantic aliases */
  --color-success: var(--score-green);
  --color-warning: var(--score-yellow);
  --color-danger: var(--score-red);

  /* ============================================
   * NEUTRAL GRAYS
   * Cool-toned for Nordic feel
   * ============================================ */
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;
  --gray-950: #020617;

  /* Background shortcuts */
  --bg-primary: #ffffff;
  --bg-secondary: var(--gray-50);
  --bg-tertiary: var(--gray-100);
  --bg-dark: var(--gray-900);

  /* Text shortcuts */
  --text-primary: var(--gray-900);
  --text-secondary: var(--gray-600);
  --text-tertiary: var(--gray-500);
  --text-muted: var(--gray-400);
  --text-inverse: #ffffff;

  /* Border shortcuts */
  --border-light: var(--gray-200);
  --border-default: var(--gray-300);
  --border-dark: var(--gray-400);

  /* ============================================
   * ACCENT COLORS
   * For data visualization and UI elements
   * ============================================ */
  --accent-blue: #3b82f6;
  --accent-cyan: #06b6d4;
  --accent-teal: #14b8a6;
  --accent-purple: #8b5cf6;
  --accent-pink: #ec4899;
  --accent-orange: #f97316;

  /* ============================================
   * SHADOWS
   * Subtle, refined Nordic shadows
   * ============================================ */
  --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);

  /* Colored shadows for cards */
  --shadow-primary: 0 4px 14px 0 rgb(79 70 229 / 0.15);
  --shadow-success: 0 4px 14px 0 rgb(5 150 105 / 0.15);
  --shadow-warning: 0 4px 14px 0 rgb(217 119 6 / 0.15);
  --shadow-danger: 0 4px 14px 0 rgb(220 38 38 / 0.15);

  /* Inner shadows */
  --shadow-inner: inset 0 2px 4px 0 rgb(0 0 0 / 0.05);

  /* ============================================
   * SPACING
   * Consistent spacing scale
   * ============================================ */
  --space-0: 0;
  --space-px: 1px;
  --space-0-5: 0.125rem;  /* 2px */
  --space-1: 0.25rem;     /* 4px */
  --space-1-5: 0.375rem;  /* 6px */
  --space-2: 0.5rem;      /* 8px */
  --space-2-5: 0.625rem;  /* 10px */
  --space-3: 0.75rem;     /* 12px */
  --space-3-5: 0.875rem;  /* 14px */
  --space-4: 1rem;        /* 16px */
  --space-5: 1.25rem;     /* 20px */
  --space-6: 1.5rem;      /* 24px */
  --space-7: 1.75rem;     /* 28px */
  --space-8: 2rem;        /* 32px */
  --space-9: 2.25rem;     /* 36px */
  --space-10: 2.5rem;     /* 40px */
  --space-11: 2.75rem;    /* 44px */
  --space-12: 3rem;       /* 48px */
  --space-14: 3.5rem;     /* 56px */
  --space-16: 4rem;       /* 64px */
  --space-20: 5rem;       /* 80px */
  --space-24: 6rem;       /* 96px */
  --space-28: 7rem;       /* 112px */
  --space-32: 8rem;       /* 128px */

  /* ============================================
   * BORDER RADIUS
   * Soft, modern corners
   * ============================================ */
  --radius-none: 0;
  --radius-sm: 0.25rem;   /* 4px */
  --radius-default: 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;

  /* ============================================
   * TRANSITIONS
   * Smooth, purposeful motion
   * ============================================ */
  --transition-none: none;
  --transition-all: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-default: all 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-colors: color 150ms ease, background-color 150ms ease, border-color 150ms ease;
  --transition-opacity: opacity 150ms ease;
  --transition-shadow: box-shadow 150ms ease;
  --transition-transform: transform 200ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Timing functions */
  --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);

  /* Durations */
  --duration-75: 75ms;
  --duration-100: 100ms;
  --duration-150: 150ms;
  --duration-200: 200ms;
  --duration-300: 300ms;
  --duration-500: 500ms;
  --duration-700: 700ms;
  --duration-1000: 1000ms;

  /* ============================================
   * Z-INDEX SCALE
   * Predictable stacking
   * ============================================ */
  --z-0: 0;
  --z-10: 10;
  --z-20: 20;
  --z-30: 30;
  --z-40: 40;
  --z-50: 50;
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-modal-backdrop: 1040;
  --z-modal: 1050;
  --z-popover: 1060;
  --z-tooltip: 1070;
  --z-toast: 1080;

  /* ============================================
   * CONTAINER WIDTHS
   * Responsive breakpoints
   * ============================================ */
  --container-sm: 640px;
  --container-md: 768px;
  --container-lg: 1024px;
  --container-xl: 1280px;
  --container-2xl: 1536px;

  /* ============================================
   * GLASSMORPHISM
   * Modern frosted glass effect
   * ============================================ */
  --glass-bg: rgba(255, 255, 255, 0.8);
  --glass-bg-dark: rgba(15, 23, 42, 0.8);
  --glass-blur: blur(12px);
  --glass-border: 1px solid rgba(255, 255, 255, 0.2);
}

/* ============================================
 * DARK MODE SUPPORT (Future)
 * ============================================ */
@media (prefers-color-scheme: dark) {
  :root.auto-dark {
    --bg-primary: var(--gray-900);
    --bg-secondary: var(--gray-800);
    --bg-tertiary: var(--gray-700);
    --text-primary: var(--gray-50);
    --text-secondary: var(--gray-300);
    --border-light: var(--gray-700);
    --border-default: var(--gray-600);
  }
}

/* ============================================
 * REDUCED MOTION
 * Respect user preferences
 * ============================================ */
@media (prefers-reduced-motion: reduce) {
  :root {
    --transition-all: none;
    --transition-default: none;
    --transition-colors: none;
    --transition-opacity: none;
    --transition-shadow: none;
    --transition-transform: none;
  }
}
