/**
 * ŒnoT Design System
 * Single source of truth pour tous les styles
 * Pas de framework JS - HTML/CSS pur
 */

/* ============================================
   DESIGN TOKENS (Variables CSS)
   ============================================ */
:root {
  /* Couleurs de fond */
  --bg-primary: #ffffff;
  --bg-content: #f9fafb;
  --bg-card: #ffffff;
  --bg-secondary: #f3f4f6;
  --bg-tertiary: #e5e7eb;
  --bg-header: #2d1b4e;
  
  /* Couleurs de texte */
  --text-primary: #1f2937;
  --text-secondary: #4b5563;
  --text-muted: #6b7280;
  --text-inverse: #ffffff;
  
  /* Couleurs brand */
  --primary: #7c3aed;
  --primary-light: #9333ea;
  --primary-dark: #5b21b6;
  --accent-primary: #ff2d8b;
  --accent-secondary: #ec4899;
  
  /* Bordures */
  --border-light: #e5e7eb;
  --border-medium: #d1d5db;
  --border-dark: #9ca3af;
  --border-color: var(--border-light);
  
  /* Border radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 24px;
  --radius-full: 9999px;
  
  /* Espacements */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;
  --space-4xl: 96px;
  
  /* Ombres */
  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  
  /* Transitions */
  --transition: 150ms ease;
  --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  
  /* États */
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info-accent: var(--accent-primary);
  
  /* Pavés d'information (SANS BLEU) */
  --info-bg: color-mix(in srgb, var(--bg-secondary) 92%, white 8%);
  --info-border: var(--border-light);
  --info-text: var(--text-primary);
  --info-muted: var(--text-secondary);
  
  /* Typographie */
  --font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 2rem;
  --font-size-4xl: 2.5rem;
}

/* Accessibility: Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

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

body {
  font-family: var(--font-family);
  color: var(--text-primary);
  background: var(--bg-content);
  line-height: 1.6;
  font-size: var(--font-size-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-weight: 400;
}

/* Gradient background variant */
.gradient-bg {
  background: linear-gradient(135deg, #1a0f2e 0%, #2d1b4e 25%, #4a1942 50%, #2d1b4e 75%, #1a0f2e 100%);
  background-attachment: fixed;
  background-size: 400% 400%;
  animation: gradientShift 20s ease-in-out infinite;
  will-change: background-position;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  25% { background-position: 100% 50%; }
  50% { background-position: 100% 100%; }
  75% { background-position: 0% 100%; }
  100% { background-position: 0% 50%; }
}

/* Text selection */
::selection {
  background: var(--accent-primary);
  color: var(--text-inverse);
}

::-moz-selection {
  background: var(--accent-primary);
  color: var(--text-inverse);
}

/* ============================================
   LAYOUT COMPONENTS
   ============================================ */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.container-fluid {
  width: 100%;
  padding: 0 var(--space-lg);
}

/* ============================================
   CARD COMPONENTS
   ============================================ */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  padding: var(--space-xl);
  transition: all var(--transition-slow);
}

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

.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  transition: all var(--transition-slow);
  text-align: center;
}

.stat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--primary);
}

.stat-number {
  font-size: var(--font-size-4xl);
  font-weight: 800;
  color: var(--primary);
  margin-bottom: var(--space-sm);
  line-height: 1;
}

.stat-label {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Stats grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-lg);
  margin-bottom: var(--space-2xl);
}


/* ============================================
   HERO SECTION - MINIMALISTE
   ============================================ */
.hero {
  background: transparent;
  padding: var(--space-xl) 0 var(--space-lg) 0;
  text-align: center;
}

.hero-title {
  font-size: var(--font-size-2xl);
  font-weight: 700;
  color: var(--primary);
  margin-bottom: var(--space-sm);
  line-height: 1.2;
}

.hero-subtitle {
  font-size: var(--font-size-base);
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.5;
}

@media (max-width: 767px) {
  .hero {
    padding: var(--space-lg) 0 var(--space-md) 0;
  }
  
  .hero-title {
    font-size: var(--font-size-xl);
  }
  
  .hero-subtitle {
    font-size: var(--font-size-sm);
  }
}


/* ============================================
   BUTTON COMPONENTS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-xl);
  border-radius: var(--radius-lg);
  font-weight: 600;
  font-size: var(--font-size-base);
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all var(--transition-slow);
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: var(--text-inverse);
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: var(--text-inverse);
}

.btn-ghost {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-medium);
}

.btn-ghost:hover {
  background: var(--bg-secondary);
  border-color: var(--border-dark);
}

.btn-danger {
  background: var(--danger);
  color: var(--text-inverse);
}

.btn-danger:hover {
  background: color-mix(in srgb, var(--danger) 90%, black 10%);
}

.btn:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

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

/* ============================================
   FORM COMPONENTS
   ============================================ */
.search-input,
.form-input,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea {
  width: 100%;
  padding: var(--space-md);
  border: 2px solid var(--border-light);
  border-radius: var(--radius-lg);
  font-size: var(--font-size-base);
  background: var(--bg-card);
  color: var(--text-primary);
  font-family: var(--font-family);
  transition: all var(--transition);
}

