/**
 * ACOVia Design System
 * ===================
 * Charte graphique officielle - NE PAS MODIFIER
 * Version: 2.0
 *
 * Ce fichier definit les tokens de design utilises par tous les composants.
 * Une IA generant du contenu doit utiliser ces classes et variables.
 */

/* =============================================================================
   TOKENS - COULEURS
   ============================================================================= */
:root {
  /* Palette principale ACOVia */
  --color-primary: #1c6274;       /* Blue Sapphire - titres, texte principal */
  --color-accent: #55bcbd;        /* Sea Serpent - accents, liens, decorations */
  --color-highlight: #f05988;     /* Watermelon - mise en valeur, alertes */
  --color-background: #fae2ca;    /* Lumber - fond de page */
  --color-secondary: #494f70;     /* Independence - texte secondaire */

  /* Couleurs semantiques */
  --color-success: #4a9d5f;
  --color-warning: #d17a22;
  --color-error: #c0392b;
  --color-info: var(--color-accent);

  /* Surfaces */
  --surface-page: var(--color-background);
  --surface-card: #ffffff;
  --surface-elevated: #ffffff;

  /* Texte */
  --text-primary: var(--color-primary);
  --text-secondary: var(--color-secondary);
  --text-muted: rgba(73, 79, 112, 0.7);
  --text-inverse: #ffffff;
}

/* =============================================================================
   TOKENS - TYPOGRAPHIE
   ============================================================================= */
:root {
  /* Familles */
  --font-logo: 'Comfortaa', cursive;
  --font-headings: 'Oswald', sans-serif;
  --font-sections: 'Staatliches', cursive;
  --font-body: 'Oxygen', sans-serif;

  /* Tailles */
  --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: 3rem;      /* 48px */
  --text-5xl: 3.5rem;    /* 56px */
  --text-6xl: 5rem;      /* 80px */
}

/* =============================================================================
   TOKENS - ESPACEMENT
   ============================================================================= */
:root {
  --space-xs: 0.25rem;   /* 4px */
  --space-sm: 0.5rem;    /* 8px */
  --space-md: 1rem;      /* 16px */
  --space-lg: 1.5rem;    /* 24px */
  --space-xl: 2rem;      /* 32px */
  --space-2xl: 3rem;     /* 48px */
}

/* =============================================================================
   TOKENS - AUTRES
   ============================================================================= */
:root {
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-full: 9999px;

  --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 15px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.15);

  --transition-fast: 0.15s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;

  --max-width: 1400px;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--surface-page);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

/* =============================================================================
   TYPOGRAPHIE - CLASSES UTILITAIRES
   ============================================================================= */

/* Titres de section principaux */
.section-title {
  font-family: var(--font-headings);
  font-size: var(--text-5xl);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-primary);
  margin-bottom: var(--space-xl);
  position: relative;
  padding-bottom: var(--space-md);
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100px;
  height: 3px;
  background: var(--color-accent);
}

/* Numero de section */
.section-number {
  font-family: var(--font-headings);
  font-size: var(--text-6xl);
  font-weight: 600;
  color: var(--color-highlight);
  opacity: 0.7;
  line-height: 1;
}

/* Sous-titre de section */
.section-subtitle {
  font-family: var(--font-sections);
  font-size: var(--text-2xl);
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-primary);
  margin: var(--space-xl) 0 var(--space-md);
  position: relative;
  padding-bottom: var(--space-sm);
}

.section-subtitle::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 40px;
  height: 2px;
  background: var(--color-accent);
}

/* Texte lead (intro) */
.text-lead {
  font-size: var(--text-lg);
  line-height: 1.8;
  color: var(--text-primary);
}

/* Labels */
.label {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
}

/* =============================================================================
   LAYOUT
   ============================================================================= */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-xl) var(--space-2xl);
}

