/**
 * Oui'Transferts v3.5 - Styles principaux avec arrière-plan vidéo
 * Design system moderne et responsive avec support vidéo de fond
 * Emplacement: /assets/css/main.css
 * Date: 2025-01-25
 * Version: 3.5 - Ajout support arrière-plan vidéo avec fallback
 */

/* === Variables CSS globales === */
:root {
  /* Couleurs SIVOM */
  --sivom-bleu: #254193;
  --sivom-rouge: #e30513;
  --sivom-vert: #00973a;
  --sivom-jaune: #fecf23;
  --sivom-cyan: #009ee3;
  --sivom-violet: #82358b;

  /* Palette de couleurs primaires */
  --primary-50: #eff6ff;
  --primary-100: #dbeafe;
  --primary-200: #bfdbfe;
  --primary-300: #93c5fd;
  --primary-400: #60a5fa;
  --primary-500: #3b82f6;
  --primary-600: var(--sivom-bleu);
  --primary-700: #1d4ed8;
  --primary-800: #1e40af;
  --primary-900: #1e3a8a;

  /* Couleurs fonctionnelles avec nuances */
  --success-50: #ecfdf5;
  --success-100: #d1fae5;
  --success-200: #a7f3d0;
  --success-500: var(--sivom-vert);
  --success-600: #059669;
  --success-700: #047857;

  --warning-50: #fffbeb;
  --warning-100: #fef3c7;
  --warning-200: #fde68a;
  --warning-500: var(--sivom-jaune);
  --warning-600: #d97706;
  --warning-700: #b45309;

  --error-50: #fef2f2;
  --error-100: #fee2e2;
  --error-200: #fecaca;
  --error-500: var(--sivom-rouge);
  --error-600: #dc2626;
  --error-700: #b91c1c;

  --info-50: #f0f9ff;
  --info-100: #e0f2fe;
  --info-200: #bae6fd;
  --info-500: var(--sivom-cyan);
  --info-600: #0891b2;
  --info-700: #0e7490;

  /* Échelle de gris complète */
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;

  /* Typographie système */
  --font-family-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-family-mono: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;

  /* Système d'espacement harmonique */
  --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 */

  /* Rayons de bordure progressifs */
  --radius-sm: 0.375rem;
  --radius: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --radius-2xl: 2rem;
  --radius-full: 9999px;

  /* Système d'ombres cohérent */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);

  /* Transitions optimisées */
  --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);

  /* Z-index organisé */
  --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;
  --z-video-background: -1;
}

/* === Reset et fondations === */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  line-height: 1.15;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}



/* === Arrière-plan vidéo avec fallback === */
body {
  margin: 0;
  font-family: var(--font-family-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--gray-900);
  background-color: white; /* Fallback par défaut */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  position: relative;
  min-height: 100vh;
}

/* Conteneur vidéo de fond */
.video-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: var(--z-video-background);
  overflow: hidden;
  pointer-events: none;
}

.video-background video {
  position: absolute;
  top: 50%;
  left: 50%;
  min-width: 100%;
  min-height: 100%;
  width: auto;
  height: auto;
  transform: translateX(-50%) translateY(-50%);
  object-fit: cover;
  opacity: 0.5; /* Transparence pour lisibilité */
  filter: blur(1px); /* Léger flou pour effet subtil */
}

.btn-icon svg {
  stroke: white !important;
  fill: none !important;
}

/* Overlay pour améliorer la lisibilité */
.video-background::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, 
    rgba(255, 255, 255, 0.95), 
    rgba(255, 255, 255, 0.85)
  );
  pointer-events: none;
}

/* Fallback si vidéo non disponible */
body.no-video {
  background: linear-gradient(135deg, 
    rgba(var(--sivom-bleu), 0.02), 
    rgba(var(--sivom-cyan), 0.02)
  );
}

/* Contenu principal avec fond semi-transparent */
.main-content {
  position: relative;
  z-index: 1;
  min-height: calc(100vh - 4rem - 3rem);
  padding: var(--space-8) 0;
  background: rgba(255, 255, 255, 0.85);
backdrop-filter: blur(10px);
-webkit-backdrop-filter: blur(10px);
}

