/* ===========================================================
   🎨 TADAKSAHAK LEARNING - STYLE PREMIUM ULTIME
   Version 4.2 - Design System complet avec nouvelles sections
   Thèmes : Dark, Light, Sepia
   Auteur : Hamadine AG MOCTAR
   =========================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600&family=Noto+Sans+Arabic:wght@400;500;600&family=Noto+Naskh+Arabic:wght@500;600&display=swap');

/* ============================================
   TYPOGRAPHIE - VARIABLES GLOBALES
   (indépendantes du thème clair/sombre/sépia)
   ============================================ */
:root {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Fraunces', Georgia, serif;
  --font-sans-ar: 'Noto Sans Arabic', 'Inter', sans-serif;
  --font-display-ar: 'Noto Naskh Arabic', 'Fraunces', serif;
}

/* ============================================
   DESIGN SYSTEM - VARIABLES
   ============================================ */

/* Thème sombre (par défaut) — indigo nocturne, écho du tissage teint à l'indigo */
body.dark {
  /* Couleurs primaires */
  --primary: #C09A3E;
  --primary-dark: #9C7D2F;
  --primary-light: #D4B45E;
  --accent: #B5602E;
  --accent-glow: rgba(181, 96, 46, 0.18);
  --secondary: #6B7FA3;
  --secondary-glow: rgba(107, 127, 163, 0.15);
  
  /* Couleurs de texte */
  --text: #E8DFC8;
  --text-muted: #A79C82;
  --text-light: #C7BCA0;
  
  /* Couleurs de fond */
  --bg: #14202F;
  --bg-light: #1B2942;
  --bg-card: #1F2E48;
  --bg-card-hover: #28395A;
  --bg-elevated: #223452;
  
  /* Couleurs de bordure */
  --border: #33445F;
  --border-light: #405577;
  --border-accent: rgba(192, 154, 62, 0.3);
  
  /* États */
  --hover: #D4B45E;
  --success: #4C8C5B;
  --warning: #C09A3E;
  --error: #B5402E;
  --info: #6B85B5;
  
  /* Ombres */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  --shadow-glow: 0 0 20px rgba(181, 96, 46, 0.3);
  --shadow-glow-secondary: 0 0 20px rgba(107, 127, 163, 0.3);
  
  /* Rayons */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.5rem;
  --radius-full: 9999px;
  
  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
  
  /* Gradients */
  --gradient-primary: linear-gradient(135deg, var(--primary), var(--primary-light));
  --gradient-secondary: linear-gradient(135deg, var(--secondary), #8fa3c9);
  --gradient-success: linear-gradient(135deg, #4C8C5B, #6BAA7A);
  --gradient-warning: linear-gradient(135deg, #C09A3E, #D4B45E);
  --gradient-danger: linear-gradient(135deg, #B5402E, #D4633F);
  --gradient-dark: linear-gradient(135deg, #1B2942, #223452);
  --gradient-glass: linear-gradient(135deg, rgba(232, 223, 200, 0.08), rgba(232, 223, 200, 0.02));
  
  /* Glassmorphism */
  --glass-bg: rgba(27, 41, 66, 0.7);
  --glass-border: rgba(232, 223, 200, 0.1);
  --glass-blur: blur(12px);
  
  /* Tailles */
  --header-height: 70px;
  --sidebar-width: 280px;
}

/* Thème clair */
body.light {
  --primary: #1B2942;
  --primary-dark: #101A2C;
  --primary-light: #2F4568;
  --accent: #B5602E;
  --accent-glow: rgba(181, 96, 46, 0.12);
  --secondary: #8B6A2E;
  --secondary-glow: rgba(139, 106, 46, 0.1);
  
  --text: #2A2A28;
  --text-muted: #6B6558;
  --text-light: #8B8578;
  
  --bg: #F5EFE0;
  --bg-light: #FFFFFF;
  --bg-card: #FFFFFF;
  --bg-card-hover: #EFE7D3;
  --bg-elevated: #F5EFE0;
  
  --border: #DED2B4;
  --border-light: #EAE0C8;
  --border-accent: rgba(181, 96, 46, 0.25);
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  
  --glass-bg: rgba(255, 255, 255, 0.8);
  --glass-border: rgba(42, 42, 40, 0.06);
}

/* Thème sépia — mode lecture chaleureux, papier ancien */
body.sepia {
  --primary: #8B6A2E;
  --primary-dark: #6E5424;
  --primary-light: #A98847;
  --accent: #B5602E;
  --accent-glow: rgba(181, 96, 46, 0.15);
  --secondary: #6B4C2C;
  --secondary-glow: rgba(107, 76, 44, 0.1);
  
  --text: #3b2a1f;
  --text-muted: #6b4c2c;
  --text-light: #8b6c4c;
  
  --bg: #FBF3E3;
  --bg-light: #FDF6EA;
  --bg-card: #F5E9D0;
  --bg-card-hover: #F0E0C0;
  --bg-elevated: #FBEFDA;
  
  --border: #d4b48c;
  --border-light: #e6d4b3;
  --border-accent: rgba(181, 96, 46, 0.3);
  
  --gradient-primary: linear-gradient(135deg, #8B6A2E, #A98847);
  --gradient-secondary: linear-gradient(135deg, #6B4C2C, #8B6914);
}

/* ============================================
   RESET & BASE
   ============================================ */

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

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color var(--transition), color var(--transition);
  font-weight: 400;
}

/* Police d'affichage pour les titres principaux — porte l'identité du site */
h1, h2, #motTexte, .grammar-page-title {
  font-family: var(--font-display);
}

/* Arabe : polices dédiées (rendu correct du script + lisibilité) */
[dir="rtl"] body,
[dir="rtl"] {
  font-family: var(--font-sans-ar);
}

[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] #motTexte, [dir="rtl"] .grammar-page-title {
  font-family: var(--font-display-ar);
}

/* Scrollbar personnalisée */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
  border-radius: var(--radius-full);
}

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

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

/* ============================================
   SKIP LINK
   ============================================ */

.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--gradient-primary);
  color: white;
  padding: 12px 24px;
  text-decoration: none;
  border-radius: var(--radius-md);
  z-index: 1000;
  transition: top var(--transition);
  font-weight: 500;
}

.skip-link:focus {
  top: 80px;
  outline: none;
}

/* ============================================
   LOADER
   ============================================ */

.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  gap: 1rem;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.loading-overlay p {
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* ============================================
   BANNIÈRE DE DÉVELOPPEMENT
   ============================================ */

.dev-banner {
  background: linear-gradient(135deg, #C09A3E, #B5602E);
  color: white;
  padding: 0.75rem 1rem;
  position: relative;
  z-index: 101;
  animation: slideDown 0.5s ease;
}

.dev-banner-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  max-width: 1200px;
  margin: 0 auto;
}

.dev-badge {
  background: rgba(255, 255, 255, 0.2);
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.dev-message {
  font-size: 0.85rem;
}

.dev-banner-close {
  background: transparent;
  border: none;
  color: white;
  cursor: pointer;
  font-size: 1.2rem;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-full);
  transition: background var(--transition);
}

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

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-100%);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */

.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 400px;
  pointer-events: none;
}