.search-input:focus,
.form-input:focus,
input:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.search-input::placeholder,
.form-input::placeholder,
input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
}

/* Select */
.sort-select,
select {
  width: 100%;
  padding: var(--space-md);
  border: 2px solid var(--border-light);
  border-radius: var(--radius-lg);
  font-size: var(--font-size-base);
  background: var(--bg-card);
  color: var(--text-primary);
  font-family: var(--font-family);
  cursor: pointer;
  transition: all var(--transition);
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
  background-position: right var(--space-sm) center;
  background-repeat: no-repeat;
  background-size: 16px;
  padding-right: calc(var(--space-md) * 2 + 16px);
}

.sort-select:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

/* ============================================
   INFO/TRANSCRIPTION COMPONENTS (SANS BLEU)
   ============================================ */
.transcription-info,
.info-box {
  background: var(--info-bg);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  border: 1px solid var(--info-border);
  box-shadow: var(--shadow-xs);
  position: relative;
  margin-bottom: var(--space-md);
}

.transcription-info::before,
.info-box::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--info-accent);
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
  opacity: 0.9;
}

.transcription-title,
.info-title {
  font-size: var(--font-size-sm);
  font-weight: 700;
  color: var(--info-text);
  margin-bottom: var(--space-sm);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.transcription-title svg,
.info-title svg {
  color: var(--info-accent);
  width: 20px;
  height: 20px;
}

.transcription-data,
.info-content {
  font-size: var(--font-size-sm);
  color: var(--info-muted);
  line-height: 1.5;
  font-style: italic;
  background: color-mix(in srgb, var(--info-bg) 70%, white 30%);
  padding: var(--space-sm);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--info-accent);
}

/* ============================================
   BADGE COMPONENTS
   ============================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-primary {
  background: color-mix(in srgb, var(--primary) 10%, transparent 90%);
  color: var(--primary);
  border: 1px solid color-mix(in srgb, var(--primary) 20%, transparent 80%);
}

.badge-success {
  background: color-mix(in srgb, var(--success) 10%, transparent 90%);
  color: var(--success);
  border: 1px solid color-mix(in srgb, var(--success) 20%, transparent 80%);
}

.badge-warning {
  background: color-mix(in srgb, var(--warning) 10%, transparent 90%);
  color: var(--warning);
  border: 1px solid color-mix(in srgb, var(--warning) 20%, transparent 80%);
}

.badge-danger {
  background: color-mix(in srgb, var(--danger) 10%, transparent 90%);
  color: var(--danger);
  border: 1px solid color-mix(in srgb, var(--danger) 20%, transparent 80%);
}

/* ============================================
   ICON UTILITIES
   ============================================ */
.icon {
  width: 24px;
  height: 24px;
  display: inline-block;
  vertical-align: middle;
}

.icon-sm {
  width: 16px;
  height: 16px;
}

.icon-lg {
  width: 32px;
  height: 32px;
}

.icon-xl {
  width: 48px;
  height: 48px;
}

.icon-2xl {
  width: 64px;
  height: 64px;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

@keyframes slideInUp {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn var(--transition-slow);
}

.fade-in-up {
  animation: fadeInUp var(--transition-slow);
}

.slide-in-up {
  animation: slideInUp var(--transition-slow);
}

/* ============================================
   RESPONSIVE UTILITIES
   ============================================ */
@media (max-width: 767px) {
  .container {
    padding: 0 var(--space-md);
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }
  
  .btn {
    width: 100%;
    justify-content: center;
  }
  
  .hide-mobile {
    display: none !important;
  }
}

@media (min-width: 768px) {
  .hide-desktop {
    display: none !important;
  }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.text-center {
  text-align: center;
}

.text-left {
  text-align: left;
}

.text-right {
  text-align: right;
}

.text-primary {
  color: var(--text-primary) !important;
}

.text-secondary {
  color: var(--text-secondary) !important;
}

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

.text-inverse {
  color: var(--text-inverse) !important;
}

.font-bold {
  font-weight: 700;
}

.font-semibold {
  font-weight: 600;
}

.font-medium {
  font-weight: 500;
}

.mt-xs { margin-top: var(--space-xs); }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mt-2xl { margin-top: var(--space-2xl); }

.mb-xs { margin-bottom: var(--space-xs); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }
.mb-2xl { margin-bottom: var(--space-2xl); }

.p-xs { padding: var(--space-xs); }
.p-sm { padding: var(--space-sm); }
.p-md { padding: var(--space-md); }
.p-lg { padding: var(--space-lg); }
.p-xl { padding: var(--space-xl); }
.p-2xl { padding: var(--space-2xl); }

.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.gap-xl { gap: var(--space-xl); }

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
  body {
    background: white;
    color: black;
  }
  
  .no-print,
  button,
  .btn {
    display: none !important;
  }
  
  .card,
  .stat-card {
    box-shadow: none;
    border: 1px solid #ddd;
  }
}