/* Optimisation des polices */
h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-weight: 600;
  line-height: 1.25;
  color: var(--gray-900);
}

p {
  margin: 0 0 var(--space-4);
}

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

a:hover {
  color: var(--sivom-cyan);
  text-decoration: underline;
}

/* === Layout responsive === */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--space-4);
  position: relative;
  z-index: 1;
}

@media (min-width: 640px) {
  .container {
    padding: 0 var(--space-6);
  }
}

@media (min-width: 1024px) {
  .container {
    padding: 0 var(--space-8);
  }
}

/* === Header application === */
.app-header {
  background: linear-gradient(135deg, var(--sivom-bleu), var(--sivom-cyan));
  border-bottom: 3px solid var(--sivom-jaune);
  box-shadow: var(--shadow-lg);
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  backdrop-filter: blur(8px);
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4rem;
  gap: var(--space-4);
}

.logo-section {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
}

.logo-sivom {
  width: 40px;
  height: 40px;
  background: url('../../logo.png') center/contain no-repeat white;
  border-radius: var(--radius);
  border: 2px solid rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
}

.app-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: white;
  margin: 0;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.user-section {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  flex-shrink: 0;
}

.user-info {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.875rem;
  font-weight: 500;
}

.user-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.5rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.user-badge.admin {
  background: var(--sivom-jaune);
  color: #92400e;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

/* === Système de boutons === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.25;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition-fast);
  white-space: nowrap;
  user-select: none;
  position: relative;
  overflow: hidden;
}

.btn:focus {
  outline: 2px solid var(--sivom-bleu);
  outline-offset: 2px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Variantes de boutons */
.btn-primary {
  background: linear-gradient(135deg, var(--sivom-bleu), var(--sivom-cyan));
  color: white;
  border-color: var(--sivom-bleu);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #1e3a8a, var(--sivom-bleu));
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-outline {
  background-color: transparent;
  color: rgba(255, 255, 255, 0.9);
  border-color: rgba(255, 255, 255, 0.3);
}

.btn-outline:hover:not(:disabled) {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.5);
  color: white;
}

.btn-ghost {
  background-color: transparent;
  color: var(--gray-600);
  border-color: transparent;
}

.btn-ghost:hover:not(:disabled) {
  background-color: var(--gray-100);
  color: var(--gray-900);
}

.btn-danger {
  background: linear-gradient(135deg, var(--sivom-rouge), #dc2626);
  color: white;
  border-color: var(--sivom-rouge);
}

.btn-danger:hover:not(:disabled) {
  background: linear-gradient(135deg, #b91c1c, var(--sivom-rouge));
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-warning {
  background: linear-gradient(135deg, var(--sivom-jaune), #f59e0b);
  color: #92400e;
  border-color: var(--sivom-jaune);
}

.btn-warning:hover:not(:disabled) {
  background: linear-gradient(135deg, #fbbf24, var(--sivom-jaune));
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* Boutons icône */
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  background: var(--sivom-vert);
  color: white;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.btn-icon:hover {
  background: var(--sivom-bleu);
  color: white;
  transform: scale(1.05);
  box-shadow: var(--shadow-md);
}

.btn-icon:focus {
  outline: 2px solid var(--sivom-bleu);
  outline-offset: 2px;
}

/* === Icônes SVG === */
.icon {
  width: 1rem;
  height: 1rem;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  flex-shrink: 0;
}

.btn .icon {
  width: 1.125rem;
  height: 1.125rem;
}

.btn-icon .icon {
  width: 1.25rem;
  height: 1.25rem;
}

/* === Statistiques === */
.stats-section {
  margin-bottom: var(--space-12);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-6);
}

.stat-card {
  background: rgba(255, 255, 255, 0.95);
  padding: var(--space-6);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  gap: var(--space-4);
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--sivom-bleu), var(--sivom-cyan));
  opacity: 0;
  transition: opacity var(--transition-base);
}

.stat-card:hover {
  box-shadow: var(--shadow-xl);
  transform: translateY(-2px);
}

.stat-card:hover::before {
  opacity: 1;
}

.stat-icon {
  width: 3rem;
  height: 3rem;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
}

.stat-icon svg {
  width: 1.5rem;
  height: 1.5rem;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.stat-icon.primary {
  background: linear-gradient(135deg, var(--sivom-bleu), var(--sivom-cyan));
  color: white;
}

.stat-icon.success {
  background: linear-gradient(135deg, var(--sivom-vert), #16a34a);
  color: white;
}

.stat-icon.info {
  background: linear-gradient(135deg, var(--sivom-cyan), #0ea5e9);
  color: white;
}

.stat-icon.warning {
  background: linear-gradient(135deg, var(--sivom-jaune), #f59e0b);
  color: #92400e;
}

.stat-content {
  flex: 1;
  min-width: 0;
}

.stat-number {
  font-size: 2rem;
  font-weight: 800;
  color: #1f2937;
  line-height: 1;
  margin-bottom: var(--space-1);
}

.stat-label {
  font-size: 0.875rem;
  color: #374151;
  font-weight: 600;
}

.stat-sublabel {
  font-size: 0.75rem;
  color: #4b5563;
  margin-top: var(--space-1);
}

/* === Section Upload === */
.upload-section {
  margin-bottom: var(--space-12);
}

.upload-container {
  background: rgba(255, 255, 255, 0.95);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--gray-200);
  overflow: hidden;
  transition: box-shadow var(--transition-base);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.upload-container:hover {
  box-shadow: var(--shadow-xl);
}

.upload-header {
  padding: var(--space-6);
  border-bottom: 2px solid var(--sivom-jaune);
  text-align: center;
  background: linear-gradient(135deg, 
    rgba(37, 65, 147, 0.05), 
    rgba(0, 158, 227, 0.05)
  );
}

.upload-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: var(--space-2);
}

.upload-header p {
  color: #374151;
  margin-bottom: var(--space-4);
  font-weight: 500;
}

.upload-limits {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-size: 0.75rem;
  color: #374151;
}

.limit-item {
  background: #1f2937;
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
}

.limit-separator {
  color: #374151;
  font-weight: bold;
}

.upload-area {
  padding: var(--space-8);
  border: 2px dashed var(--gray-300);
  margin: var(--space-6);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-base);
  position: relative;
  background: rgba(249, 250, 251, 0.5);
}

.upload-area:hover,
.upload-area.dragover {
  border-color: var(--sivom-bleu);
  background-color: rgba(37, 65, 147, 0.05);
  transform: scale(1.02);
}

.upload-area:focus {
  outline: 2px solid var(--sivom-bleu);
  outline-offset: 2px;
}

.upload-prompt {
  text-align: center;
  pointer-events: none;
}

.upload-icon {
  width: 3rem;
  height: 3rem;
  color: var(--gray-400);
  margin: 0 auto var(--space-4);
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  transition: color var(--transition-base);
}

.upload-area.dragover .upload-icon {
  color: var(--sivom-bleu);
}

.upload-text {
  font-size: 1.125rem;
  color: #1f2937;
  margin-bottom: var(--space-2);
  font-weight: 600;
}

.upload-info {
  font-size: 0.875rem;
  color: #374151;
  font-weight: 500;
}

/* === Barre de progression avancée === */
.progress-section {
  padding: var(--space-6);
  border-top: 1px solid var(--gray-200);
  background: rgba(249, 250, 251, 0.8);
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-3);
}

.progress-label {
  font-weight: 500;
  color: var(--gray-900);
}

.progress-value {
  font-weight: 600;
  color: var(--sivom-bleu);
  font-family: var(--font-family-mono);
}

.progress-bar {
  height: 0.75rem;
  background: var(--gray-200);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: var(--space-4);
  position: relative;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--sivom-vert), var(--sivom-cyan));
  border-radius: var(--radius-full);
  transition: width var(--transition-base);
  position: relative;
  overflow: hidden;
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.progress-details {
  display: flex;
  justify-content: space-between;
  font-size: 0.875rem;
  color: var(--gray-600);
}

.progress-info {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

/* === Section résultats === */
.results-section {
  margin-bottom: var(--space-12);
}

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-6);
}

.results-header h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #111827;
  margin: 0;
}

.results-list {
  display: grid;
  gap: var(--space-4);
}

.result-item {
  background: rgba(255, 255, 255, 0.95);
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  border: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  gap: var(--space-4);
  transition: all var(--transition-base);
  animation: slideInUp 0.3s ease;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.result-item:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

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

.result-icon {
  width: 2.5rem;
  height: 2.5rem;
  background: var(--success-100);
  color: var(--success-600);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.result-info {
  flex: 1;
  min-width: 0;
}

.result-name {
  font-weight: 600;
  color: #111827;
  margin-bottom: var(--space-1);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-url {
  font-size: 0.875rem;
  color: var(--gray-500);
  font-family: var(--font-family-mono);
  word-break: break-all;
  line-height: 1.4;
}

.result-actions {
  display: flex;
  gap: var(--space-2);
  flex-shrink: 0;
}

/* === Fichiers récents === */
.recent-section {
  margin-bottom: var(--space-12);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-6);
}

.section-header h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #111827;
  margin: 0;
}

.recent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-4);
}

.file-card {
  background: rgba(255, 255, 255, 0.95);
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  border: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  transition: all var(--transition-base);
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.file-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
  border-color: var(--sivom-bleu);
}

.file-icon {
  width: 2.5rem;
  height: 2.5rem;
  background: var(--gray-100);
  color: var(--gray-600);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.file-icon svg {
  width: 1.25rem;
  height: 1.25rem;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.file-info {
  flex: 1;
  min-width: 0;
}

.file-name {
  font-weight: 600;
  color: #111827;
  margin-bottom: var(--space-1);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-meta {
  font-size: 0.75rem;
  color: #374151;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  color: #4b5563;
  font-weight: 500;
}

.meta-separator {
  color: var(--gray-400);
}

.file-actions {
  display: flex;
  gap: var(--space-1);
  flex-shrink: 0;
}

/* État vide */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: var(--space-12);
  color: var(--gray-500);
}

.empty-state h4 {
  font-size: 1.125rem;
  color: #1f2937;
  margin-bottom: var(--space-2);
  font-weight: 600;
}

.empty-icon {
  width: 3rem;
  height: 3rem;
  margin: 0 auto var(--space-4);
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  color: var(--gray-400);
}

/* === Modals === */
.modal {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  animation: fadeIn 0.2s ease;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgb(0 0 0 / 0.5);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  background: rgba(255, 255, 255, 0.95);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-2xl);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow: hidden;
  animation: scaleIn 0.2s ease;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-6);
  border-bottom: 1px solid var(--gray-200);
  background: linear-gradient(135deg, var(--sivom-bleu), var(--sivom-cyan));
}

.modal-header h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: white;
  margin: 0;
}

.modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  background: none;
  border: none;
  border-radius: var(--radius);
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.modal-body {
  padding: var(--space-6);
  max-height: 70vh;
  overflow-y: auto;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
  margin-top: var(--space-6);
  padding-top: var(--space-6);
  border-top: 1px solid var(--gray-200);
}

/* === Formulaires === */
.form-group {
  margin-bottom: var(--space-4);
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-700);
  margin-bottom: var(--space-2);
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: var(--space-3);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 0.875rem;
  transition: all var(--transition-fast);
  background: rgba(255, 255, 255, 0.9);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--sivom-bleu);
  box-shadow: 0 0 0 3px rgba(37, 65, 147, 0.1);
}

.form-group textarea {
  resize: vertical;
  min-height: 5rem;
  line-height: 1.5;
}

.form-help {
  display: block;
  font-size: 0.75rem;
  color: var(--gray-500);
  margin-top: var(--space-1);
  line-height: 1.4;
}

/* === Notifications === */
.notifications {
  position: fixed;
  top: var(--space-4);
  right: var(--space-4);
  z-index: var(--z-notification);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  max-width: 400px;
  pointer-events: none;
}

.notification {
  background: rgba(255, 255, 255, 0.95);
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--gray-200);
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  animation: slideInRight 0.3s ease;
  pointer-events: auto;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.notification::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
}