.toast {
  background: var(--bg-card);
  backdrop-filter: blur(8px);
  color: var(--text);
  padding: 12px 20px;
  border-radius: var(--radius-lg);
  border-left: 3px solid var(--primary);
  box-shadow: var(--shadow-xl);
  pointer-events: auto;
  animation: toastSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  font-size: 0.875rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 12px;
}

.toast-success { border-left-color: var(--success); }
.toast-warning { border-left-color: var(--warning); }
.toast-error { border-left-color: var(--error); }

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

/* ============================================
   HEADER & NAVIGATION
   ============================================ */

main {
  padding-top: 180px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--glass-border);
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas:
    "logo title lang"
    "theme theme theme"
    "nav nav nav";
  align-items: center;
  gap: 0.75rem 1.5rem;
  padding: 1rem 2rem;
}

.header-container {
  grid-area: logo;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  justify-self: start;
}

.header-text {
  grid-area: title;
  text-align: center;
}

.theme-selector {
  grid-area: theme;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  background: var(--glass-bg);
  border-radius: var(--radius-full);
  border: 1px solid var(--glass-border);
}

.lang-selector {
  grid-area: lang;
  display: flex;
  gap: 0.5rem;
  justify-self: end;
}

/* ============================================
   NAVIGATION À PÔLES — pilliers cliquables + sous-navigation
   Remplace l'ancien menu déroulant <select> par une hiérarchie
   visuelle réelle (le <select> reste présent, caché, pour la
   compatibilité avec le code existant et l'accessibilité).
   ============================================ */

.main-nav {
  grid-area: nav;
  width: 100%;
}

.nav-pillars {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.35rem;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);
  max-width: 720px;
  margin: 0 auto;
}

.nav-pillar {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-full);
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.nav-pillar:hover {
  color: var(--text);
  background: var(--bg-card-hover);
}

.nav-pillar.active {
  background: var(--gradient-primary);
  color: var(--bg);
}

.nav-subsections {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 0.6rem;
}

.nav-chip {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color var(--transition-fast), color var(--transition-fast);
}

.nav-chip:hover {
  color: var(--text);
  border-color: var(--accent);
}

.nav-chip.active {
  color: var(--accent);
  border-color: var(--accent);
  font-weight: 600;
}

@media (min-width: 1025px) {
  .site-header {
    grid-template-columns: auto 1fr auto;
    grid-template-areas:
      "logo title lang"
      "theme theme theme"
      "nav nav nav";
  }
}

@media (max-width: 480px) {
  .site-header {
    grid-template-columns: 1fr;
    grid-template-areas:
      "logo"
      "title"
      "lang"
      "theme"
      "nav";
    gap: 0.5rem;
  }
  .header-container {
    justify-self: center;
  }
  .lang-selector {
    justify-self: center;
  }
  main {
    padding-top: 240px;
  }
}

@media (max-width: 768px) {
  main {
    padding-top: 240px;
  }
}

.logo-header {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  transition: transform var(--transition);
  box-shadow: var(--shadow-md);
}

.logo-header:hover {
  transform: scale(1.05);
}

.header-text h1 {
  font-size: 1.5rem;
  font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: -0.02em;
}

.header-text .subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* ============================================
   BOUTONS PREMIUM
   ============================================ */

.btn-primary {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.3) 0%, transparent 50%);
  z-index: -1;
  opacity: 0;
  transition: opacity var(--transition);
}

