/**
 * ==========================================================================
 * VERIMUS DESIGN SYSTEM - DESIGN TOKENS
 * ==========================================================================
 * 
 * This file is the SINGLE SOURCE OF TRUTH for all design tokens.
 * All other CSS files should reference these variables.
 * 
 * DO NOT define CSS custom properties elsewhere - import this file instead.
 * 
 * Table of Contents:
 * 1. Colors - Brand
 * 2. Colors - Grayscale
 * 3. Colors - Status/Semantic
 * 4. Colors - Dark Mode
 * 5. Breakpoints (Reference)
 * 6. Typography - Font Sizes
 * 7. Typography - Font Weights
 * 8. Typography - Line Heights
 * 9. Typography - Text Colors
 * 10. Spacing Scale
 * 11. Border Radius Scale
 * 12. Shadows
 * 13. Z-Index Scale
 * 14. Transitions
 * 15. Form Elements
 * 16. Buttons
 * 17. Tags/Badges
 * 18. Icons
 * 19. Cards
 * 20. Borders
 * ==========================================================================
 */

:root {
  /* ==========================================================================
     1. COLORS - BRAND
     ========================================================================== */
  --color-primary: #FF8030;
  --color-primary-hover: #FFA800;
  --color-primary-dark: #E66A20;
  --color-primary-light: #FEF2ED;
  --color-secondary: #1F2937;
  --color-secondary-hover: #374151;
  --color-accent: #FFB300;
  --color-neutral: #DFE8F6;
  
  /* Legacy aliases (for backward compatibility) */
  --main: var(--color-primary);
  --main-hover: var(--color-primary-hover);
  --charcoal: var(--color-secondary);
  --noice-btn: var(--color-accent);

  /* ==========================================================================
     2. COLORS - GRAYSCALE
     ========================================================================== */
  --gray-50: #FAFAFA;
  --gray-100: #F5F5F5;
  --gray-150: #E9EAEC;
  --gray-200: #E5E5E5;
  --gray-300: #D1D5DB;
  --gray-400: #687588;
  --gray-500: #737373;
  --gray-600: #525252;
  --gray-700: #404040;
  --gray-800: #262626;
  --gray-900: #171717;
  --gray-950: #070516;
  
  /* Legacy aliases (for backward compatibility) */
  --grayscale-50: var(--gray-50);
  --grayscale-100: var(--gray-100);
  --grayscale-150: var(--gray-150);
  --grayscale-200: var(--gray-200);
  --grayscale-300: var(--gray-300);
  --grayscale-400: var(--gray-400);
  --grayscale-500: var(--gray-500);
  --grayscale-800: var(--gray-800);
  --grayscale-900: var(--gray-900);
  --grayscale-950: var(--gray-950);

  /* White variations */
  --white: #FFFFFF;
  --white-100: #F9F9F9;
  --white-950: #F6F6F6;

  /* ==========================================================================
     3. COLORS - STATUS/SEMANTIC
     ========================================================================== */
  --color-success: #28A745;
  --color-success-light: #D4EDDA;
  --color-success-dark: #1E7E34;
  
  --color-error: #DC3545;
  --color-error-light: #F8D7DA;
  --color-error-dark: #BD2130;
  --color-error-bg: rgba(244, 67, 54, 0.1);
  
  --color-warning: #FFC107;
  --color-warning-light: #FFF3CD;
  --color-warning-dark: #D39E00;
  
  --color-info: #1E88E5;
  --color-info-light: #D1ECF1;
  --color-info-dark: #1565C0;
  
  /* Dark mode text colors (lighter shades for contrast on dark backgrounds) */
  --color-success-text-dark: #66BB6A;
  --color-warning-text-dark: #FFD54F;
  --color-error-text-dark: #EF5350;
  --color-info-text-dark: #64B5F6;
  
  /* Legacy aliases */
  --success: var(--color-success);
  --error: var(--color-error);
  --alert-error: #ED544E;
  --bg-error: var(--color-error-bg);
  --blue-900: var(--color-info);

  /* ==========================================================================
     4. COLORS - DARK MODE
     ========================================================================== */
  --dark-bg-primary: #1A1A1A;
  --dark-bg-secondary: #2D2D2D;
  --dark-bg-tertiary: #4D4D4D;
  --dark-border: rgba(255, 255, 255, 0.1);
  --dark-text-primary: #FFFFFF;
  --dark-text-secondary: #A0A0A0;
  --dark-text-muted: #6B6B6B;

  /* Onboarding Flow (special dark theme) */
  --onboarding-primary: #141032;
  --onboarding-primary-light: #1E1848;
  --onboarding-primary-dark: #0C0A1F;

  /* ==========================================================================
     5. BREAKPOINTS (Reference Only)
     ==========================================================================
     CSS custom properties CANNOT be used in @media queries.
     These exist as documentation + for JS access via getComputedStyle().
     
     CONVENTION: Mobile-first (min-width) for building UP.
                 Use max-width ONLY for mobile-down overrides.
     
     Canonical breakpoints — use ONLY these values in media queries:
     
     | Token | Value  | Media Query                       | Purpose                          |
     |-------|--------|-----------------------------------|----------------------------------|
     | xs    | 480px  | @media (max-width: 480px)         | Very small phones                |
     | sm    | 767px  | @media (max-width: 767px)         | Mobile-down (sidebar hidden)     |
     | md    | 768px  | @media (min-width: 768px)         | Tablet+ (sidebar visible)        |
     | lg    | 1024px | @media (min-width: 1024px)        | Desktop+ (full layouts)          |
     | lgx   | 1200px | @media (min-width: 1200px)        | Sidebar breakpoint (overlay→inline) |
     | xl    | 1280px | @media (min-width: 1280px)        | Wide desktop (wide tables)       |
     | 2xl   | 1400px | @media (min-width: 1400px)        | Extra wide (max containers)      |
     
     Max-width companions (valid for range queries):
       1023px (below lg), 1199px (below lgx/sidebar), 1279px (below xl), 1399px (below 2xl)
     
     DO NOT use: 576px, 600px, 820px, 900px, 941px, 968px, 991px, 992px,
                 1060px, 1220px, 1275px, 1390px
     These are legacy values that should be migrated to the nearest standard.
     ========================================================================== */
  --bp-xs: 480px;
  --bp-sm: 767px;
  --bp-md: 768px;
  --bp-lg: 1024px;
  --bp-xl: 1280px;
  --bp-2xl: 1400px;

  /* ==========================================================================
     6. TYPOGRAPHY - FONT FAMILY
     ========================================================================== */
  --font-family-base: "Eudoxus", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-family-mono: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

  /* ==========================================================================
     6b. TYPOGRAPHY - FONT SIZES
     ========================================================================== */
  --font-size-2xs: 0.625rem;    /* 10px - tiny labels */
  --font-size-xs: 0.75rem;      /* 12px - fine print, timestamps, tags */
  --font-size-sm: 0.875rem;     /* 14px - body text, labels, buttons */
  --font-size-base: 1rem;       /* 16px - standard UI text */
  --font-size-lg: 1.125rem;     /* 18px - emphasized text */
  --font-size-xl: 1.25rem;      /* 20px - section headings */
  --font-size-2xl: 1.5rem;      /* 24px - card titles */
  --font-size-3xl: 1.875rem;    /* 30px - page titles */
  --font-size-4xl: 2.25rem;     /* 36px - hero headings */
  --font-size-5xl: 3rem;        /* 48px - large display */

  /* ==========================================================================
     7. TYPOGRAPHY - FONT WEIGHTS
     ========================================================================== */
  --font-weight-light: 300;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  --font-weight-extrabold: 800;
  --font-weight-black: 900;

  /* ==========================================================================
     8. TYPOGRAPHY - LINE HEIGHTS
     ========================================================================== */
  --line-height-none: 1;
  --line-height-tight: 1.25;
  --line-height-snug: 1.375;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.625;
  --line-height-loose: 2;

  /* ==========================================================================
     9. TYPOGRAPHY - TEXT COLORS
     ========================================================================== */
  --text-primary: var(--gray-900);
  --text-secondary: var(--gray-500);
  --text-muted: var(--gray-400);
  --text-disabled: var(--gray-300);
  --text-inverse: var(--white);
  --text-link: var(--color-primary);
  --text-link-hover: var(--color-primary-hover);

  /* ==========================================================================
     10. SPACING SCALE
     ========================================================================== */
  --spacing-0: 0;
  --spacing-px: 1px;
  --spacing-0-5: 0.125rem;  /* 2px */
  --spacing-1: 0.25rem;     /* 4px */
  --spacing-1-5: 0.375rem;  /* 6px */
  --spacing-2: 0.5rem;      /* 8px */
  --spacing-2-5: 0.625rem;  /* 10px */
  --spacing-3: 0.75rem;     /* 12px */
  --spacing-3-5: 0.875rem;  /* 14px */
  --spacing-4: 1rem;        /* 16px */
  --spacing-4-5: 1.125rem;  /* 18px */
  --spacing-5: 1.25rem;     /* 20px */
  --spacing-6: 1.5rem;      /* 24px */
  --spacing-7: 1.75rem;     /* 28px */
  --spacing-8: 2rem;        /* 32px */
  --spacing-9: 2.25rem;     /* 36px */
  --spacing-10: 2.5rem;     /* 40px */
  --spacing-12: 3rem;       /* 48px */
  --spacing-14: 3.5rem;     /* 56px */
  --spacing-16: 4rem;       /* 64px */
  --spacing-20: 5rem;       /* 80px */

  /* Legacy aliases */
  --spacing-2xs: var(--spacing-0-5);
  --spacing-xs: var(--spacing-1);
  --spacing-sm: var(--spacing-2);
  --spacing-md: var(--spacing-4);
  --spacing-lg: var(--spacing-6);
  --spacing-xl: var(--spacing-8);
  --spacing-2xl: var(--spacing-12);

  /* ==========================================================================
     11. BORDER RADIUS SCALE
     ========================================================================== */
  --radius-none: 0;
  --radius-xs: 2px;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 12px;
  --radius-2xl: 16px;
  --radius-3xl: 24px;
  --radius-full: 9999px;

  /* Component-specific radius */
  --radius-button: var(--radius-md);
  --radius-input: var(--radius-lg);
  --radius-card: var(--radius-xl);
  --radius-modal: var(--radius-xl);
  --radius-badge: var(--radius-full);

  /* ==========================================================================
     12. 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);
  --shadow-none: none;

  /* Focus shadows */
  --shadow-focus: 0 0 0 3px rgba(255, 128, 48, 0.2);
  --shadow-focus-error: 0 0 0 3px rgba(220, 53, 69, 0.2);
  --shadow-focus-success: 0 0 0 3px rgba(40, 167, 69, 0.2);

  /* ==========================================================================
     13. Z-INDEX SCALE
     ========================================================================== */
  --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;

  /* ==========================================================================
     14. TRANSITIONS
     ========================================================================== */
  --transition-fast: 150ms;
  --transition-base: 200ms;
  --transition-slow: 300ms;
  --transition-slower: 500ms;

  --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);

  /* Common transitions */
  --transition-colors: color var(--transition-base) var(--ease-in-out),
                       background-color var(--transition-base) var(--ease-in-out),
                       border-color var(--transition-base) var(--ease-in-out);
  --transition-shadow: box-shadow var(--transition-base) var(--ease-in-out);
  --transition-transform: transform var(--transition-base) var(--ease-in-out);
  --transition-opacity: opacity var(--transition-base) var(--ease-in-out);
  --transition-all: all var(--transition-slow) var(--ease-in-out);

  /* ==========================================================================
     15. FORM ELEMENTS
     ========================================================================== */
  --input-height: 38px;
  --input-height-sm: 40px;
  --input-height-lg: 60px;
  --input-padding-x: 12px;
  --input-padding-y: 8px;
  --input-padding-x-sm: 12px;
  --input-padding-y-sm: 8px;
  --input-font-size: var(--font-size-sm);
  --input-border-width: 1px;
  --input-border-color: var(--gray-150);
  --input-border-radius: var(--radius-input);
  --input-bg: var(--white);
  --input-bg-disabled: var(--gray-100);
  --input-text-color: var(--text-primary);
  --input-placeholder-color: var(--text-muted);
  --input-focus-border-color: var(--color-primary);
  --input-focus-shadow: var(--shadow-focus);
  --input-error-border-color: var(--color-error);
  --input-error-focus-shadow: var(--shadow-focus-error);
  --input-success-border-color: var(--color-success);
  --input-success-focus-shadow: var(--shadow-focus-success);

  /* ==========================================================================
     16. BUTTONS
     ========================================================================== */
  --btn-padding-x: 16px;
  --btn-padding-y: 8px;
  --btn-padding-x-sm: 12px;
  --btn-padding-y-sm: 6px;
  --btn-padding-x-lg: 20px;
  --btn-padding-y-lg: 12px;
  --btn-font-size: var(--font-size-sm);
  --btn-font-weight: var(--font-weight-bold);
  --btn-border-radius: var(--radius-button);
  --btn-border-width: 1px;
  
  /* Button heights for consistent sizing */
  --btn-height-sm: 32px;
  --btn-height-md: 40px;
  --btn-height-lg: 48px;

  /* ==========================================================================
     17. TAGS/BADGES
     ========================================================================== */
  --tag-padding-x: 12px;
  --tag-padding-y: 6px;
  --tag-height: 32px;
  --tag-font-size: var(--font-size-xs);
  --tag-font-weight: var(--font-weight-medium);
  --tag-border-radius: var(--radius-badge);
  --tag-bg: var(--gray-100);
  --tag-color: var(--gray-500);
  --tag-border: none;

  /* Badge size variants */
  --badge-size-sm: 20px;
  --badge-size-md: 24px;
  --badge-size-lg: 32px;

  /* ==========================================================================
     18. ICONS
     ========================================================================== */
  --icon-size-xs: 12px;
  --icon-size-sm: 16px;
  --icon-size-md: 20px;
  --icon-size-lg: 24px;
  --icon-size-xl: 32px;
  --icon-size-2xl: 40px;
  --icon-size-3xl: 48px;

  --icon-color-default: var(--gray-400);
  --icon-color-hover: var(--color-primary);
  --icon-color-active: var(--color-primary);
  --icon-color-disabled: var(--gray-300);
  --icon-color-inverse: var(--white);
  --icon-color-success: var(--color-success);
  --icon-color-error: var(--color-error);
  --icon-color-warning: var(--color-warning);
  --icon-color-info: var(--color-info);

  /* Legacy alias */
  --icon-color-dark: var(--icon-color-inverse);
  --icon-color-muted: var(--gray-300);

  /* ==========================================================================
     19. CARDS
     ========================================================================== */
  --card-bg: var(--white);
  --card-border-width: 1px;
  --card-border-color: var(--gray-150);
  --card-border: var(--card-border-width) solid var(--card-border-color);
  --card-radius: var(--radius-card);
  --card-padding: var(--spacing-4);
  --card-padding-sm: var(--spacing-3);
  --card-padding-lg: var(--spacing-8);
  --card-shadow: var(--shadow-sm);
  --card-shadow-hover: var(--shadow-md);

  /* ==========================================================================
     20. BORDERS
     ========================================================================== */
  --border-width: 1px;
  --border-width-2: 2px;
  --border-color: var(--gray-150);
  --border-color-light: var(--gray-100);
  --border-color-dark: var(--gray-300);
  --border-color-focus: var(--color-primary);

  /* Legacy aliases */
  --border-color-muted: var(--border-color-light);
  --border-color-strong: var(--border-color-dark);

  /* ==========================================================================
     UTILITY VARIABLES (for common patterns)
     ========================================================================== */
  
  /* Base foreground/background for calculations */
  --base-fg: var(--white);
  --base-bg: var(--gray-900);
  
  /* Legacy aliases */
  --baseFg: var(--base-fg);
  --baseBg: var(--base-bg);
}

/* ==========================================================================
   DARK MODE OVERRIDES
   ========================================================================== */
.dark-mode {
  --card-bg: var(--dark-bg-tertiary);
  --card-border-color: var(--dark-border);
  --input-bg: var(--dark-bg-tertiary);
  --input-border-color: var(--dark-border);
  --input-text-color: var(--dark-text-primary);
  --text-primary: var(--dark-text-primary);
  --text-secondary: var(--dark-text-secondary);
  --text-muted: var(--dark-text-muted);
  --border-color: var(--dark-border);
  --tag-bg: var(--dark-bg-tertiary);
  --tag-color: var(--dark-text-primary);
}
