/**
 * 🎨 DESIGN TOKENS
 * Unified design system for Font Scanner Suite
 * Version: 2.0 - Business-Ready Streamline
 * 
 * Usage: Import this before styles.css in all HTML files
 * <link rel="stylesheet" href="/design-tokens.css">
 */

:root {
  /* ========================================
     COLORS - SEMANTIC SYSTEM
     ======================================== */
  
  /* Primary Brand Colors */
  --color-primary: #00FF9D;           /* Bright teal - CTAs, active states */
  --color-primary-hover: #00E68A;     /* Slightly darker for hover */
  --color-primary-dim: rgba(0, 255, 157, 0.1);  /* Subtle backgrounds */
  
  --color-secondary: #0AFFEF;         /* Cyan - Accents, highlights */
  --color-secondary-hover: #00D9CF;
  --color-secondary-dim: rgba(10, 255, 239, 0.1);
  
  /* Semantic State Colors */
  --color-success: #0FFF73;           /* Green - Pass, excellent */
  --color-warning: #FFB84D;           /* Orange - Needs improvement */
  --color-error: #FF4D4D;             /* Red - Critical, failed */
  --color-info: #4D9FFF;              /* Blue - Information */
  
  /* Performance Score Colors (legacy compatibility) */
  --color-excellent: #0FFF73;         /* 90-100 */
  --color-good: #7FFF7F;              /* 70-89 */
  --color-fair: #FFB84D;              /* 50-69 */
  --color-poor: #FF6B6B;              /* 30-49 */
  --color-failing: #FF4D4D;           /* 0-29 */
  
  /* Grayscale */
  --color-white: #FFFFFF;
  --color-gray-100: #F5F5F5;
  --color-gray-200: #E5E5E5;
  --color-gray-300: #D4D4D4;
  --color-gray-400: #A3A3A3;
  --color-gray-500: #737373;
  --color-gray-600: #525252;
  --color-gray-700: #404040;
  --color-gray-800: #262626;
  --color-gray-900: #171717;
  --color-black: #000000;
  
  /* ========================================
     BACKGROUNDS
     ======================================== */
  
  /* Base Backgrounds */
  --bg-base: #0B0D10;                 /* Main page background */
  --bg-elevated: #111418;             /* Cards, panels */
  --bg-card: #161A1F;                 /* Individual cards */
  --bg-input: #1A1E23;                /* Input fields */
  --bg-overlay: rgba(11, 13, 16, 0.95); /* Modals */
  
  /* Gradient Backgrounds */
  --bg-gradient-primary: linear-gradient(135deg, rgba(0, 255, 157, 0.1), rgba(10, 255, 239, 0.05));
  --bg-gradient-success: linear-gradient(135deg, rgba(15, 255, 115, 0.1), rgba(0, 255, 157, 0.05));
  --bg-gradient-warning: linear-gradient(135deg, rgba(255, 184, 77, 0.15), rgba(255, 104, 68, 0.1));
  --bg-gradient-error: linear-gradient(135deg, rgba(255, 77, 77, 0.15), rgba(255, 68, 68, 0.1));
  --bg-gradient-dark: linear-gradient(180deg, #0B0D10 0%, #111418 100%);
  
  /* ========================================
     BORDERS
     ======================================== */
  
  --border-color: rgba(255, 255, 255, 0.08);        /* Default borders */
  --border-color-strong: rgba(255, 255, 255, 0.15); /* Emphasized borders */
  --border-color-subtle: rgba(255, 255, 255, 0.05); /* Very subtle dividers */
  
  /* Semantic Borders */
  --border-primary: 2px solid var(--color-primary);
  --border-success: 2px solid var(--color-success);
  --border-warning: 2px solid var(--color-warning);
  --border-error: 2px solid var(--color-error);
  
  /* ========================================
     SPACING SCALE
     Based on 8px base unit
     ======================================== */
  
  --space-0: 0;
  --space-1: 4px;     /* 0.25rem */
  --space-2: 8px;     /* 0.5rem */
  --space-3: 12px;    /* 0.75rem */
  --space-4: 16px;    /* 1rem */
  --space-5: 20px;    /* 1.25rem */
  --space-6: 24px;    /* 1.5rem */
  --space-8: 32px;    /* 2rem */
  --space-10: 40px;   /* 2.5rem */
  --space-12: 48px;   /* 3rem */
  --space-16: 64px;   /* 4rem */
  --space-20: 80px;   /* 5rem */
  --space-24: 96px;   /* 6rem */
  
  /* Semantic Spacing */
  --space-xs: var(--space-2);   /* 8px */
  --space-sm: var(--space-4);   /* 16px */
  --space-md: var(--space-6);   /* 24px */
  --space-lg: var(--space-8);   /* 32px */
  --space-xl: var(--space-12);  /* 48px */
  --space-2xl: var(--space-16); /* 64px */
  
  /* Standard Card Padding */
  --card-padding: var(--space-8);  /* 32px / 2rem */
  
  /* ========================================
     TYPOGRAPHY
     ======================================== */
  
  /* Font Families */
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
  
  /* 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: 2rem;       /* 32px */
  --text-4xl: 2.5rem;     /* 40px */
  --text-5xl: 3rem;       /* 48px */
  
  /* Font Weights */
  --font-weight-light: 300;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  --font-weight-black: 900;
  
  /* Line Heights */
  --leading-none: 1;
  --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;
  
  /* ========================================
     SHADOWS & GLOWS
     ======================================== */
  
  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 12px 24px rgba(0, 0, 0, 0.6);
  --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.7);
  --shadow-2xl: 0 25px 50px rgba(0, 0, 0, 0.8);
  
  /* Glows (for interactive elements) */
  --glow-primary: 0 0 8px rgba(0, 255, 157, 0.4);
  --glow-primary-strong: 0 0 16px rgba(0, 255, 157, 0.6);
  --glow-secondary: 0 0 8px rgba(10, 255, 239, 0.4);
  --glow-success: 0 0 8px rgba(15, 255, 115, 0.4);
  --glow-warning: 0 0 8px rgba(255, 184, 77, 0.4);
  --glow-error: 0 0 8px rgba(255, 77, 77, 0.4);
  
  /* ========================================
     BORDER RADIUS
     ======================================== */
  
  --radius-none: 0;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 24px;
  --radius-full: 9999px;
  
  /* ========================================
     Z-INDEX SCALE
     ======================================== */
  
  --z-0: 0;
  --z-10: 10;
  --z-20: 20;
  --z-30: 30;
  --z-40: 40;
  --z-50: 50;
  
  /* Semantic Z-Index */
  --z-base: var(--z-0);
  --z-dropdown: var(--z-10);
  --z-sticky: var(--z-20);
  --z-fixed: var(--z-30);
  --z-modal: var(--z-40);
  --z-toast: var(--z-50);
  
  /* ========================================
     TRANSITIONS & ANIMATIONS
     ======================================== */
  
  /* Durations */
  --duration-fast: 150ms;
  --duration-base: 250ms;
  --duration-slow: 350ms;
  --duration-slower: 500ms;
  
  /* Easing 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);
  
  /* Common Transitions */
  --transition-colors: color var(--duration-base) var(--ease-in-out),
                       background-color var(--duration-base) var(--ease-in-out),
                       border-color var(--duration-base) var(--ease-in-out);
  --transition-transform: transform var(--duration-base) var(--ease-out);
  --transition-opacity: opacity var(--duration-base) var(--ease-in-out);
  --transition-all: all var(--duration-base) var(--ease-in-out);
  
  /* ========================================
     LAYOUT
     ======================================== */
  
  /* Container Widths */
  --container-sm: 640px;
  --container-md: 768px;
  --container-lg: 1024px;
  --container-xl: 1280px;
  --container-2xl: 1400px;
  
  /* Grid */
  --grid-columns: 12;
  --grid-gap: var(--space-6);  /* 24px */
  
  /* Breakpoints (for reference in JS) */
  --breakpoint-sm: 640px;
  --breakpoint-md: 768px;
  --breakpoint-lg: 1024px;
  --breakpoint-xl: 1280px;
  --breakpoint-2xl: 1536px;
  
  /* ========================================
     COMPONENT TOKENS
     ======================================== */
  
  /* Buttons */
  --btn-padding-x: var(--space-6);
  --btn-padding-y: var(--space-3);
  --btn-radius: var(--radius-md);
  --btn-font-size: var(--text-base);
  --btn-font-weight: var(--font-weight-semibold);
  
  /* Inputs */
  --input-padding-x: var(--space-4);
  --input-padding-y: var(--space-3);
  --input-radius: var(--radius-md);
  --input-border: 1px solid var(--border-color);
  --input-font-size: var(--text-base);
  
  /* Cards */
  --card-radius: var(--radius-lg);
  --card-shadow: var(--shadow-md);
  --card-border: 1px solid var(--border-color);
  
  /* ========================================
     ACCESSIBILITY
     ======================================== */
  
  /* Focus Rings */
  --focus-ring: 0 0 0 3px rgba(0, 255, 157, 0.3);
  --focus-ring-offset: 2px;
  
  /* Touch Targets (WCAG 2.1 Level AAA) */
  --touch-target-min: 48px;
}