.btn-primary:hover::before {
  opacity: 1;
}

.btn-primary:active {
  transform: scale(0.98);
  box-shadow: var(--shadow-md);
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--accent);
  color: var(--accent);
  box-shadow: none;
}

.btn-outline:hover {
  background: var(--accent);
  color: var(--bg-card);
  border-color: var(--accent);
  box-shadow: var(--shadow-glow);
}

.lang-flag {
  position: relative;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  border: 1.5px solid var(--glass-border);
  font-size: 1rem;
  font-weight: 600;
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  color: var(--text);
  transition: all var(--transition-bounce);
  box-shadow: var(--shadow-sm);
  letter-spacing: 0.3px;
  overflow: hidden;
  isolation: isolate;
}

.lang-flag::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.6s ease;
  z-index: -1;
}

.lang-flag:hover::before {
  left: 100%;
}

.lang-flag:hover {
  transform: translateY(-4px) scale(1.02);
  border-color: var(--accent);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  color: white;
  background: var(--gradient-primary);
  border-color: transparent;
}

.lang-flag.active {
  background: var(--gradient-primary);
  border-color: var(--accent);
  color: white;
  box-shadow: var(--shadow-glow);
  font-weight: 700;
  animation: softPulse 2s infinite;
}

@keyframes softPulse {
  0%, 100% { box-shadow: var(--shadow-glow), 0 0 0 0 rgba(0, 212, 255, 0.4); }
  50% { box-shadow: var(--shadow-glow), 0 0 0 6px rgba(0, 212, 255, 0); }
}

/* ============================================
   STATISTIQUES AMÉLIORÉES
   ============================================ */

.stats-grid {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin: 2rem 0;
}

.stat-card.premium {
  background: var(--bg-card);
  padding: 1.5rem 2rem;
  border-radius: var(--radius-xl);
  text-align: center;
  border: 1px solid var(--border);
  transition: all var(--transition);
  min-width: 140px;
  position: relative;
  overflow: hidden;
}

.stat-card.premium::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-primary);
  transform: scaleX(0);
  transition: transform var(--transition);
}

.stat-card.premium:hover::before {
  transform: scaleX(1);
}

.stat-card.premium:hover {
  transform: translateY(-5px);
  border-color: var(--accent);
}

.stat-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.stat-number {
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent);
  display: block;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ============================================
   SECTION ACTUALITÉS
   ============================================ */

.actualites-header {
  text-align: center;
  margin-bottom: 2rem;
  padding: 1rem;
}

.actualites-subtitle {
  color: var(--text-muted);
  font-size: 1rem;
}

.actualites-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 2rem;
  margin: 2rem 0;
}

.actu-card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: all var(--transition);
  border: 1px solid var(--border);
  animation: fadeInUp 0.5s ease;
}

.actu-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-xl);
  border-color: var(--accent);
}

.actu-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  transition: transform var(--transition);
}

.actu-card:hover .actu-image {
  transform: scale(1.05);
}

.actu-placeholder {
  width: 100%;
  height: 200px;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
}

.actu-content {
  padding: 1.5rem;
}

.actu-meta {
  display: flex;
  gap: 1rem;
  margin-bottom: 0.75rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.actu-category {
  background: rgba(0, 212, 255, 0.1);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
}

.actu-title {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
  line-height: 1.4;
}

.actu-excerpt {
  color: var(--text-light);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.actu-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: gap var(--transition);
}

.actu-link:hover {
  gap: 0.75rem;
}

.actualites-footer {
  text-align: center;
  margin-top: 2rem;
}

/* ============================================
   SECTION PARTENAIRES
   ============================================ */

.partenaires-subtitle {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.partenaires-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
}

.partenaire-card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: 2rem;
  text-align: center;
  border: 1px solid var(--border);
  transition: all var(--transition);
  animation: fadeInUp 0.5s ease;
}

.partenaire-card:hover {
  transform: translateY(-5px);
  border-color: var(--accent);
  box-shadow: var(--shadow-xl);
}

.partenaire-logo {
  width: 100px;
  height: 100px;
  margin: 0 auto 1rem;
  background: var(--bg-elevated);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
}

.partenaire-name {
  font-size: 1.2rem;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.partenaire-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

/* ============================================
   GALERIE AVEC FILTRES
   ============================================ */

.gallery-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-bottom: 2rem;
}

.gallery-filter {
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  transition: all var(--transition);
}

.gallery-filter:hover,
.gallery-filter.active {
  background: var(--gradient-primary);
  color: white;
  border-color: transparent;
}

/* ============================================
   TIMELINE AVEC FILTRES
   ============================================ */

.timeline-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-bottom: 2rem;
}

.timeline-filter {
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  transition: all var(--transition);
}

.timeline-filter:hover,
.timeline-filter.active {
  background: var(--gradient-primary);
  color: white;
  border-color: transparent;
}

.timeline-vertical {
  position: relative;
  padding-left: 2rem;
}

.timeline-vertical::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--gradient-primary);
}

.timeline-item {
  position: relative;
  margin-bottom: 2rem;
  padding-left: 2rem;
  opacity: 0;
  transform: translateX(-20px);
  transition: all 0.5s ease;
}

.timeline-item.visible {
  opacity: 1;
  transform: translateX(0);
}