.notification.success::before {
  background: var(--sivom-vert);
}

.notification.error::before {
  background: var(--sivom-rouge);
}

.notification.info::before {
  background: var(--sivom-cyan);
}

.notification.warning::before {
  background: var(--sivom-jaune);
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.notification-icon {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
  margin-top: 0.125rem;
}

.notification.success .notification-icon {
  color: var(--sivom-vert);
}

.notification.error .notification-icon {
  color: var(--sivom-rouge);
}

.notification.info .notification-icon {
  color: var(--sivom-cyan);
}

.notification.warning .notification-icon {
  color: var(--sivom-jaune);
}

.notification-content {
  flex: 1;
  min-width: 0;
}

.notification-title {
  font-weight: 500;
  color: var(--gray-900);
  margin-bottom: var(--space-1);
  line-height: 1.25;
}

.notification-message {
  font-size: 0.875rem;
  color: var(--gray-600);
  line-height: 1.4;
}

.notification-close {
  background: none;
  border: none;
  color: var(--gray-400);
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
  transition: color var(--transition-fast);
}

.notification-close:hover {
  color: var(--gray-600);
}

/* === Footer === */
.app-footer {
  background: var(--sivom-bleu);
  color: rgba(255, 255, 255, 0.8);
  padding: var(--space-4) 0;
  margin-top: auto;
  position: relative;
  z-index: 1;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
}

.version {
  color: var(--sivom-jaune);
  font-family: var(--font-family-mono);
  font-size: 0.75rem;
}

/* === Utilitaires === */
.hidden {
  display: none !important;
}

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

.text-muted {
  color: var(--gray-500) !important;
}

/* === Responsive === */
@media (max-width: 768px) {
  .video-background video {
    opacity: 0.08; /* Plus transparent sur mobile */
  }
  
  .header-content {
    flex-direction: column;
    height: auto;
    padding: var(--space-4) 0;
    gap: var(--space-4);
  }

  .user-section {
    width: 100%;
    justify-content: space-between;
  }

  .header-actions {
    gap: var(--space-2);
  }

  .btn {
    font-size: 0.75rem;
    padding: var(--space-2) var(--space-3);
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .upload-area {
    padding: var(--space-6);
  }

  .recent-grid {
    grid-template-columns: 1fr;
  }

  .file-card {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-3);
  }

  .file-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .modal-content {
    margin: var(--space-4);
  }

  .footer-content {
    flex-direction: column;
    gap: var(--space-2);
    text-align: center;
  }

  .notifications {
    left: var(--space-2);
    right: var(--space-2);
    max-width: none;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 var(--space-3);
  }

  .main-content {
    padding: var(--space-6) 0;
  }

  .app-title {
    font-size: 1.25rem;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-3);
  }

  .modal {
    padding: var(--space-2);
  }
}

/* === Préférences d'accessibilité === */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .video-background video {
    animation: none;
  }
}

/* Désactivation vidéo pour économiser la batterie */
@media (prefers-reduced-motion: reduce) {
  .video-background {
    display: none;
  }
  
  body {
    background: linear-gradient(135deg, 
      rgba(37, 65, 147, 0.03), 
      rgba(0, 158, 227, 0.02)
    );
  }
}

/* Mode sombre automatique */
@media (prefers-color-scheme: dark) {
  :root {
    --gray-50: #111827;
    --gray-100: #1f2937;
    --gray-200: #374151;
    --gray-300: #4b5563;
    --gray-400: #6b7280;
    --gray-500: #9ca3af;
    --gray-600: #d1d5db;
    --gray-700: #e5e7eb;
    --gray-800: #f3f4f6;
    --gray-900: #f9fafb;
  }
  
  .video-background::after {
    background: linear-gradient(135deg, 
      rgba(17, 24, 39, 0.9), 
      rgba(17, 24, 39, 0.8)
    );
  }
}