/* =====================================================
   GEROITE DESIGN SYSTEM - DESIGN TOKENS
   =====================================================
   
   This file defines all design tokens (CSS custom properties)
   used throughout the application. All colors, typography,
   spacing, and effects should be defined here.
   
   Version: 1.0.0
   Last Updated: 2026-01-25
   ===================================================== */

:root {
    /* ========================================
       CORE COLOR PALETTE
       ======================================== */
    
    /* Brand Colors */
    --color-brand-primary: #3b82f6;
    --color-brand-primary-hover: #2563eb;
    --color-brand-primary-active: #1d4ed8;
    --color-brand-primary-light: #60a5fa;
    --color-brand-primary-subtle: #1e3a8a;
    
    /* Semantic Colors - Status */
    --color-success: #10b981;
    --color-success-hover: #059669;
    --color-success-light: #6ee7b7;
    --color-success-bg: #064e3b;
    --color-success-border: #10b981;
    
    --color-warning: #f59e0b;
    --color-warning-hover: #d97706;
    --color-warning-light: #fcd34d;
    --color-warning-bg: #78350f;
    --color-warning-border: #f59e0b;
    
    --color-danger: #ef4444;
    --color-danger-hover: #dc2626;
    --color-danger-light: #fca5a5;
    --color-danger-bg: #7f1d1d;
    --color-danger-border: #ef4444;
    
    --color-info: #3b82f6;
    --color-info-hover: #2563eb;
    --color-info-light: #93c5fd;
    --color-info-bg: #1e3a8a;
    --color-info-border: #3b82f6;
    
    --color-neutral: #6b7280;
    --color-neutral-hover: #4b5563;
    --color-neutral-light: #d1d5db;
    --color-neutral-bg: #374151;
    --color-neutral-border: #6b7280;
    
    /* Purple/Violet Accent (for special actions) */
    --color-accent-purple: #a78bfa;
    --color-accent-purple-dark: #7c3aed;
    --color-accent-purple-darker: #6d28d9;
    
    /* ========================================
       DARK MODE COLORS (DEFAULT)
       ======================================== */
    
    /* Background Colors */
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --bg-elevated: #1e293b;
    --bg-hover: #334155;
    --bg-active: #475569;
    
    /* Gradient Backgrounds */
    --bg-gradient-start: #0f172a;
    --bg-gradient-end: #1e293b;
    --bg-gradient: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    
    /* Surface Colors (Cards, Panels) */
    --surface-default: #1e293b;
    --surface-raised: #334155;
    --surface-overlay: rgba(0, 0, 0, 0.6);
    
    /* Text Colors */
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --text-disabled: #64748b;
    --text-inverse: #0f172a;
    --text-link: #60a5fa;
    --text-link-hover: #93c5fd;
    
    /* Border Colors */
    --border-default: #334155;
    --border-light: #1e293b;
    --border-strong: #475569;
    --border-focus: #3b82f6;
    
    /* ========================================
       SHADOWS & EFFECTS
       ======================================== */
    
    /* Shadow Tokens */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.25);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.3);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.35);
    --shadow-2xl: 0 25px 50px rgba(0, 0, 0, 0.4);
    
    /* Colored Shadows */
    --shadow-primary: 0 4px 12px rgba(59, 130, 246, 0.3);
    --shadow-success: 0 4px 12px rgba(16, 185, 129, 0.3);
    --shadow-danger: 0 4px 12px rgba(239, 68, 68, 0.3);
    --shadow-warning: 0 4px 12px rgba(245, 158, 11, 0.3);
    
    /* Focus Ring */
    --focus-ring: 0 0 0 3px rgba(59, 130, 246, 0.2);
    --focus-ring-offset: 2px;
    
    /* ========================================
       TYPOGRAPHY
       ======================================== */
    
    /* Font Families */
    --font-family-base: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    --font-family-mono: 'JetBrains Mono', 'Fira Code', 'SF Mono', Consolas, monospace;
    
    /* Font Sizes - Using modular scale (1.25) */
    --font-size-2xs: 0.625rem;   /* 10px */
    --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 Weights */
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    
    /* 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-tighter: -0.05em;
    --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 (4px base unit)
       ======================================== */
    
    --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-12: 3rem;       /* 48px */
    --space-14: 3.5rem;     /* 56px */
    --space-16: 4rem;       /* 64px */
    --space-20: 5rem;       /* 80px */
    --space-24: 6rem;       /* 96px */
    
    /* ========================================
       BORDER RADIUS
       ======================================== */
    
    --radius-none: 0;
    --radius-sm: 0.125rem;   /* 2px */
    --radius-default: 0.25rem; /* 4px */
    --radius-md: 0.375rem;   /* 6px */
    --radius-lg: 0.5rem;     /* 8px */
    --radius-xl: 0.75rem;    /* 12px */
    --radius-2xl: 1rem;      /* 16px */
    --radius-3xl: 1.5rem;    /* 24px */
    --radius-full: 9999px;
    
    /* ========================================
       TRANSITIONS & ANIMATIONS
       ======================================== */
    
    /* Transition Durations */
    --duration-instant: 0ms;
    --duration-fast: 100ms;
    --duration-normal: 200ms;
    --duration-slow: 300ms;
    --duration-slower: 500ms;
    
    /* Transition Timing 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);
    
    /* Common Transitions */
    --transition-fast: all 100ms var(--ease-out);
    --transition-normal: all 200ms var(--ease-out);
    --transition-slow: all 300ms var(--ease-out);
    --transition-colors: background-color 200ms, border-color 200ms, color 200ms, fill 200ms, stroke 200ms;
    --transition-transform: transform 200ms var(--ease-out);
    
    /* ========================================
       Z-INDEX SCALE
       ======================================== */
    
    --z-behind: -1;
    --z-base: 0;
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-fixed: 300;
    --z-overlay: 400;
    --z-modal: 500;
    --z-popover: 600;
    --z-tooltip: 700;
    --z-toast: 800;
    --z-max: 9999;
    
    /* ========================================
       LAYOUT
       ======================================== */
    
    /* Container Widths */
    --container-sm: 640px;
    --container-md: 768px;
    --container-lg: 1024px;
    --container-xl: 1280px;
    --container-2xl: 1536px;
    --container-max: 1600px;
    
    /* Sidebar */
    --sidebar-width-collapsed: 70px;
    --sidebar-width-expanded: 240px;
    
    /* ========================================
       COMPONENT-SPECIFIC TOKENS
       ======================================== */
    
    /* Buttons */
    --btn-padding-x: var(--space-5);
    --btn-padding-y: var(--space-2-5);
    --btn-padding-x-sm: var(--space-3);
    --btn-padding-y-sm: var(--space-1-5);
    --btn-padding-x-lg: var(--space-6);
    --btn-padding-y-lg: var(--space-3);
    --btn-font-size: var(--font-size-sm);
    --btn-font-weight: var(--font-weight-semibold);
    --btn-radius: var(--radius-md);
    
    /* Cards */
    --card-padding: var(--space-6);
    --card-padding-sm: var(--space-4);
    --card-padding-lg: var(--space-8);
    --card-radius: var(--radius-lg);
    --card-shadow: var(--shadow-sm);
    --card-border: 1px solid var(--border-default);
    
    /* Inputs */
    --input-padding-x: var(--space-3);
    --input-padding-y: var(--space-2-5);
    --input-font-size: var(--font-size-sm);
    --input-radius: var(--radius-lg);
    --input-border: 2px solid var(--border-default);
    
    /* Tables */
    --table-cell-padding-x: var(--space-4);
    --table-cell-padding-y: var(--space-3-5);
    --table-header-bg: var(--bg-primary);
    --table-row-hover-bg: var(--bg-primary);
    
    /* Badges */
    --badge-padding-x: var(--space-2-5);
    --badge-padding-y: var(--space-1);
    --badge-font-size: var(--font-size-xs);
    --badge-font-weight: var(--font-weight-semibold);
    --badge-radius: var(--radius-default);
    
    /* Modals */
    --modal-padding: var(--space-6);
    --modal-radius: var(--radius-xl);
    --modal-shadow: var(--shadow-xl);
    --modal-max-width: 600px;
    
    /* ========================================
       LEGACY VARIABLE MAPPINGS
       For backward compatibility with existing styles
       ======================================== */
    
    /* Background mappings */
    --bg-white: var(--surface-default);
    --bg-light: var(--bg-primary);
    --bg-secondary: var(--surface-raised);
    
    /* Accent mappings */
    --accent-primary: var(--color-brand-primary);
    --accent-secondary: var(--color-brand-primary-hover);
    --accent-hover: var(--color-brand-primary-light);
    --accent-light: var(--color-brand-primary-subtle);
    
    /* Status color mappings */
    --success: var(--color-success);
    --warning: var(--color-warning);
    --danger: var(--color-danger);
    
    /* Status background mappings */
    --success-bg: var(--color-success-bg);
    --success-text: var(--color-success-light);
    --success-border: var(--color-success-border);
    --warning-bg: var(--color-warning-bg);
    --warning-text: var(--color-warning-light);
    --warning-border: var(--color-warning-border);
    --danger-bg: var(--color-danger-bg);
    --danger-text: var(--color-danger-light);
    --danger-border: var(--color-danger-border);
    --info-bg: var(--color-info-bg);
    --info-text: var(--color-info-light);
    --info-border: var(--color-info-border);
    --neutral-bg: var(--color-neutral-bg);
    --neutral-text: var(--color-neutral-light);
    --neutral-border: var(--color-neutral-border);
    
    /* Border mappings */
    --border-color: var(--border-default);
    --border-light: var(--border-light);
    
    /* Shadow mappings */
    --shadow: var(--shadow-sm);
    --shadow-md: var(--shadow-md);
    --shadow-lg: var(--shadow-lg);
    
    /* Button mappings */
    --btn-secondary-bg: #475569;
    --btn-secondary-hover: #64748b;
    
    /* Purple mappings */
    --purple: var(--color-accent-purple);
    --purple-dark: var(--color-accent-purple-dark);
    --purple-darker: var(--color-accent-purple-darker);
}