.timeline-marker {
  position: absolute;
  left: -0.5rem;
  top: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.timeline-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg-card);
  z-index: 1;
}

.timeline-dot.reunion { background: #6B7FA3; }
.timeline-dot.campagne { background: #4C8C5B; }
.timeline-dot.creation { background: #C09A3E; }
.timeline-dot.evenement { background: #8B6A2E; }

.timeline-line {
  width: 2px;
  flex: 1;
  background: linear-gradient(to bottom, var(--border), transparent);
  margin: 4px 0;
}

.timeline-content {
  background: var(--bg-card);
  padding: 1rem 1.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  transition: all var(--transition);
}

.timeline-content:hover {
  transform: translateX(5px);
  border-color: var(--accent);
}

.timeline-date {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.timeline-lieu {
  font-size: 0.8rem;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.timeline-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  margin-top: 0.5rem;
}

.timeline-badge.reunion { background: rgba(107,127,163,0.2); color: #6B7FA3; }
.timeline-badge.campagne { background: rgba(76,140,91,0.2); color: #4C8C5B; }
.timeline-badge.creation { background: rgba(192,154,62,0.2); color: #C09A3E; }

/* ============================================
   NEWSLETTER POPUP
   ============================================ */

.newsletter-popup {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  animation: fadeIn 0.3s ease;
}

.newsletter-popup-content {
  background: var(--bg-card);
  border-radius: var(--radius-2xl);
  padding: 2rem;
  max-width: 450px;
  width: 90%;
  text-align: center;
  position: relative;
  animation: modalSlideUp 0.3s ease;
}

.newsletter-close {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
  transition: color var(--transition);
}

.newsletter-close:hover {
  color: var(--error);
}

.newsletter-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.newsletter-popup h3 {
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.newsletter-popup p {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.newsletter-form {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.newsletter-form input {
  flex: 1;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
}

.newsletter-form button {
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-full);
  background: var(--gradient-primary);
  border: none;
  color: white;
  cursor: pointer;
  transition: all var(--transition);
}

.newsletter-form button:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.newsletter-note {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* ============================================
   PANEL ACCESSIBILITÉ
   ============================================ */

.accessibility-panel {
  position: fixed;
  bottom: 100px;
  left: 24px;
  background: var(--bg-card);
  border-radius: 60px;
  padding: 8px 12px;
  box-shadow: var(--shadow-xl);
  display: flex;
  gap: 8px;
  z-index: 9999;
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
}

.accessibility-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--bg-elevated);
  color: var(--text);
  cursor: pointer;
  font-size: 1rem;
  font-weight: bold;
  transition: all var(--transition);
}

.accessibility-btn:hover {
  background: var(--gradient-primary);
  color: white;
  transform: scale(1.1);
}

/* ============================================
   FOOTER AMÉLIORÉ
   ============================================ */

.site-footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 2rem 1.5rem 1rem;
  margin-top: auto;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
}

.footer-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-column h4 {
  color: var(--accent);
  margin-bottom: 1rem;
  font-size: 1rem;
}

.footer-column ul {
  list-style: none;
  padding: 0;
}

.footer-column li {
  margin-bottom: 0.5rem;
}

.footer-column a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition);
}

.footer-column a:hover {
  color: var(--accent);
}

.social-links {
  display: flex;
  gap: 1rem;
}

.social-link {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated);
  border-radius: 50%;
  text-decoration: none;
  transition: all var(--transition);
}

.social-link:hover {
  background: var(--gradient-primary);
  transform: translateY(-3px);
}

.historique-section {
  text-align: center;
  padding: 1rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
  font-size: 0.8rem;
}

.footer-copyright {
  text-align: center;
  font-size: 0.7rem;
  color: var(--text-muted);
}

.footer-version {
  margin-top: 0.25rem;
  font-size: 0.6rem;
  opacity: 0.5;
}

/* ============================================
   SHARE BUTTONS
   ============================================ */

.share-section {
  margin: 1rem 0;
  text-align: center;
}

.share-buttons {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
}

.share-btn {
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all var(--transition);
}

.share-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
}

.share-btn.whatsapp { background: #25D366; color: white; }
.share-btn.twitter { background: #1DA1F2; color: white; }
.share-btn.facebook { background: #1877F2; color: white; }
.share-btn.copy { background: var(--bg-elevated); color: var(--text); }

/* ============================================
   ANIMATIONS GÉNÉRALES
   ============================================ */

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

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

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

.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================
   MODAL
   ============================================ */

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  animation: fadeIn 0.2s ease;
}

.modal-content {
  background: var(--bg-card);
  border-radius: var(--radius-2xl);
  max-width: 90%;
  max-height: 85%;
  overflow-y: auto;
  padding: 2rem;
  position: relative;
  animation: modalSlideUp 0.3s ease;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  font-size: 1.8rem;
  cursor: pointer;
  color: var(--text-muted);
  transition: color var(--transition);
}

.modal-close:hover {
  color: var(--error);
}

/* ============================================
   RTL SUPPORT
   ============================================ */

html[dir="rtl"] {
  direction: rtl;
  text-align: right;
}

html[dir="rtl"] .timeline-vertical {
  padding-left: 0;
  padding-right: 2rem;
}

html[dir="rtl"] .timeline-vertical::before {
  left: auto;
  right: 0;
}

html[dir="rtl"] .timeline-item {
  padding-left: 0;
  padding-right: 2rem;
}

html[dir="rtl"] .timeline-marker {
  left: auto;
  right: -0.5rem;
}

html[dir="rtl"] .quiz-option:hover {
  transform: translateX(-5px);
}

/* ============================================
   LIVRE DE GRAMMAIRE
   ============================================ */

:root {
  --bg-book: #fdfbf7;
  --bg-page: #fffdf9;
  --shadow-book: 0 20px 40px rgba(0,0,0,0.15);
  --font-serif: var(--font-display);
}

body.dark {
  --bg-book: #1F2E48;
  --bg-page: #223452;
}

/* ============================================
   LECTEUR DE GRAMMAIRE — table des matières + page de lecture
   Remplace l'ancien "livre à deux pages" (trop étriqué, contenu
   difficile à parcourir) par un vrai lecteur : sommaire cliquable
   listant les 30 blocs, et une page de lecture confortable.
   ============================================ */

.grammar-source-credit {
  max-width: 900px;
  margin: 0 auto 1.5rem;
  padding: 0.75rem 1.25rem;
  background: var(--bg-elevated);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
}

.grammar-reader {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.5rem;
  max-width: 1400px;
  margin: 0 auto;
  align-items: start;
}

.grammar-toc {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  max-height: 75vh;
  overflow-y: auto;
  padding: 0.5rem;
  position: sticky;
  top: 100px;
}

.toc-entry {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  width: 100%;
  text-align: left;
  padding: 0.6rem 0.75rem;
  border: none;
  background: transparent;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  line-height: 1.35;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.toc-entry:hover {
  background: var(--bg-card-hover);
  color: var(--text);
}

.toc-entry.active {
  background: var(--accent-glow);
  color: var(--accent);
  font-weight: 600;
}

.toc-num {
  flex-shrink: 0;
  opacity: 0.6;
  font-variant-numeric: tabular-nums;
}

.grammar-page {
  background: var(--bg-page);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-book);
  padding: 2.5rem 3rem;
  min-height: 500px;
}

.grammar-page-header {
  display: flex;
  justify-content: space-between;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 10px;
  margin-bottom: 1.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.grammar-page-title {
  font-family: var(--font-display);
  color: var(--accent);
  font-size: 1.7rem;
  margin-bottom: 1.5rem;
  line-height: 1.3;
}

.grammar-page-content {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text);
}

.grammar-page-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 1.5rem;
}

.keyword-tag {
  background: var(--bg-elevated);
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 0.7rem;
  color: var(--accent);
  border: 1px solid var(--border);
}

.grammar-page-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px dashed var(--border);
}

.nav-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 0.6rem 1.25rem;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
}

.nav-btn:hover:not(:disabled) {
  background: var(--accent);
  color: var(--bg);
  transform: scale(1.04);
}

.nav-btn:disabled {
  opacity: 0.3;
  pointer-events: none;
}

.lang-selector-book {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-bottom: 20px;
}

.lang-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 0.8rem;
  cursor: pointer;
  color: var(--text-muted);
}

.lang-btn.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

@media (max-width: 900px) {
  .grammar-reader {
    grid-template-columns: 1fr;
  }
  .grammar-toc {
    max-height: 240px;
    position: static;
  }
  .grammar-page {
    padding: 1.75rem 1.5rem;
  }
}

/* ============================================
   DICTIONNAIRE
   ============================================ */

.search-section {
  margin: 2rem auto;
  max-width: 600px;
  position: relative;
}

.search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

#searchBar {
  width: 100%;
  padding: 1rem 3rem 1rem 1.5rem;
  font-size: 1rem;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius-full);
  color: var(--text);
  transition: all var(--transition);
}