.grid {
  display: grid;
  gap: var(--space-lg);
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

/* =============================================================================
   COMPOSANTS - CARTES
   ============================================================================= */
.card {
  background: var(--surface-card);
  border-radius: var(--radius-md);
  padding: var(--space-xl);
  box-shadow: var(--shadow-md);
}

.card--bordered {
  border-top: 4px solid var(--color-accent);
}

.card--bordered-left {
  border-left: 4px solid var(--color-accent);
  border-top: none;
}

.card--highlight { border-color: var(--color-highlight); }
.card--success { border-color: var(--color-success); }
.card--warning { border-color: var(--color-warning); }

.card__title {
  font-family: var(--font-sections);
  font-size: var(--text-xl);
  color: var(--text-primary);
  margin-bottom: var(--space-md);
  text-transform: uppercase;
}

.card__content {
  font-size: var(--text-sm);
  line-height: 1.6;
  color: var(--text-secondary);
}

/* =============================================================================
   COMPOSANTS - STATS
   ============================================================================= */
.stat-box {
  background: var(--surface-card);
  padding: var(--space-xl);
  border-radius: var(--radius-md);
  text-align: center;
  box-shadow: var(--shadow-md);
  border-bottom: 4px solid var(--color-accent);
}

.stat-box__value {
  font-family: var(--font-headings);
  font-size: var(--text-4xl);
  font-weight: 600;
  color: var(--color-highlight);
  line-height: 1;
}

.stat-box__label {
  font-size: var(--text-sm);
  color: var(--text-primary);
  margin-top: var(--space-sm);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-box__source {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: var(--space-xs);
}

/* =============================================================================
   COMPOSANTS - ALERTES
   ============================================================================= */
.alert {
  padding: var(--space-lg);
  border-radius: var(--radius-sm);
  border-left: 4px solid;
}

.alert--warning {
  background: rgba(240, 89, 136, 0.1);
  border-color: var(--color-highlight);
}

.alert--info {
  background: rgba(85, 188, 189, 0.1);
  border-color: var(--color-accent);
}

.alert__title {
  font-family: var(--font-headings);
  font-size: var(--text-base);
  font-weight: 600;
  margin-bottom: var(--space-sm);
}

.alert--warning .alert__title { color: var(--color-highlight); }
.alert--info .alert__title { color: var(--color-accent); }

/* =============================================================================
   COMPOSANTS - TAGS
   ============================================================================= */
.tag {
  display: inline-block;
  background: var(--surface-page);
  color: var(--text-primary);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tag--accent { background: rgba(85, 188, 189, 0.2); color: var(--color-accent); }
.tag--highlight { background: rgba(240, 89, 136, 0.2); color: var(--color-highlight); }

/* =============================================================================
   COMPOSANTS - LISTES
   ============================================================================= */
.list-arrow {
  list-style: none;
  padding-left: 0;
}

.list-arrow li {
  padding: var(--space-sm) 0;
  padding-left: var(--space-lg);
  position: relative;
}

.list-arrow li::before {
  content: '\2192'; /* fleche droite */
  position: absolute;
  left: 0;
  color: var(--color-accent);
}

.list-signals li::before {
  content: '\2B21'; /* hexagone */
}

/* =============================================================================
   COMPOSANTS - VISUALISATION CONTAINER
   ============================================================================= */
.viz-container {
  background: var(--surface-card);
  border-radius: var(--radius-md);
  padding: var(--space-xl);
  margin: var(--space-xl) 0;
  box-shadow: var(--shadow-md);
  position: relative;
}

.viz-split {
  display: grid;
  grid-template-columns: 1fr 350px;
  gap: var(--space-xl);
  min-height: 600px;
}

.viz-sidebar {
  background: var(--surface-page);
  padding: var(--space-lg);
  border-radius: var(--radius-md);
  overflow-y: auto;
  max-height: 700px;
}

/* =============================================================================
   COMPOSANTS - NAVIGATION
   ============================================================================= */
.nav-container {
  background: var(--surface-card);
  border-bottom: 2px solid var(--color-accent);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  padding: 0 var(--space-xl);
}

.nav-logo {
  font-family: var(--font-logo);
  font-size: 28px;
  font-weight: bold;
  padding: var(--space-md) 0;
  margin-right: var(--space-xl);
}

.nav-logo__primary { color: var(--color-primary); }
.nav-logo__accent { color: var(--color-accent); }

.nav-tabs {
  display: flex;
  flex-grow: 1;
  overflow-x: auto;
}

.nav-tab {
  font-family: var(--font-headings);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: var(--space-md) var(--space-lg);
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--text-primary);
  border-bottom: 3px solid transparent;
  transition: var(--transition-normal);
  white-space: nowrap;
}

.nav-tab:hover {
  background: var(--surface-page);
}

.nav-tab.active {
  border-bottom-color: var(--color-highlight);
  font-weight: 600;
}

.nav-tab__number {
  color: var(--color-highlight);
  font-weight: 600;
  margin-right: var(--space-sm);
}

/* =============================================================================
   COMPOSANTS - MODALS
   ============================================================================= */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 2000;
}

.modal-overlay.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  position: relative;
  width: 95vw;
  height: 95vh;
  background: var(--surface-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-lg) var(--space-xl);
  background: var(--color-primary);
  color: var(--text-inverse);
}

.modal-title {
  font-family: var(--font-sections);
  font-size: var(--text-2xl);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-inverse);
  font-size: 32px;
  cursor: pointer;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* =============================================================================
   UTILITAIRES
   ============================================================================= */
.fullscreen-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--color-accent);
  color: var(--text-inverse);
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  z-index: 10;
  transition: var(--transition-normal);
  box-shadow: var(--shadow-sm);
}

.fullscreen-btn:hover {
  background: var(--color-highlight);
  transform: translateY(-2px);
}

/* =============================================================================
   ANIMATIONS
   ============================================================================= */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.view {
  display: none;
}

.view.active {
  display: block;
  animation: fadeIn var(--transition-slow);
}

/* =============================================================================
   RESPONSIVE
   ============================================================================= */
@media (max-width: 768px) {
  .container {
    padding: var(--space-lg);
  }

  .section-title {
    font-size: var(--text-3xl);
  }

  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
  }

  .viz-split {
    grid-template-columns: 1fr;
  }
}
