/**
 * NexaSeed Design System
 * Version: 2.0.0 - Refonte complète
 * Foundation: Variables, Tokens, Utilities
 */

/* ==========================================
   COLOR SYSTEM
   ========================================== */
:root {
    /* Brand Colors */
    --nexaseed-navy: #1e3a5f;
    --nexaseed-navy-light: #2d5a8f;
    --nexaseed-navy-dark: #152948;
    --nexaseed-red: #C41E3A;
    --nexaseed-red-light: #e02645;
    --nexaseed-red-dark: #9a1729;
    
    /* Tech Accent */
    --tech-cyan: #06B6D4;
    --tech-cyan-light: #22D3EE;
    --tech-cyan-dark: #0891B2;
    
    /* Semantic Colors */
    --success: #10B981;
    --success-light: #D1FAE5;
    --warning: #F59E0B;
    --warning-light: #FEF3C7;
    --error: #EF4444;
    --error-light: #FEE2E2;
    --info: #3B82F6;
    --info-light: #DBEAFE;
    
    /* Neutrals - High Quality Grays */
    --white: #FFFFFF;
    --gray-50: #FAFAFA;
    --gray-100: #F4F4F5;
    --gray-200: #E4E4E7;
    --gray-300: #D4D4D8;
    --gray-400: #A1A1AA;
    --gray-500: #71717A;
    --gray-600: #52525B;
    --gray-700: #3F3F46;
    --gray-800: #27272A;
    --gray-900: #18181B;
    --black: #09090B;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, var(--nexaseed-navy) 0%, var(--nexaseed-navy-light) 100%);
    --gradient-accent: linear-gradient(135deg, var(--nexaseed-red) 0%, var(--nexaseed-red-light) 100%);
    --gradient-tech: linear-gradient(135deg, var(--tech-cyan-dark) 0%, var(--tech-cyan-light) 100%);
    --gradient-hero: linear-gradient(135deg, var(--gray-50) 0%, var(--white) 100%);
    
    /* Overlay */
    --overlay-light: rgba(255, 255, 255, 0.95);
    --overlay-dark: rgba(0, 0, 0, 0.5);
}

/* ==========================================
   TYPOGRAPHY SYSTEM
   ========================================== */
:root {
    /* Font Families */
    --font-heading: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Monaco', monospace;
    
    /* Font Sizes - Fluid Scale */
    --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 */
    --text-6xl: 3.75rem;     /* 60px */
    
    /* Line Heights */
    --leading-none: 1;
    --leading-tight: 1.25;
    --leading-snug: 1.375;
    --leading-normal: 1.5;
    --leading-relaxed: 1.625;
    --leading-loose: 2;
    
    /* Font Weights */
    --font-light: 300;
    --font-normal: 400;
    --font-medium: 500;
    --font-semibold: 600;
    --font-bold: 700;
    --font-extrabold: 800;
}

/* ==========================================
   SPACING SYSTEM (8px base)
   ========================================== */
:root {
    --space-0: 0;
    --space-1: 0.25rem;   /* 4px */
    --space-2: 0.5rem;    /* 8px */
    --space-3: 0.75rem;   /* 12px */
    --space-4: 1rem;      /* 16px */
    --space-5: 1.25rem;   /* 20px */
    --space-6: 1.5rem;    /* 24px */
    --space-8: 2rem;      /* 32px */
    --space-10: 2.5rem;   /* 40px */
    --space-12: 3rem;     /* 48px */
    --space-16: 4rem;     /* 64px */
    --space-20: 5rem;     /* 80px */
    --space-24: 6rem;     /* 96px */
    --space-32: 8rem;     /* 128px */
}

/* ==========================================
   SHADOWS - Subtle Elevation
   ========================================== */
:root {
    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.08), 0 1px 2px -1px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.06);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.06);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
    
    /* Colored Shadows */
    --shadow-primary: 0 10px 25px -5px rgba(30, 58, 95, 0.15);
    --shadow-accent: 0 10px 25px -5px rgba(196, 30, 58, 0.15);
    --shadow-tech: 0 10px 25px -5px rgba(6, 182, 212, 0.15);
}

/* ==========================================
   BORDERS & RADIUS
   ========================================== */