#searchBar:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--shadow-glow);
}

.clear-search {
  position: absolute;
  right: 16px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.2rem;
  padding: 4px;
  border-radius: 50%;
  transition: color var(--transition);
}

.clear-search:hover {
  color: var(--accent);
}

.suggestions-list {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xl);
  max-height: 300px;
  overflow-y: auto;
  z-index: 50;
  opacity: 0;
  transform: translateY(-10px);
  transition: all var(--transition);
  pointer-events: none;
}

.suggestions-list.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.result-section {
  background: var(--bg-card);
  border-radius: var(--radius-2xl);
  padding: 2rem;
  margin-top: 2rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
}

#motTexte {
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  text-align: center;
  margin-bottom: 1rem;
}

.navigation-mots {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1.5rem;
  gap: 1rem;
}

.alphabet-section {
  margin-top: 3rem;
}

.alphabet-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.alphabet-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--accent);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.alphabet-btn:hover {
  background: var(--gradient-primary);
  color: white;
  transform: translateY(-2px);
}

.word-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.75rem;
  max-height: 400px;
  overflow-y: auto;
  padding: 0.5rem;
}

.mot-item {
  padding: 0.75rem;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
}

.mot-item:hover {
  background: var(--gradient-primary);
  color: white;
  transform: translateX(5px);
}

/* ============================================
   GRAMMAIRE TABS
   ============================================ */

.grammar-tabs {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 2rem;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0.5rem;
}

.grammar-tab {
  padding: 0.75rem 1.5rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
}

.grammar-tab:hover {
  color: var(--accent);
}

