/**
 * GESTLOC Design System
 * =====================
 * Système de design unifié basé sur les couleurs du logo GESTLOC
 * Bleu marine #1A3B5D + Vert #7BC043
 *
 * Inspiré des standards SaaS modernes: Stripe, Linear, Notion
 * Version: 1.0.0
 */

:root {
  /* ============================================
     COULEURS PRINCIPALES (basées sur logo)
     ============================================ */

  /* Bleu marine - Couleur primaire (voiture logo) */
  --primary: #1A3B5D;
  --primary-light: #2C4E6B;
  --primary-lighter: #3D5A80;
  --primary-dark: #0F2239;
  --primary-darker: #0A1625;

  /* Vert - Couleur secondaire (engrenage logo) */
  --secondary: #7BC043;
  --secondary-light: #9DD066;
  --secondary-lighter: #B8E088;
  --secondary-dark: #5A9032;
  --secondary-darker: #427021;

  /* Accent */
  --accent: #3D5A80;
  --accent-light: #5A7BA7;

  /* ============================================
     PALETTE NEUTRE (style Stripe/Linear)
     ============================================ */

  --dark: #0F1419;
  --gray-900: #1A1D23;
  --gray-800: #2D3139;
  --gray-700: #3E434D;
  --gray-600: #6B7280;
  --gray-500: #9CA3AF;
  --gray-400: #D1D5DB;
  --gray-300: #E5E7EB;
  --gray-200: #F3F4F6;
  --gray-100: #F9FAFB;
  --gray-50: #FAFBFC;
  --white: #FFFFFF;

  /* ============================================
     COULEURS SÉMANTIQUES
     ============================================ */

  --success: #7BC043;
  --success-light: #9DD066;
  --success-bg: #F0F9E8;

  --danger: #DC3545;
  --danger-light: #E35D6A;
  --danger-bg: #FEF2F2;

  --warning: #F59E0B;
  --warning-light: #FBBF24;
  --warning-bg: #FFFBEB;

  --info: #3D5A80;
  --info-light: #5A7BA7;
  --info-bg: #EFF6FF;

  /* ============================================
     TYPOGRAPHIE
     ============================================ */

  /* Familles de police */
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
  --font-mono: 'Fira Code', 'SF Mono', 'Monaco', 'Courier New', monospace;

  /* Tailles de police */
  --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 */

  /* Poids de police */
  --font-light: 300;
  --font-normal: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;
  --font-extrabold: 800;

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

  /* ============================================
     ESPACEMENTS (système 8px)
     ============================================ */

  --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-11: 2.75rem;     /* 44px */
  --space-12: 3rem;        /* 48px */
  --space-16: 4rem;        /* 64px */
  --space-20: 5rem;        /* 80px */
  --space-24: 6rem;        /* 96px */

  /* Aliases sémantiques */
  --space-xs: var(--space-1);
  --space-sm: var(--space-2);
  --space-md: var(--space-4);
  --space-lg: var(--space-6);
  --space-xl: var(--space-8);
  --space-2xl: var(--space-12);
  --space-3xl: var(--space-16);

  /* ============================================
     BORDURES ET RADIUS
     ============================================ */

  --border-width: 1px;
  --border-width-2: 2px;
  --border-width-4: 4px;

  --radius-none: 0;
  --radius-sm: 0.25rem;    /* 4px */
  --radius-md: 0.5rem;     /* 8px */
  --radius-lg: 0.75rem;    /* 12px */
  --radius-xl: 1rem;       /* 16px */
  --radius-2xl: 1.5rem;    /* 24px */
  --radius-full: 9999px;

  /* ============================================
     OMBRES (style Stripe)
     ============================================ */

  --shadow-xs: 0 1px 2px rgba(26, 59, 93, 0.03);
  --shadow-sm: 0 1px 3px rgba(26, 59, 93, 0.05),
               0 1px 2px rgba(26, 59, 93, 0.03);
  --shadow-md: 0 4px 6px rgba(26, 59, 93, 0.05),
               0 2px 4px rgba(26, 59, 93, 0.03);
  --shadow-lg: 0 10px 15px rgba(26, 59, 93, 0.08),
               0 4px 6px rgba(26, 59, 93, 0.03);
  --shadow-xl: 0 20px 25px rgba(26, 59, 93, 0.1),
               0 10px 10px rgba(26, 59, 93, 0.04);
  --shadow-2xl: 0 25px 50px rgba(26, 59, 93, 0.15);

  /* Ombres intérieures */
  --shadow-inner: inset 0 2px 4px rgba(26, 59, 93, 0.06);

  /* Ombres pour focus states */
  --shadow-focus-primary: 0 0 0 3px rgba(26, 59, 93, 0.1);
  --shadow-focus-secondary: 0 0 0 3px rgba(123, 192, 67, 0.15);
  --shadow-focus-danger: 0 0 0 3px rgba(220, 53, 69, 0.15);

  /* ============================================
     TRANSITIONS ET ANIMATIONS
     ============================================ */

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

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

  /* ============================================
     LAYOUT ET GRILLES
     ============================================ */

  --container-sm: 640px;
  --container-md: 768px;
  --container-lg: 1024px;
  --container-xl: 1280px;
  --container-2xl: 1536px;

  --header-height: 64px;
  --sidebar-width: 240px;
  --sidebar-width-collapsed: 64px;

  /* ============================================
     Z-INDEX SCALE
     ============================================ */

  --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-notification: 1080;

  /* ============================================
     BREAKPOINTS (pour référence)
     ============================================ */

  /*
  --breakpoint-sm: 640px;
  --breakpoint-md: 768px;
  --breakpoint-lg: 1024px;
  --breakpoint-xl: 1280px;
  --breakpoint-2xl: 1536px;
  */
}