/* ========================================
   LIGHT MODE OVERRIDES
   ======================================== */
body.light-mode {
    /* Background Colors */
    --bg-primary: #f5f7fa;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f7fafc;
    --bg-elevated: #ffffff;
    --bg-hover: #edf2f7;
    --bg-active: #e2e8f0;
    
    /* Gradient Backgrounds */
    --bg-gradient-start: #f5f7fa;
    --bg-gradient-end: #e8eef5;
    
    /* Surface Colors */
    --surface-default: #ffffff;
    --surface-raised: #f7fafc;
    
    /* Text Colors */
    --text-primary: #1a202c;
    --text-secondary: #4a5568;
    --text-muted: #718096;
    --text-disabled: #a0aec0;
    --text-inverse: #ffffff;
    --text-link: #2563eb;
    --text-link-hover: #1d4ed8;
    
    /* Border Colors */
    --border-default: #e2e8f0;
    --border-light: #f0f4f8;
    --border-strong: #cbd5e0;
    
    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.12);
    
    /* Status colors light mode */
    --color-success-bg: #d1fae5;
    --color-success-light: #065f46;
    --color-warning-bg: #fef3c7;
    --color-warning-light: #b45309;
    --color-danger-bg: #fee2e2;
    --color-danger-light: #991b1b;
    --color-info-bg: #dbeafe;
    --color-info-light: #1e40af;
    --color-neutral-bg: #f3f4f6;
    --color-neutral-light: #374151;
    
    /* Brand colors light mode adjustments */
    --color-brand-primary: #2563eb;
    --color-brand-primary-hover: #1d4ed8;
    --color-brand-primary-subtle: #dbeafe;
    
    /* Button colors */
    --btn-secondary-bg: #e0e0e0;
    --btn-secondary-hover: #d0d0d0;
    
    /* Focus ring */
    --focus-ring: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* Keep dark-mode class for backward compatibility */
body.dark-mode {
    /* Uses default :root values */
}