.grammar-tab.active {
  color: var(--accent);
}

.grammar-tab.active::after {
  content: '';
  position: absolute;
  bottom: -0.5rem;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient-primary);
  border-radius: var(--radius-full);
}

/* ============================================
   PROPOSITIONS RELATIVES
   ============================================ */

.relatives-premium-intro {
  text-align: center;
  margin-bottom: 2rem;
  padding: 2rem;
  background: var(--gradient-glass);
  border-radius: var(--radius-2xl);
}

.relatives-premium-intro .premium-icon {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.strategies-premium-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 1.5rem;
}

.strategy-premium-card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: all var(--transition);
}

.strategy-premium-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-xl);
  border-color: var(--accent);
}

.strategy-header {
  background: var(--gradient-primary);
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.strategy-marker {
  font-size: 1.2rem;
  font-weight: 700;
  color: white;
  font-family: monospace;
}

.strategy-type {
  font-size: 0.7rem;
  background: rgba(255, 255, 255, 0.2);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  color: white;
}

.strategy-usage-premium {
  padding: 1rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.strategy-exemples-premium {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.exemple-premium-card {
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  padding: 1rem;
  border-left: 3px solid var(--accent);
}

.exemple-tad-premium {
  font-weight: 700;
  color: var(--accent);
  font-family: monospace;
  margin-bottom: 0.5rem;
}

.exemple-gloss-premium {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 0.5rem;
}

.exemple-trans-premium {
  font-size: 0.8rem;
  color: var(--text);
}

/* ============================================
   CONTES PREMIUM
   ============================================ */

.contes-premium-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 1.5rem;
}

.conte-premium-card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  text-align: center;
  border: 1px solid var(--border);
  transition: all var(--transition);
}

.conte-premium-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-xl);
  border-color: var(--accent);
}

.conte-card-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.conte-premium-card h3 {
  color: var(--accent);
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

.conte-meta-premium {
  display: flex;
  justify-content: center;
  gap: 1rem;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.btn-lire-conte-premium {
  background: var(--gradient-primary);
  border: none;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
  color: white;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-lire-conte-premium:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-glow);
}

/* ============================================
   ÉMISSIONS PREMIUM
   ============================================ */

.emissions-premium-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
  gap: 1.5rem;
}

.emission-premium-card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: all var(--transition);
}

.emission-premium-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-xl);
  border-color: var(--accent);
}

.emission-card-header {
  background: var(--gradient-primary);
  padding: 1rem;
  display: flex;
  gap: 1rem;
}

.emission-icon {
  font-size: 2rem;
}

.emission-info h4 {
  color: white;
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.emission-meta-premium {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.7);
}

.btn-emission-premium {
  width: 100%;
  padding: 0.75rem;
  background: var(--bg-elevated);
  border: none;
  border-top: 1px solid var(--border);
  color: var(--accent);
  cursor: pointer;
  transition: all var(--transition);
}

.btn-emission-premium:hover {
  background: var(--bg-card-hover);
}

/* ============================================
   THÈMES PREMIUM
   ============================================ */

.themes-premium-header {
  text-align: center;
  margin-bottom: 2rem;
  padding: 2rem;
  background: var(--gradient-glass);
  border-radius: var(--radius-2xl);
}

.theme-search-premium {
  width: 100%;
  max-width: 400px;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  margin: 1rem auto;
  transition: all var(--transition);
}

.theme-search-premium:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--shadow-glow);
}

.themes-premium-stats {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
}

.stat-badge {
  background: var(--bg-card);
  padding: 0.3rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  border: 1px solid var(--border);
}

.themes-premium-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 1.5rem;
}

.theme-premium-card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: all var(--transition);
}

.theme-premium-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-xl);
  border-color: var(--accent);
}

.theme-premium-header {
  background: var(--gradient-primary);
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.theme-premium-header h3 {
  flex: 1;
  color: white;
  font-size: 1rem;
  margin: 0;
}

.theme-premium-badge {
  background: rgba(255, 255, 255, 0.2);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  color: white;
}

.theme-premium-desc {
  padding: 1rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.theme-premium-preview {
  padding: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.preview-word-premium {
  background: rgba(0, 212, 255, 0.1);
  color: var(--accent);
  padding: 0.3rem 0.8rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
}

.theme-premium-expand {
  width: 100%;
  padding: 0.75rem;
  background: var(--bg-elevated);
  border: none;
  color: var(--accent);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all var(--transition);
}

.theme-premium-words {
  max-height: 400px;
  overflow-y: auto;
}

.words-premium-header {
  display: grid;
  grid-template-columns: 1fr 1fr 40px;
  padding: 0.75rem;
  background: var(--bg-elevated);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
}

.word-premium-row {
  display: grid;
  grid-template-columns: 1fr 1fr 40px;
  align-items: center;
  padding: 0.75rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--transition);
}

.word-premium-row:hover {
  background: var(--bg-card-hover);
}

.word-premium-tad {
  font-weight: 700;
  color: var(--accent);
  font-family: monospace;
}

.word-premium-play {
  background: none;
  border: none;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity var(--transition);
  padding: 0.3rem;
  border-radius: 50%;
}

.word-premium-play:hover {
  opacity: 1;
  background: var(--bg-card-hover);
}

/* ============================================
   FLASHCARDS PREMIUM
   ============================================ */

.flashcards-controls {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.flashcard {
  width: 360px;
  height: 420px;
  perspective: 1000px;
  cursor: pointer;
  margin: 0 auto;
}

.flashcard-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1);
  transform-style: preserve-3d;
  border-radius: var(--radius-2xl);
}

.flashcard[data-flipped="true"] .flashcard-inner {
  transform: rotateY(180deg);
}

.flashcard-front,
.flashcard-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: var(--radius-2xl);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 1.5rem;
  box-shadow: var(--shadow-xl);
}