/* ============================================
   DARK MODE (optionnel)
   ============================================ */

[data-theme="dark"] {
  /* Couleurs ajustées pour dark mode */
  --primary: #4A7BA7;
  --primary-light: #5A8BB7;
  --primary-dark: #3A6B97;

  --secondary: #9DD066;
  --secondary-light: #B8E088;
  --secondary-dark: #7BC043;

  /* Backgrounds */
  --white: #0F1419;
  --gray-50: #1A1D23;
  --gray-100: #2D3139;
  --gray-200: #3E434D;
  --gray-300: #4E5461;

  /* Texte */
  --dark: #F9FAFB;
  --gray-900: #E5E7EB;
  --gray-800: #D1D5DB;

  /* Ombres ajustées */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.5);
}

/* ============================================
   RESET ET BASE STYLES
   ============================================ */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-primary);
  font-size: var(--text-base);
  font-weight: var(--font-normal);
  line-height: var(--leading-normal);
  color: var(--gray-900);
  background-color: var(--gray-50);
}

/* ============================================
   TYPOGRAPHIE DE BASE
   ============================================ */

h1, h2, h3, h4, h5, h6 {
  font-weight: var(--font-semibold);
  line-height: var(--leading-tight);
  color: var(--dark);
  margin-bottom: var(--space-4);
}

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

p {
  margin-bottom: var(--space-4);
  color: var(--gray-700);
}

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

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

a:focus {
  outline: 2px solid var(--secondary);
  outline-offset: 2px;
}

/* ============================================
   TRANSITIONS GLOBALES
   ============================================ */

button,
input,
select,
textarea,
.card,
.btn,
a {
  transition:
    background-color var(--transition-base),
    border-color var(--transition-base),
    color var(--transition-base),
    box-shadow var(--transition-base),
    transform var(--transition-base);
}

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.8;
  }
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Classes utilitaires pour animations */
.animate-fade-in {
  animation: fadeIn 0.3s var(--ease-out);
}

.animate-slide-in-right {
  animation: slideInRight 0.3s var(--ease-out);
}

.animate-slide-in-down {
  animation: slideInDown 0.3s var(--ease-out);
}

.animate-pulse {
  animation: pulse 2s var(--ease-in-out) infinite;
}

.animate-spin {
  animation: spin 1s linear infinite;
}

/* ============================================
   UTILITIES - DISPLAY
   ============================================ */