/* ========================================
   LIGHT MODE OVERRIDES
   (Optional - currently dark-only)
   ======================================== */

@media (prefers-color-scheme: light) {
  /* Add light mode tokens here if needed */
}

/* ========================================
   REDUCED MOTION
   ======================================== */

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

/* ========================================
   FONT LOADING
   ======================================== */

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

/* JetBrains Mono (existing) */
/* Already loaded in styles.css - no need to duplicate */

/* ========================================
   UTILITY CLASSES
   ======================================== */

/* Container */
.container {
  width: 100%;
  max-width: var(--container-2xl);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-4);
  padding-right: var(--space-4);
}

/* Card Base */
.card {
  background: var(--bg-card);
  border: var(--card-border);
  border-radius: var(--card-radius);
  padding: var(--card-padding);
  box-shadow: var(--card-shadow);
}

/* Grid System */
.grid {
  display: grid;
  gap: var(--grid-gap);
}

.grid-cols-1 { grid-template-columns: repeat(1, 1fr); }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid-cols-12 { grid-template-columns: repeat(12, 1fr); }

/* Responsive Grid */
@media (max-width: 768px) {
  .grid-cols-2,
  .grid-cols-3,
  .grid-cols-4,
  .grid-cols-12 {
    grid-template-columns: 1fr;
  }
}

/* Flex Utilities */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }

/* Typography Utilities */
.font-mono { font-family: var(--font-mono); }
.font-sans { font-family: var(--font-sans); }

.text-xs { font-size: var(--text-xs); }
.text-sm { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-lg { font-size: var(--text-lg); }
.text-xl { font-size: var(--text-xl); }
.text-2xl { font-size: var(--text-2xl); }
.text-3xl { font-size: var(--text-3xl); }

.font-normal { font-weight: var(--font-weight-normal); }
.font-medium { font-weight: var(--font-weight-medium); }
.font-semibold { font-weight: var(--font-weight-semibold); }
.font-bold { font-weight: var(--font-weight-bold); }

/* Color Utilities */
.text-primary { color: var(--color-primary); }
.text-secondary { color: var(--color-secondary); }
.text-success { color: var(--color-success); }
.text-warning { color: var(--color-warning); }
.text-error { color: var(--color-error); }

/* Glow Effects */
.glow-primary { box-shadow: var(--glow-primary); }
.glow-secondary { box-shadow: var(--glow-secondary); }

/* Focus States */
.focus-ring:focus {
  outline: none;
  box-shadow: var(--focus-ring);
  outline-offset: var(--focus-ring-offset);
}