:root {
    --border-width: 1px;
    --border-width-2: 2px;
    --border-color: var(--gray-200);
    --border-color-hover: var(--gray-300);
    
    --radius-sm: 0.375rem;  /* 6px */
    --radius-md: 0.5rem;    /* 8px */
    --radius-lg: 0.75rem;   /* 12px */
    --radius-xl: 1rem;      /* 16px */
    --radius-2xl: 1.5rem;   /* 24px */
    --radius-full: 9999px;
}

/* ==========================================
   TRANSITIONS - Smooth & Fast
   ========================================== */
:root {
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 400ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ==========================================
   LAYOUT
   ========================================== */
:root {
    --header-height: 72px;
    --container-width: 1280px;
    --container-width-narrow: 960px;
    --container-width-wide: 1440px;
    
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-tooltip: 1070;
}

/* ==========================================
   BREAKPOINTS (Media Queries)
   ========================================== */
:root {
    --screen-sm: 640px;
    --screen-md: 768px;
    --screen-lg: 1024px;
    --screen-xl: 1280px;
    --screen-2xl: 1536px;
}

/* ==========================================
   RESET & BASE STYLES
   ========================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    line-height: var(--leading-normal);
    color: var(--gray-800);
    background-color: var(--white);
    min-height: 100vh;
}

/* ==========================================
   TYPOGRAPHY DEFAULTS
   ========================================== */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: var(--font-bold);
    line-height: var(--leading-tight);
    color: var(--gray-900);
    margin: 0;
}

h1 { font-size: var(--text-5xl); }
h2 { font-size: var(--text-4xl); }
h3 { font-size: var(--text-3xl); }
h4 { font-size: var(--text-2xl); }
h5 { font-size: var(--text-xl); }
h6 { font-size: var(--text-lg); }

p {
    margin: 0;
    line-height: var(--leading-relaxed);
}

a {
    color: var(--nexaseed-navy);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--nexaseed-navy-light);
}

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

/* Container */
.container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--space-6);
}

.container-narrow {
    max-width: var(--container-width-narrow);
}

.container-wide {
    max-width: var(--container-width-wide);
}

/* Text Alignment */
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }

/* Text Colors */
.text-navy { color: var(--nexaseed-navy); }
.text-red { color: var(--nexaseed-red); }
.text-cyan { color: var(--tech-cyan); }
.text-gray-500 { color: var(--gray-500); }
.text-gray-600 { color: var(--gray-600); }
.text-gray-700 { color: var(--gray-700); }
.text-gray-900 { color: var(--gray-900); }

/* Background Colors */
.bg-white { background-color: var(--white); }
.bg-gray-50 { background-color: var(--gray-50); }
.bg-navy { background-color: var(--nexaseed-navy); }
.bg-red { background-color: var(--nexaseed-red); }

/* Gradients */
.bg-gradient-primary { background: var(--gradient-primary); }
.bg-gradient-accent { background: var(--gradient-accent); }
.bg-gradient-hero { background: var(--gradient-hero); }

/* Flexbox */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-start { justify-content: flex-start; }
.justify-end { justify-content: flex-end; }
.gap-2 { gap: var(--space-2); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

/* Grid */
.grid { display: grid; }
.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); }

/* Spacing */
.mt-4 { margin-top: var(--space-4); }
.mt-8 { margin-top: var(--space-8); }
.mt-12 { margin-top: var(--space-12); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-8 { margin-bottom: var(--space-8); }
.mb-12 { margin-bottom: var(--space-12); }
.py-8 { padding-top: var(--space-8); padding-bottom: var(--space-8); }
.py-12 { padding-top: var(--space-12); padding-bottom: var(--space-12); }
.py-16 { padding-top: var(--space-16); padding-bottom: var(--space-16); }
.py-24 { padding-top: var(--space-24); padding-bottom: var(--space-24); }

/* Responsive */
@media (max-width: 768px) {
    html { font-size: 14px; }
    h1 { font-size: var(--text-4xl); }
    h2 { font-size: var(--text-3xl); }
    .container { padding: 0 var(--space-4); }
}

/* Selection */
::selection {
    background-color: var(--nexaseed-red);
    color: var(--white);
}

::-moz-selection {
    background-color: var(--nexaseed-red);
    color: var(--white);
}

/* Focus Visible */
:focus-visible {
    outline: 2px solid var(--nexaseed-navy);
    outline-offset: 2px;
}

/* Scrollbar Styling (Webkit) */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
    background: var(--gray-400);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-500);
}