.hidden { display: none !important; }
.block { display: block !important; }
.inline { display: inline !important; }
.inline-block { display: inline-block !important; }
.flex { display: flex !important; }
.inline-flex { display: inline-flex !important; }
.grid { display: grid !important; }

/* ============================================
   UTILITIES - FLEXBOX
   ============================================ */

.flex-row { flex-direction: row; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.flex-nowrap { flex-wrap: nowrap; }

.items-start { align-items: flex-start; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.items-stretch { align-items: stretch; }

.justify-start { justify-content: flex-start; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.justify-between { justify-content: space-between; }
.justify-around { justify-content: space-around; }

.gap-0 { gap: var(--space-0); }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

/* ============================================
   UTILITIES - COULEURS TEXTE
   ============================================ */

.text-primary { color: var(--primary) !important; }
.text-secondary { color: var(--secondary) !important; }
.text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }
.text-warning { color: var(--warning) !important; }
.text-info { color: var(--info) !important; }
.text-dark { color: var(--dark) !important; }
.text-muted { color: var(--gray-600) !important; }
.text-white { color: var(--white) !important; }

/* ============================================
   UTILITIES - COULEURS BACKGROUND
   ============================================ */

.bg-primary { background-color: var(--primary) !important; }
.bg-secondary { background-color: var(--secondary) !important; }
.bg-success { background-color: var(--success) !important; }
.bg-danger { background-color: var(--danger) !important; }
.bg-warning { background-color: var(--warning) !important; }
.bg-white { background-color: var(--white) !important; }
.bg-gray-50 { background-color: var(--gray-50) !important; }
.bg-gray-100 { background-color: var(--gray-100) !important; }

/* ============================================
   UTILITIES - TAILLES TEXTE
   ============================================ */

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

/* ============================================
   UTILITIES - POIDS POLICE
   ============================================ */

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

/* ============================================
   UTILITIES - MARGES ET PADDINGS
   ============================================ */

.m-0 { margin: var(--space-0) !important; }
.m-1 { margin: var(--space-1) !important; }
.m-2 { margin: var(--space-2) !important; }
.m-3 { margin: var(--space-3) !important; }
.m-4 { margin: var(--space-4) !important; }
.m-6 { margin: var(--space-6) !important; }
.m-8 { margin: var(--space-8) !important; }

.mt-0 { margin-top: var(--space-0) !important; }
.mt-2 { margin-top: var(--space-2) !important; }
.mt-4 { margin-top: var(--space-4) !important; }
.mt-6 { margin-top: var(--space-6) !important; }

.mb-0 { margin-bottom: var(--space-0) !important; }
.mb-2 { margin-bottom: var(--space-2) !important; }
.mb-4 { margin-bottom: var(--space-4) !important; }
.mb-6 { margin-bottom: var(--space-6) !important; }

.p-0 { padding: var(--space-0) !important; }
.p-2 { padding: var(--space-2) !important; }
.p-4 { padding: var(--space-4) !important; }
.p-6 { padding: var(--space-6) !important; }
.p-8 { padding: var(--space-8) !important; }

/* ============================================
   UTILITIES - BORDURES
   ============================================ */

.rounded-sm { border-radius: var(--radius-sm) !important; }
.rounded-md { border-radius: var(--radius-md) !important; }
.rounded-lg { border-radius: var(--radius-lg) !important; }
.rounded-xl { border-radius: var(--radius-xl) !important; }
.rounded-full { border-radius: var(--radius-full) !important; }

/* ============================================
   UTILITIES - OMBRES
   ============================================ */

.shadow-sm { box-shadow: var(--shadow-sm) !important; }
.shadow-md { box-shadow: var(--shadow-md) !important; }
.shadow-lg { box-shadow: var(--shadow-lg) !important; }
.shadow-xl { box-shadow: var(--shadow-xl) !important; }
.shadow-none { box-shadow: none !important; }

/* ============================================
   ACCESSIBILITY
   ============================================ */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Focus visible pour navigation au clavier */
*:focus-visible {
  outline: 2px solid var(--secondary);
  outline-offset: 2px;
}

/* Respect de la préférence utilisateur pour animations */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