.flashcard-front {
  background: var(--gradient-primary);
  color: white;
}

.flashcard-back {
  background: var(--gradient-secondary);
  color: white;
  transform: rotateY(180deg);
}

.flashcard-buttons {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

.flashcard-btn {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  font-weight: 600;
  transition: all var(--transition);
}

.flashcard-btn.correct {
  background: var(--success);
  color: white;
}

.flashcard-btn.wrong {
  background: var(--error);
  color: white;
}

.flashcards-progress {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* ============================================
   QUIZ PREMIUM
   ============================================ */

.quiz-question {
  text-align: center;
  background: var(--bg-card);
  padding: 2rem;
  border-radius: var(--radius-2xl);
  border: 1px solid var(--border);
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 2rem 0;
}

.quiz-option {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  padding: 1rem;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition);
}

.quiz-option:hover {
  background: var(--gradient-primary);
  color: white;
  transform: translateX(5px);
}

/* ============================================
   CHAT BOT PREMIUM
   ============================================ */

.chat-container {
  max-width: 800px;
  margin: 0 auto;
}

.chatbox {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  height: 400px;
  overflow-y: auto;
  padding: 1rem;
  border: 1px solid var(--border);
}

.message {
  max-width: 85%;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  border-radius: var(--radius-lg);
  animation: fadeInUp 0.3s ease;
}

.message.user {
  margin-left: auto;
  background: var(--gradient-primary);
  color: white;
}

.message.bot {
  margin-right: auto;
  background: var(--bg-elevated);
  border-left: 3px solid var(--accent);
}

.chat-input {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

.chat-suggestions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 1rem;
  flex-wrap: wrap;
}

/* ============================================
   LIVRES & BIBLIOTHÈQUE
   ============================================ */

.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.livre-card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: 1.25rem;
  border: 1px solid var(--border);
  transition: all var(--transition);
}

.livre-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-xl);
  border-color: var(--accent);
}

.livre-titre {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.livre-auteur {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.btn-small {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  background: var(--gradient-primary);
  color: white;
  text-align: center;
  text-decoration: none;
  font-size: 0.8rem;
  transition: all var(--transition);
  border: none;
  cursor: pointer;
}

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

/* ============================================
   RESSOURCES ACADÉMIQUES
   ============================================ */

.ressources-section {
  margin-bottom: 3rem;
}

.ressources-section h3 {
  font-size: 1.3rem;
  color: var(--accent);
  margin-bottom: 1rem;
  padding-left: 1rem;
  border-left: 3px solid var(--accent);
}

.podcast-card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  border: 1px solid var(--border);
  transition: all var(--transition);
}

.podcast-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
  border-color: var(--accent);
}

.podcast-header {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1rem;
}

.podcast-icon {
  font-size: 2.5rem;
}

.podcast-info h4 {
  color: var(--accent);
  margin-bottom: 0.25rem;
}

.podcast-links {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

.btn-podcast {
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-full);
  background: var(--gradient-primary);
  color: white;
  text-decoration: none;
  transition: all var(--transition);
  display: inline-block;
}

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

.articles-grid-inner {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.5rem;
}

.article-card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: 1.2rem;
  display: flex;
  gap: 1rem;
  border: 1px solid var(--border);
  transition: all var(--transition);
}

.article-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}

.article-icon {
  font-size: 2rem;
}

.article-content h4 {
  font-size: 1rem;
  color: var(--accent);
  margin-bottom: 0.25rem;
}

.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.5rem 0;
}

.tag {
  font-size: 0.65rem;
  background: rgba(0, 212, 255, 0.1);
  color: var(--accent);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
}

.bibliography-list-ul {
  list-style: none;
  padding: 0;
}

.bibliography-list-ul li {
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  font-size: 0.85rem;
  border-left: 3px solid var(--accent);
  transition: all var(--transition);
}

.bibliography-list-ul li:hover {
  transform: translateX(4px);
  background: var(--bg-card-hover);
}

/* ============================================
   INSTALL BANNER
   ============================================ */

.install-banner {
  position: fixed;
  bottom: 20px;
  left: 20px;
  right: 20px;
  background: var(--gradient-glass);
  backdrop-filter: var(--glass-blur);
  border-radius: var(--radius-xl);
  border: 1px solid var(--glass-border);
  z-index: 1100;
  animation: slideUp 0.3s ease;
}

.install-banner-content {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  flex-wrap: wrap;
}

.install-banner-text {
  flex: 1;
}

.install-banner-text strong {
  color: var(--accent);
}

.btn-install {
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
  background: var(--gradient-primary);
  color: white;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-install:hover {
  transform: scale(1.05);
}

.btn-dismiss {
  background: transparent;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--text-muted);
}

@media (min-width: 768px) {
  .install-banner {
    left: auto;
    right: 20px;
    max-width: 380px;
  }
}

/* ============================================
   SKELETON LOADING
   ============================================ */

.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.skeleton-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 1rem;
  animation: pulse 1.5s infinite;
}

.skeleton-image {
  height: 160px;
  background: var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
}

.skeleton-title {
  height: 20px;
  background: var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 0.5rem;
  width: 70%;
}

.skeleton-text {
  height: 14px;
  background: var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 0.5rem;
}

.skeleton-text.short {
  width: 50%;
}

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

/* ============================================
   MODE CONTRASTE ÉLEVÉ
   ============================================ */

body.high-contrast {
  --primary: #ffff00;
  --accent: #ffff00;
  --text: #ffffff;
  --bg: #000000;
  --bg-card: #111111;
  --border: #ffff00;
}

body.high-contrast .btn,
body.high-contrast .btn-podcast {
  background: #ffff00;
  color: #000000;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 1024px) {
  .themes-premium-grid,
  .actualites-grid,
  .contes-premium-grid,
  .emissions-premium-grid {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  }
}

@media (max-width: 768px) {
  .hero h2 {
    font-size: 1.8rem;
  }
  
  .actualites-grid,
  .partenaires-grid,
  .articles-grid-inner {
    grid-template-columns: 1fr;
  }
  
  .words-premium-header {
    display: none;
  }
  
  .word-premium-row {
    grid-template-columns: 1fr 40px;
    gap: 0.5rem;
  }
  
  .flashcard {
    width: 280px;
    height: 340px;
  }
  
  .footer-columns {
    grid-template-columns: 1fr;
    text-align: center;
  }
  
  .accessibility-panel {
    bottom: 80px;
    left: 16px;
    padding: 6px 10px;
  }
  
  .newsletter-form {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .header-text h1 {
    font-size: 1.2rem;
  }
  
  .logo-header {
    width: 40px;
    height: 40px;
  }
  
  .stat-card.premium {
    padding: 0.5rem 1rem;
  }
  
  .stat-number {
    font-size: 1.5rem;
  }
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
  .floating-chat-btn,
  .chat-suggestions,
  .theme-selector,
  .lang-selector,
  .install-banner,
  .accessibility-panel {
    display: none;
  }
  
  body {
    background: white;
    color: black;
  }
}

/* ============================================
   UTILITAIRES
   ============================================ */

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

.text-center { text-align: center; }
.text-accent { color: var(--accent); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

/* ============================================
   AMÉLIORATIONS UX — Header compact, boutons
   non génériques, crédit footer (07/09/2026)
   ============================================ */

.site-header {
  grid-template-areas:
    "logo title lang"
    "nav nav nav";
  padding: 0.75rem 1.5rem;
}

.settings-toggle {
  grid-area: lang;
  justify-self: end;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);
  padding: 0.5rem 1.1rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.settings-toggle:hover,
.settings-toggle[aria-expanded="true"] {
  border-color: var(--accent);
  color: var(--accent);
}

.settings-panel {
  position: absolute;
  top: 100%;
  right: 1rem;
  margin-top: 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  padding: 1rem;
  z-index: 150;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  width: min(320px, 90vw);
}

.settings-panel[hidden] { display: none; }

.settings-panel .theme-selector,
.settings-panel .lang-selector {
  justify-content: flex-start;
  background: transparent;
  border: none;
  padding: 0;
}

@media (max-width: 480px) {
  .settings-panel { right: 0.5rem; left: 0.5rem; width: auto; }
}

.dev-banner { padding: 0.5rem 1rem; }
.dev-message { font-size: 0.78rem; }

main { padding-top: 118px; }

@media (max-width: 768px) {
  main { padding-top: 128px; }
}

@media (max-width: 480px) {
  main { padding-top: 150px; }
  .site-header {
    grid-template-areas:
      "logo title"
      "logo lang"
      "nav nav";
    grid-template-columns: auto 1fr;
  }
}

/* --- Boutons : fin du rendu par défaut du navigateur --- */
.btn,
.btn-send,
.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem 1.85rem;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), filter var(--transition-fast);
}

.btn, .btn-send {
  background: var(--gradient-primary);
  color: var(--bg);
  box-shadow: var(--shadow-md);
}

.btn:hover, .btn-send:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  filter: brightness(1.05);
}

.btn:active, .btn-send:active {
  transform: translateY(0) scale(0.98);
}

.theme-btn {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-size: 1rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.theme-btn:hover { border-color: var(--accent); }

.theme-select-small {
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  cursor: pointer;
}

.contrast-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.floating-chat-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: var(--gradient-primary);
  color: white;
  font-size: 1.4rem;
  cursor: pointer;
  box-shadow: var(--shadow-xl);
  z-index: 900;
  transition: transform var(--transition-fast);
}

.floating-chat-btn:hover { transform: scale(1.08); }

/* --- Crédit footer --- */
.footer-credit {
  text-align: center;
  padding: 1.25rem 0;
  border-top: 1px solid var(--border);
  margin-top: 0.5rem;
}

.footer-credit-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.footer-credit-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

.credit-link {
  font-size: 0.8rem;
  color: var(--accent);
  text-decoration: none;
  padding: 0.4rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
}

.credit-link:hover {
  background: var(--gradient-primary);
  color: var(--bg);
  border-color: transparent;
}
