/**
 * Système de thème dark/light (mobile-first)
 * Mode sombre par défaut
 * Identité visuelle renforcée - Mobile First Design
 */

/* ============================================
   Blocage de l'orientation en portrait
   ============================================ */
html, body {
  /* Empêcher la rotation en paysage */
  min-height: 100vh;
  min-height: -webkit-fill-available;
}

/* Forcer l'orientation portrait - Afficher un message si rotation */
@media screen and (orientation: landscape) and (max-width: 768px) {
  body::before {
    content: 'Veuillez tourner votre appareil en mode portrait';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-primary);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    font-size: 1.5rem;
    text-align: center;
    padding: 2rem;
  }
  
  body > * {
    display: none;
  }
}

:root {
  /* Couleurs dark (par défaut) - V1.0 */
  --bg-primary: #000000;
  --bg-secondary: #14213d;
  --bg-tertiary: #1a2744;
  --bg-card: #14213d;
  --text-primary: #ffffff;
  --text-secondary: #e5e5e5;
  --text-tertiary: #a0a0a0;
  --accent-primary: #fca311;
  --accent-secondary: #ffb84d;
  --accent-orange: #fca311;
  --border-color: #2a3a5a;
  --shadow: rgba(0, 0, 0, 0.5);
  --error: #ff5555;
  --success: #55ff55;
  --warning: #ffaa00;
  
  /* Variables d'identité visuelle */
  --gradient-primary: linear-gradient(135deg, var(--accent-orange), var(--accent-secondary));
  --gradient-subtle: linear-gradient(135deg, rgba(252, 163, 17, 0.1), rgba(255, 184, 77, 0.05));
  --glow-orange: 0 0 20px rgba(252, 163, 17, 0.3);
  --glow-orange-strong: 0 0 30px rgba(252, 163, 17, 0.5);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 24px;
  --spacing-xs: 0.5rem;
  --spacing-sm: 0.75rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  --spacing-2xl: 3rem;
  --transition-fast: 0.15s ease;
  --transition-base: 0.2s ease;
  --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

[data-theme="light"] {
  /* Couleurs light - V1.0 - Page Sessions */
  --bg-primary: #ffffff;
  --bg-secondary: #ffffff;
  --bg-tertiary: #e5e5e5;
  --bg-card: #e5e5e5;
  --text-primary: #000000;
  --text-secondary: #555555;
  --text-tertiary: #707070;
  --accent-primary: #fca311;
  --accent-secondary: #ffb84d;
  --accent-orange: #fca311;
  --border-color: #d0d0d0;
  --shadow: rgba(0, 0, 0, 0.1);
  --error: #cc3333;
  --success: #33cc33;
  --warning: #ff8800;
}

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

html {
  overflow-x: hidden; /* Empêcher la scrollbar horizontale globale */
  width: 100%;
  max-width: 100vw;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(circle at 20% 50%, rgba(252, 163, 17, 0.03) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(252, 163, 17, 0.02) 0%, transparent 50%);
  background-attachment: fixed;
  color: var(--text-primary);
  line-height: 1.6;
  transition: background-color var(--transition-smooth), color var(--transition-smooth);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
  font-size: 16px; /* Base mobile-first */
}

/* Preload des ressources critiques */
link[rel="preload"] {
  display: none;
}

/* Amélioration de la typographie mobile */
@media (max-width: 768px) {
  body {
    font-size: 15px;
  }
}

/* Switch de thème - Amélioré */
/* Bouton theme-toggle désactivé - Mode sombre uniquement */
.theme-toggle {
  display: none !important;
}

.theme-toggle-icon {
  display: none !important;
}

/* Container principal - Mobile First */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--spacing-md) var(--spacing-md);
  animation: fadeIn 0.5s ease-in;
}

@media (min-width: 768px) {
  .container {
    padding: var(--spacing-xl) var(--spacing-lg);
  }
}

@media (min-width: 1024px) {
  .container {
    padding: var(--spacing-2xl) var(--spacing-xl);
  }
}

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

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

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

/* Header - Identité visuelle renforcée */
.header {
  background: var(--bg-card);
  border-bottom: 2px solid var(--border-color);
  padding: 0;
  margin-bottom: var(--spacing-lg);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(252, 163, 17, 0.05);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(20px) saturate(180%);
  background: rgba(20, 33, 61, 0.92);
  overflow-x: visible;
  overflow-y: hidden;
  width: 100%;
  transition: all var(--transition-smooth);
}

[data-theme="light"] .header {
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(252, 163, 17, 0.1);
}

/* Effet de glow subtil sur le header */
.header::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient-primary);
  opacity: 0.3;
  transition: opacity var(--transition-smooth);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: nowrap;
  gap: var(--spacing-md);
  padding: var(--spacing-md);
  border-bottom: 1px solid var(--border-color);
  overflow-x: hidden; /* Empêcher le scroll horizontal */
  min-width: 0;
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 768px) {
  .header-content {
    padding: var(--spacing-sm) var(--spacing-xs);
    gap: var(--spacing-xs);
  }
}

.logo {
  font-size: 1.75rem;
  font-weight: 800;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  cursor: pointer;
  transition: all var(--transition-smooth);
  letter-spacing: -0.5px;
  position: relative;
  display: inline-block;
}

.logo::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gradient-primary);
  transition: width var(--transition-smooth);
}

.logo:hover {
  transform: scale(1.05);
  filter: brightness(1.15);
}

.logo:hover::after {
  width: 100%;
}

/* Logo image */
.logo-img {
  height: 40px;
  width: auto;
  cursor: pointer;
  transition: all var(--transition-smooth);
  display: block;
}

.logo-img:hover {
  transform: scale(1.05);
  filter: brightness(1.1);
}

@media (max-width: 768px) {
  .logo {
    font-size: 1.5rem;
  }
  
  .logo-img {
    height: 32px;
  }
}

.nav {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: nowrap;
  width: 100%;
  justify-content: space-between;
  overflow: visible; /* Permettre la visibilité complète */
}

.nav-tabs {
  display: flex;
  gap: 0;
  align-items: stretch;
  flex-wrap: nowrap; /* Empêcher le retour à la ligne */
  border-bottom: 2px solid var(--border-color);
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  background: var(--bg-card);
  border-radius: 8px 8px 0 0;
  padding: 0.25rem 1rem 0 0.5rem; /* Plus de padding à droite pour éviter la coupure */
  /* Masquer complètement la scrollbar */
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE et Edge */
}

.nav-tabs::-webkit-scrollbar {
  width: 0px;
  height: 0px;
  background: transparent;
  display: none;
}

.nav-tabs::-webkit-scrollbar-track {
  background: transparent;
}

.nav-tabs::-webkit-scrollbar-thumb {
  background: transparent;
}

.nav-tab {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: var(--spacing-sm) var(--spacing-lg);
  text-decoration: none;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  transition: all var(--transition-smooth);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  position: relative;
  margin-bottom: -2px;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  margin-right: 0.25rem;
  min-height: 44px; /* Touch target mobile */
  text-align: center;
  justify-content: center;
}

.nav-tab:hover {
  color: var(--accent-orange);
  background: var(--bg-tertiary);
  transform: translateY(-2px);
  box-shadow: 0 2px 8px rgba(252, 163, 17, 0.15);
}

.nav-tab.active {
  color: var(--accent-orange);
  border-bottom-color: var(--accent-orange);
  background: var(--bg-primary);
  font-weight: 700;
  box-shadow: 0 -2px 12px rgba(252, 163, 17, 0.3), var(--glow-orange);
  transform: translateY(-1px);
}

.nav-tab:active {
  transform: translateY(0) scale(0.98);
}

.nav-tab:focus-visible {
  outline: 3px solid var(--accent-orange);
  outline-offset: 2px;
}

/* Amélioration accessibilité - ARIA live regions */
[role="alert"],
[aria-live] {
  position: relative;
}

/* Skip to main content pour navigation clavier */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--accent-orange);
  color: var(--bg-primary);
  padding: 0.5rem 1rem;
  text-decoration: none;
  z-index: 10000;
  border-radius: 0 0 4px 0;
}

.skip-link:focus {
  top: 0;
}

.nav-tab.active::before {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient-primary);
  border-radius: 2px 2px 0 0;
  box-shadow: 0 2px 12px rgba(252, 163, 17, 0.6), var(--glow-orange);
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    transform: scaleX(0);
    opacity: 0;
  }
  to {
    transform: scaleX(1);
    opacity: 1;
  }
}

.nav-tab-logout {
  color: var(--error) !important;
  border-bottom-color: transparent !important;
  margin-left: 1rem; /* Espacement après le profil */
  padding: 0.875rem 1rem !important; /* Padding réduit pour l'icône seule */
  min-width: auto; /* Largeur minimale réduite */
  white-space: nowrap; /* Empêcher le retour à la ligne */
  overflow: visible; /* Assurer que tout est visible */
  flex-shrink: 0; /* Empêcher la réduction */
  justify-content: center; /* Centrer l'icône */
}

.nav-tab-logout:hover {
  color: white !important;
  background: var(--error) !important;
  border-bottom-color: var(--error) !important;
}

.nav-tab-logout.active {
  color: var(--error) !important;
  border-bottom-color: var(--error) !important;
  background: rgba(255, 68, 68, 0.1) !important;
}

/* Badge de notification pour les invitations */
.nav-tab {
  position: relative;
}

.nav-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  background: var(--error);
  color: white;
  border-radius: 50%;
  min-width: 18px;
  height: 18px;
  font-size: 0.65rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  z-index: 10;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

/* Utiliser un séparateur visuel avant le bouton de déconnexion */
.nav-tab-logout::before {
  content: '';
  position: absolute;
  left: -0.5rem;
  top: 25%;
  bottom: 25%;
  width: 1px;
  background: var(--border-color);
}

.nav-icon {
  font-size: 1rem;
  line-height: 1;
}

.nav-text {
  font-weight: inherit;
}

/* Sur mobile, masquer le texte et garder seulement les icônes */
@media (max-width: 768px) {
  .nav {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
  }
  
  .nav-tabs {
    width: 100%;
    max-width: 100vw;
    justify-content: space-between; /* Répartir de manière égale */
    scrollbar-width: none;
    -ms-overflow-style: none;
    overflow-x: hidden; /* Pas de scroll horizontal */
    flex-wrap: nowrap; /* Pas de retour à la ligne */
    display: flex;
    gap: 0.05rem; /* Espace minimal entre les onglets */
    padding: 0.25rem 0.05rem; /* Padding horizontal minimal */
    box-sizing: border-box;
  }
  
  .nav-tabs::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
  }
  
  .nav-tab {
    padding: 0.5rem 0.1rem;
    min-width: 0; /* Pas de largeur minimale fixe */
    min-height: 44px;
    flex: 1 1 auto; /* Flexibilité pour s'adapter */
    justify-content: center;
    overflow: hidden;
    text-align: center;
    box-sizing: border-box;
    margin: 0;
    font-size: 0.75rem;
  }
  
  /* Si pas d'icônes (Connexion/Inscription) - détection par absence d'icône */
  .nav-tabs:not(:has(.nav-icon)) .nav-tab {
    flex: 0 0 calc((100% - 0.1rem) / 2);
    width: calc((100% - 0.1rem) / 2);
    font-size: 0.8rem;
  }
  
  /* Si icônes présentes (utilisateur connecté) */
  .nav-tabs:has(.nav-icon) .nav-tab {
    width: calc((100% - 0.35rem) / 7);
    flex: 0 0 calc((100% - 0.35rem) / 7);
  }
  
  .nav-text {
    display: block; /* Afficher le texte pour Connexion/Inscription */
  }
  
  .nav-tabs:has(.nav-icon) .nav-text {
    display: none; /* Masquer le texte si icônes présentes */
  }
  
  .nav-icon {
    font-size: 0.9rem; /* Réduit pour tenir sur l'écran */
    line-height: 1;
  }
  
  .nav-tab-logout {
    margin-left: 0;
    padding: 0.5rem 0.1rem !important;
    width: calc((100% - 0.35rem) / 8);
    flex: 0 0 calc((100% - 0.35rem) / 8);
    box-sizing: border-box;
  }
}

/* Sur très petit écran, réduire encore plus */
@media (max-width: 480px) {
  .nav-tabs {
    gap: 0.05rem; /* Espace minimal */
    padding: 0.2rem 0.05rem;
  }
  
  .nav-tab {
    padding: 0.5rem 0.1rem;
    font-size: 0.7rem;
  }
  
  /* Si pas d'icônes (Connexion/Inscription) */
  .nav-tabs:not(:has(.nav-icon)) .nav-tab {
    flex: 0 0 calc((100% - 0.05rem) / 2);
    width: calc((100% - 0.05rem) / 2);
    font-size: 0.75rem;
  }
  
  /* Si icônes présentes (utilisateur connecté) */
  .nav-tabs:has(.nav-icon) .nav-tab {
    width: calc((100% - 0.35rem) / 7);
    flex: 0 0 calc((100% - 0.35rem) / 7);
  }
  
  .nav-icon {
    font-size: 0.85rem; /* Encore plus petit */
  }
  
  .nav-tab-logout {
    width: calc((100% - 0.35rem) / 7);
    flex: 0 0 calc((100% - 0.35rem) / 7);
  }
}

/* Boutons - Design amélioré mobile-first */
.btn {
  padding: var(--spacing-sm) var(--spacing-lg);
  border: none;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-smooth);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.5rem;
  min-height: 44px; /* Touch target mobile */
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn:active::before {
  width: 300px;
  height: 300px;
}

.btn-primary {
  background: var(--gradient-primary);
  color: white;
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(252, 163, 17, 0.35), var(--glow-orange);
  border: 1px solid rgba(252, 163, 17, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--accent-secondary), var(--accent-orange));
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(252, 163, 17, 0.5), var(--glow-orange-strong);
  border-color: var(--accent-orange);
}

.btn-primary:active {
  transform: translateY(0) scale(0.98);
  box-shadow: 0 2px 12px rgba(252, 163, 17, 0.4);
}

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

@media (max-width: 768px) {
  .btn {
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 0.9375rem;
    min-height: 48px; /* Plus grand sur mobile */
  }
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 2px solid var(--border-color);
  font-weight: 500;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn-secondary:hover {
  background: var(--bg-secondary);
  border-color: var(--accent-orange);
  color: var(--accent-orange);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(252, 163, 17, 0.2);
}

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

.btn-outline {
  background: transparent;
  color: var(--accent-orange);
  border: 2px solid var(--accent-orange);
  font-weight: 500;
  box-shadow: 0 2px 8px rgba(252, 163, 17, 0.15);
}

.btn-outline:hover {
  background: var(--accent-orange);
  color: white;
  box-shadow: 0 6px 20px rgba(252, 163, 17, 0.4), var(--glow-orange);
  transform: translateY(-2px);
  border-color: var(--accent-secondary);
}

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

/* Formulaires - Design amélioré */
.form-container {
  max-width: 400px;
  margin: var(--spacing-xl) auto;
  padding: var(--spacing-xl);
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-color);
  box-shadow: 0 8px 32px var(--shadow), 0 0 0 1px rgba(252, 163, 17, 0.05);
  position: relative;
  overflow: hidden;
}

.form-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-primary);
  opacity: 0.5;
}

@media (max-width: 768px) {
  .form-container {
    margin: var(--spacing-lg) var(--spacing-md);
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
  }
}

.form-title {
  font-size: 1.75rem;
  margin-bottom: 1.5rem;
  text-align: center;
  color: var(--text-primary);
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
}

.form-input {
  width: 100%;
  padding: var(--spacing-sm) var(--spacing-md);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 1rem;
  transition: all var(--transition-smooth);
  min-height: 48px; /* Touch target mobile */
}

.form-input:hover {
  border-color: var(--accent-orange);
  background: var(--bg-secondary);
  box-shadow: 0 2px 8px rgba(252, 163, 17, 0.1);
}

.form-input:focus {
  outline: none;
  border-color: var(--accent-orange);
  box-shadow: 0 0 0 4px rgba(252, 163, 17, 0.2), var(--glow-orange);
  background: var(--bg-secondary);
  transform: translateY(-1px);
}

@media (max-width: 768px) {
  .form-input {
    font-size: 16px; /* Évite le zoom sur iOS */
    min-height: 52px;
  }
}

.form-error {
  color: var(--error);
  font-size: 0.875rem;
  margin-top: 0.5rem;
  display: none;
}

.form-error.show {
  display: block;
}

.form-success {
  color: var(--success);
  font-size: 0.875rem;
  margin-top: 0.5rem;
  display: none;
}

.form-success.show {
  display: block;
}

/* Page d'accueil - Design amélioré */
.home-container {
  padding: var(--spacing-lg) var(--spacing-md);
}

@media (min-width: 768px) {
  .home-container {
    padding: var(--spacing-2xl) var(--spacing-lg);
  }
}

.welcome-section {
  text-align: center;
  padding: var(--spacing-2xl) var(--spacing-lg);
  background: linear-gradient(135deg, var(--bg-card), var(--bg-tertiary));
  border-radius: var(--radius-2xl);
  margin-bottom: var(--spacing-xl);
  border: 2px solid var(--border-color);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(252, 163, 17, 0.1);
  position: relative;
  overflow: hidden;
}

@media (max-width: 768px) {
  .welcome-section {
    padding: var(--spacing-xl) var(--spacing-md);
    border-radius: var(--radius-xl);
  }
}

.welcome-section::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(252, 163, 17, 0.1) 0%, transparent 70%);
  animation: pulse 4s ease-in-out infinite;
}

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

.welcome-title {
  font-size: 2rem;
  margin-bottom: var(--spacing-md);
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 800;
  position: relative;
  z-index: 1;
  line-height: 1.2;
}

@media (min-width: 768px) {
  .welcome-title {
    font-size: 2.5rem;
  }
}

@media (min-width: 1024px) {
  .welcome-title {
    font-size: 3rem;
  }
}

.welcome-subtitle {
  font-size: 1.125rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

/* Messages */
.message {
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  display: none;
}

.message.show {
  display: block;
}

.message-error {
  background: rgba(255, 68, 68, 0.1);
  border: 1px solid var(--error);
  color: var(--error);
}

.message-success {
  background: rgba(68, 255, 68, 0.1);
  border: 1px solid var(--success);
  color: var(--success);
}

.message-info {
  background: rgba(74, 158, 255, 0.1);
  border: 1px solid var(--accent-primary);
  color: var(--accent-primary);
}

/* Responsive - Mobile First - Améliorations */
@media (min-width: 768px) {
  .form-container {
    max-width: 500px;
    padding: var(--spacing-2xl);
  }
}

/* Amélioration des transitions pour les appareils à faible performance */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================
   Styles V0.4 - Cartes et contenus
   ============================================ */

/* Cartes - Design amélioré mobile-first */
/* ============================================
   CARTES GÉNÉRIQUES (pour compatibilité)
   ============================================ */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  margin-bottom: var(--spacing-md);
  transition: all var(--transition-smooth);
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(252, 163, 17, 0.05);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient-primary);
  transform: scaleX(0);
  transition: transform var(--transition-smooth);
  opacity: 0.6;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2), var(--glow-orange);
  border-color: var(--accent-orange);
}

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

.card:active {
  transform: translateY(-2px) scale(0.98);
}

.card.public {
  border-color: var(--accent-orange);
  border-width: 2px;
  box-shadow: 0 4px 16px rgba(252, 163, 17, 0.2), var(--glow-orange);
}

.card.public::before {
  transform: scaleX(1);
  opacity: 1;
}

@media (max-width: 768px) {
  .card {
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
  }
}

/* ============================================
   CARTES DE SÉANCES - Design amélioré
   ============================================ */

.session-card {
  background: var(--bg-card);
  border: 1px solid transparent;
  border-radius: var(--radius-xl);
  padding: var(--spacing-lg);
  min-height: 180px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(252, 163, 17, 0.05);
  transition: all var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.session-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-primary);
  transform: scaleX(0);
  transition: transform var(--transition-smooth);
  opacity: 0.6;
}

.session-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2), var(--glow-orange);
  border-color: var(--accent-orange);
}

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

.session-card:active {
  transform: translateY(-2px) scale(0.98);
}

@media (max-width: 768px) {
  .session-card {
    padding: var(--spacing-md);
    border-radius: var(--radius-lg);
    min-height: 160px;
  }
}

/* Bordure orange pour les séances publiques */
.session-card-public {
  border: 2px solid var(--accent-orange);
  box-shadow: 0 4px 16px rgba(252, 163, 17, 0.25), var(--glow-orange);
}

.session-card-public::before {
  transform: scaleX(1);
  opacity: 1;
}

.session-card-public:hover {
  border-color: var(--accent-secondary);
  box-shadow: 0 12px 32px rgba(252, 163, 17, 0.4), var(--glow-orange-strong);
}

/* Header de la carte */
.session-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
  flex: 1;
}

.session-card-header-left {
  flex: 1;
  min-width: 0;
}

.session-card-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
  line-height: 1.3;
  text-align: left;
}

.session-card-meta-line {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.session-card-icon {
  font-size: 1rem;
}

.session-card-exercises {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.session-card-header-right {
  flex-shrink: 0;
  margin-left: 1rem;
}

.session-card-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
}

.session-card-badge-public {
  background: rgba(252, 163, 17, 0.2);
  color: var(--accent-orange);
  border: 1px solid var(--accent-orange);
}

.session-card-badge-private {
  background: rgba(160, 160, 160, 0.2);
  color: var(--text-tertiary);
  border: 1px solid var(--text-tertiary);
}

/* Footer de la carte */
.session-card-footer {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.session-card-btn {
  flex: 1;
  padding: 0.625rem 1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
  border: 1px solid transparent;
  text-align: center;
}

.session-card-btn-edit {
  background: var(--bg-primary);
  color: var(--text-primary);
  border-color: var(--accent-orange);
}

.session-card-btn-edit:hover {
  background: var(--accent-orange);
  color: var(--bg-primary);
  border-color: var(--accent-orange);
}

.session-card-btn-delete {
  background: transparent;
  color: var(--error);
  border-color: var(--error);
}

.session-card-btn-delete:hover {
  background: var(--error);
  color: var(--text-primary);
  border-color: var(--error);
}

/* ============================================
   TOASTS - Messages en bas de l'écran
   ============================================ */

.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  z-index: 2000;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.toast-show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.toast-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  min-width: 280px;
  max-width: 90vw;
}

.toast-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.toast-text {
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 500;
  flex: 1;
}

.toast-success .toast-content {
  border-color: var(--success);
  background: var(--bg-card);
}

.toast-error .toast-content {
  border-color: var(--error);
  background: var(--bg-card);
}

.toast-info .toast-content {
  border-color: var(--accent-orange);
  background: var(--bg-card);
}

/* Sur mobile, ajuster la position */
@media (max-width: 768px) {
  .toast {
    bottom: 5rem; /* Au-dessus du bouton flottant */
    left: 1rem;
    right: 1rem;
    transform: translateY(100px);
  }

  .toast-show {
    transform: translateY(0);
  }

  .toast-content {
    min-width: auto;
    width: 100%;
  }
}

.card-title {
  font-size: 1.375rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
  line-height: 1.3;
}

.card-description {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-bottom: 1rem;
  line-height: 1.5;
}

.card-meta {
  display: flex;
  gap: 1rem;
  align-items: center;
  font-size: 0.875rem;
  color: var(--text-tertiary);
  flex-wrap: nowrap;
}

.card-meta-item {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.card-goal {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: var(--bg-tertiary);
  border-radius: 20px;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.card.public .card-goal {
  background: rgba(252, 163, 17, 0.1);
  color: var(--accent-orange);
}

/* Bouton flottant - Design amélioré */
/* ============================================
   BOUTON FLOTTANT "+"
   ============================================ */

.fab {
  position: fixed;
  bottom: var(--spacing-xl);
  right: var(--spacing-xl);
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--gradient-primary);
  color: var(--bg-primary);
  border: 2px solid rgba(255, 255, 255, 0.2);
  font-size: 1.75rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(252, 163, 17, 0.5), var(--glow-orange-strong);
  transition: all var(--transition-smooth);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
  /* Accessibilité */
  min-width: 44px;
  min-height: 44px;
}

.fab:focus {
  outline: 3px solid var(--accent-orange);
  outline-offset: 2px;
}

.fab:hover {
  transform: scale(1.1) rotate(90deg);
  box-shadow: 0 12px 32px rgba(252, 163, 17, 0.7), var(--glow-orange-strong);
  border-color: rgba(255, 255, 255, 0.4);
}

.fab:active {
  transform: scale(0.95) rotate(90deg);
}

/* Sur mobile, remonter le bouton et agrandir */
@media (max-width: 768px) {
  .fab {
    bottom: 5rem;
    right: var(--spacing-lg);
    width: 56px;
    height: 56px;
    font-size: 1.5rem;
  }
}

/* ============================================
   GRILLE DE SÉANCES - Responsive
   ============================================ */

.sessions-grid {
  display: grid;
  gap: var(--spacing-lg);
  margin-bottom: var(--spacing-xl);
  animation: fadeInUp 0.6s ease-out;
  min-height: 400px;
}

.sessions-grid > * {
  animation: scaleIn 0.4s ease-out backwards;
}

.sessions-grid > *:nth-child(1) { animation-delay: 0.1s; }
.sessions-grid > *:nth-child(2) { animation-delay: 0.2s; }
.sessions-grid > *:nth-child(3) { animation-delay: 0.3s; }
.sessions-grid > *:nth-child(4) { animation-delay: 0.4s; }
.sessions-grid > *:nth-child(5) { animation-delay: 0.5s; }
.sessions-grid > *:nth-child(6) { animation-delay: 0.6s; }

/* Mobile : une seule colonne */
@media (max-width: 767px) {
  .sessions-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
  }
}

/* Desktop : grille responsive */
@media (min-width: 768px) {
  .sessions-grid {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  }
}

/* ============================================
   PAGE SESSIONS - Layout général
   ============================================ */

.sessions-main {
  min-height: calc(100vh - 200px);
  padding-bottom: 6rem; /* Espace pour le bouton flottant */
}

.sessions-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* Page titre - Design amélioré */
.page-header-section {
  margin-top: var(--spacing-2xl);
  margin-bottom: var(--spacing-xl);
  position: relative;
}

.page-title {
  font-size: 1.875rem;
  font-weight: 800;
  margin-bottom: var(--spacing-xs);
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
  text-align: left;
  position: relative;
  display: inline-block;
}

.page-title::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 60px;
  height: 3px;
  background: var(--gradient-primary);
  border-radius: 2px;
}

.page-subtitle {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  margin-bottom: var(--spacing-lg);
  font-weight: 400;
  text-align: left;
  margin-top: var(--spacing-sm);
}

@media (min-width: 768px) {
  .page-title {
    font-size: 2.2rem;
  }
  
  .page-subtitle {
    font-size: 1rem;
  }
}

@media (max-width: 768px) {
  .page-header-section {
    margin-top: var(--spacing-xl);
    margin-bottom: var(--spacing-lg);
  }
  
  .page-title {
    font-size: 1.625rem;
  }
}

/* Barre de filtres et recherche - Design amélioré */
.filters-bar {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-xl);
  padding: var(--spacing-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(252, 163, 17, 0.05);
  position: relative;
  overflow: hidden;
}

.filters-bar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient-primary);
  opacity: 0.4;
}

@media (max-width: 768px) {
  .filters-bar {
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
  }
}

.filters-group {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.filter-btn {
  padding: var(--spacing-sm) var(--spacing-md);
  border: 1px solid var(--border-color);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-base);
  font-family: inherit;
  white-space: nowrap;
  min-height: 40px; /* Touch target mobile */
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.filter-btn:hover {
  background: var(--bg-secondary);
  border-color: var(--accent-orange);
  color: var(--text-primary);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(252, 163, 17, 0.15);
}

.filter-btn.active {
  background: var(--gradient-primary);
  color: var(--bg-primary);
  border-color: var(--accent-orange);
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(252, 163, 17, 0.4), var(--glow-orange);
  transform: translateY(-1px);
}

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

/* Onglets internes (Séances/Programmes) */
.internal-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--border-color);
}

.internal-tab {
  display: flex;
  align-items: center;
  padding: 0.75rem 1.5rem;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--text-secondary);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-smooth);
  position: relative;
  margin-bottom: -2px;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  min-height: 44px;
}

.internal-tab:hover {
  color: var(--accent-orange);
  background: var(--bg-tertiary);
}

.internal-tab.active {
  color: var(--accent-orange);
  border-bottom-color: var(--accent-orange);
  background: var(--bg-primary);
  font-weight: 700;
}

.internal-tab:focus-visible {
  outline: 3px solid var(--accent-orange);
  outline-offset: 2px;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

@media (max-width: 768px) {
  .filter-btn {
    min-height: 44px;
    padding: var(--spacing-sm) var(--spacing-md);
  }
  
  .internal-tab {
    padding: 0.625rem 1rem;
    font-size: 0.9rem;
  }
    font-size: 0.8125rem;
  }
}

.search-group {
  display: flex;
  width: 100%;
}

.search-input {
  width: 100%;
  padding: var(--spacing-sm) var(--spacing-md);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: 0.9375rem;
  font-family: inherit;
  transition: all var(--transition-base);
  min-height: 44px; /* Touch target mobile */
}

.search-input:focus {
  outline: none;
  border-color: var(--accent-orange);
  background: var(--bg-secondary);
  box-shadow: 0 0 0 3px rgba(252, 163, 17, 0.2), var(--glow-orange);
  transform: translateY(-1px);
}

.search-input::placeholder {
  color: var(--text-tertiary);
}

@media (max-width: 768px) {
  .search-input {
    font-size: 16px; /* Évite le zoom sur iOS */
    min-height: 48px;
  }
}

/* Responsive pour la barre de filtres */
@media (min-width: 768px) {
  .filters-bar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .filters-group {
    flex: 0 0 auto;
  }

  .search-group {
    flex: 1;
    max-width: 400px;
    margin-left: auto;
  }
}

/* Panneau de recherche d'exercices */
.exercise-search-panel {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.exercise-search-content {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 2rem;
  max-width: 600px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.exercise-search-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.exercise-search-title {
  font-size: 1.5rem;
  font-weight: 600;
}

.exercise-search-close {
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
}

.exercise-search-input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 1rem;
  margin-bottom: 1rem;
}

.exercise-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 400px;
  overflow-y: auto;
}

.exercise-item {
  padding: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 0.5rem;
}

.exercise-item:hover {
  background: var(--bg-tertiary);
  border-color: var(--accent-orange);
  transform: translateX(4px);
  box-shadow: 0 2px 8px var(--shadow);
}

.exercise-item-name {
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.exercise-item-meta {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* Formulaire d'exercice dans séance */
.exercise-form-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1rem;
  box-shadow: 0 2px 8px var(--shadow);
  transition: all 0.2s ease;
}

.exercise-form-item:hover {
  box-shadow: 0 4px 12px var(--shadow);
}

.exercise-form-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.exercise-form-item-name {
  font-weight: 600;
  color: var(--text-primary);
}

.exercise-form-item-remove {
  background: var(--error);
  color: white;
  border: none;
  border-radius: 4px;
  padding: 0.25rem 0.75rem;
  cursor: pointer;
  font-size: 0.875rem;
}

.exercise-form-fields {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

@media (max-width: 768px) {
  .exercise-form-fields {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }
  
  /* Sur mobile, le 4ème champ (Type) prend toute la largeur */
  .exercise-form-field:nth-child(4) {
    grid-column: 1 / -1;
  }
}

.exercise-form-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.exercise-form-field label {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.exercise-form-field input,
.exercise-form-field select {
  padding: 0.5rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 0.875rem;
  transition: all 0.2s ease;
}

.exercise-form-field input:focus,
.exercise-form-field select:focus {
  outline: none;
  border-color: var(--accent-orange);
  box-shadow: 0 0 0 3px rgba(252, 163, 17, 0.1);
}

.exercise-form-checkboxes {
  display: flex;
  gap: 1rem;
  margin-top: 0.5rem;
}

.exercise-form-checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.exercise-form-checkbox input[type="checkbox"] {
  width: auto;
}

/* Boutons d'action sur cartes */
.card-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.card-action-btn {
  flex: 1;
  padding: 0.5rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--bg-primary);
  color: var(--text-primary);
  cursor: pointer;
  font-size: 0.875rem;
  transition: all 0.2s ease;
}

.card-action-btn:hover {
  background: var(--bg-tertiary);
}

.card-action-btn.danger {
  color: var(--error);
  border-color: var(--error);
}

.card-action-btn.danger:hover {
  background: rgba(255, 68, 68, 0.1);
}

/* Badge vide - Design amélioré */
.empty-state {
  text-align: center;
  padding: var(--spacing-2xl) var(--spacing-md);
  color: var(--text-secondary);
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 2px dashed var(--border-color);
  margin: var(--spacing-xl) 0;
  position: relative;
  overflow: hidden;
}

.empty-state::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient-primary);
  opacity: 0.3;
}

@media (max-width: 768px) {
  .empty-state {
    padding: var(--spacing-xl) var(--spacing-md);
    border-radius: var(--radius-md);
  }
}

.empty-state-icon {
  font-size: 5rem;
  margin-bottom: 1.5rem;
  opacity: 0.6;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.empty-state-text {
  font-size: 1.25rem;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
  font-weight: 500;
}


.empty-state-action {
  margin-top: 1.5rem;
}

/* ============================================
   Styles V0.8 - Profil et Invitations
   ============================================ */

/* Profil - Nouveau design premium */
.profile-main {
  min-height: calc(100vh - 200px);
  padding-bottom: 3rem;
}

.profile-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* Bannière avec overlay */
.profile-banner-wrapper {
  position: relative;
  margin-bottom: 4rem;
}

.profile-banner {
  position: relative;
  width: 100%;
  height: 250px;
  overflow: hidden;
  border-radius: 16px 16px 0 0;
}

.profile-banner-empty {
  background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary));
  height: 250px;
}

.profile-banner-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-banner-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.6), transparent);
  pointer-events: none;
}

/* Avatar en chevauchement */
.profile-avatar-overlap {
  position: absolute;
  bottom: -60px;
  left: 2rem;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  border: 5px solid var(--accent-orange);
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  z-index: 10;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.profile-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-avatar-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  background: var(--bg-tertiary);
}

/* Carte profil */
.profile-card {
  background: var(--bg-card);
  border-radius: 22px;
  padding: 2.5rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  margin-bottom: 3rem;
  margin-top: 60px; /* Espace pour l'avatar */
}

.profile-card-content {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
  margin-bottom: 2rem;
}

.profile-card-left {
  flex: 1;
  min-width: 0;
}

.profile-name-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.profile-username {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.2;
}

.profile-username-at {
  font-size: 1rem;
  color: var(--text-tertiary);
  margin: 0;
}

.profile-badge-level {
  display: inline-block;
  padding: 0.375rem 1rem;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border: 1px solid var(--accent-orange);
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 500;
  margin-top: 0.5rem;
  width: fit-content;
}

.profile-card-right {
  flex-shrink: 0;
}

.profile-stats-horizontal {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.profile-stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.profile-stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--accent-orange);
  line-height: 1;
}

.profile-stat-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.profile-stat-divider {
  width: 1px;
  height: 40px;
  background: var(--border-color);
}

.profile-card-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: flex-start;
}

.profile-action-btn {
  padding: 0.875rem 2rem;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  border: none;
  position: relative;
  overflow: hidden;
}

/* Effet ripple sur les boutons */
.profile-action-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
  pointer-events: none;
}

.profile-action-btn:active::before {
  width: 300px;
  height: 300px;
}

.profile-action-btn-edit {
  background: var(--accent-orange);
  color: var(--bg-primary);
}

.profile-action-btn-edit:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(252, 163, 17, 0.4);
}

.profile-action-btn-follow {
  background: var(--accent-orange);
  color: var(--bg-primary);
}

.profile-action-btn-follow:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(252, 163, 17, 0.4);
}

.profile-action-btn-following {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.profile-action-btn-following:hover {
  background: var(--bg-secondary);
  transform: translateY(-2px);
}

.profile-follow-indicator {
  font-size: 0.875rem;
  color: var(--text-tertiary);
  margin: 0;
  font-style: italic;
}

/* Navigation par onglets */
.profile-tabs-wrapper {
  margin-bottom: 2.5rem;
}

.profile-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border-color);
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.profile-tabs::-webkit-scrollbar {
  display: none;
}

.profile-tab {
  padding: 1rem 1.5rem;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: inherit;
  position: relative;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
}

.profile-tab:hover {
  color: var(--accent-orange);
  background: var(--bg-tertiary);
}

.profile-tab.active {
  color: var(--accent-orange);
  border-bottom-color: var(--accent-orange);
  font-weight: 600;
}

.profile-tab.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent-orange);
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

.profile-tab-count {
  font-size: 0.8rem;
  color: var(--text-tertiary);
  font-weight: 400;
}

.profile-tab.active .profile-tab-count {
  color: var(--accent-orange);
}

/* Contenu des onglets */
.profile-tab-content {
  min-height: 300px;
}

.profile-content-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .profile-content-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .profile-content-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Cartes de contenu */
.profile-content-card {
  background: var(--bg-card);
  border: 1px solid transparent;
  border-radius: 16px;
  padding: 1.5rem;
  min-height: 140px;
  display: flex;
  gap: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.profile-content-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
  border-color: var(--accent-orange);
}

.profile-content-card-icon {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  background: var(--bg-tertiary);
  border-radius: 12px;
}

.profile-content-card-icon img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.profile-content-card-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.profile-content-card-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.3;
}

.profile-content-card-subtitle {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin: 0;
}

.profile-content-card-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: var(--bg-tertiary);
  color: var(--accent-orange);
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
  width: fit-content;
  margin-top: 0.25rem;
}

.profile-empty-state {
  text-align: center;
  padding: 4rem 2rem;
}

.profile-empty-state .empty-message {
  color: var(--text-secondary);
  font-size: 1rem;
}

/* Mobile optimizations */
@media (max-width: 768px) {
  .profile-container {
    padding: 1rem;
  }

  .profile-banner {
    height: 180px;
  }

  .profile-avatar-overlap {
    left: 50%;
    transform: translateX(-50%);
    bottom: -50px;
    width: 120px;
    height: 120px;
    border-width: 4px;
  }

  .profile-card {
    margin-top: 50px;
    padding: 1.5rem;
    border-radius: 16px;
  }

  .profile-card-content {
    flex-direction: column;
    gap: 1.5rem;
  }

  .profile-name-section {
    text-align: center;
    align-items: center;
  }

  .profile-stats-horizontal {
    justify-content: center;
    width: 100%;
  }

  .profile-card-actions {
    width: 100%;
    align-items: stretch;
  }

  .profile-action-btn {
    width: 100%;
  }

  .profile-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .profile-content-grid {
    grid-template-columns: 1fr;
  }
}

.profile-header {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 2rem;
  background: var(--bg-card);
  border-radius: 16px;
  border: 1px solid var(--border-color);
  margin-bottom: 2rem;
}

.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.profile-info h2 {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.profile-name {
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.profile-bio {
  color: var(--text-secondary);
  margin-bottom: 1rem;
  line-height: 1.6;
}

.profile-stats {
  display: flex;
  gap: 2rem;
  margin-top: 1rem;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--accent-orange);
}

.stat-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.profile-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
  border-bottom: 2px solid var(--border-color);
}

.tab-btn {
  padding: 0.75rem 1.5rem;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s ease;
  margin-bottom: -2px;
}

.tab-btn:hover {
  color: var(--text-primary);
}

.tab-btn.active {
  color: var(--accent-orange);
  border-bottom-color: var(--accent-orange);
}

.tab-content {
  min-height: 200px;
}

/* Invitations */
.invitations-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.invitation-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  transition: all 0.2s ease;
}

.invitation-card:hover {
  box-shadow: 0 4px 12px var(--shadow);
}

.invitation-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.invitation-header h3 {
  font-size: 1.25rem;
  color: var(--text-primary);
  margin: 0;
}

.invitation-type {
  padding: 0.25rem 0.75rem;
  background: var(--bg-tertiary);
  border-radius: 20px;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.invitation-info {
  margin-bottom: 1rem;
  color: var(--text-secondary);
}

.invitation-info p {
  margin-bottom: 0.5rem;
}

.invitation-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

.invitation-actions .btn {
  flex: 1;
}

/* Messages d'erreur et succès */
.error-message {
  padding: 1rem;
  background: rgba(255, 68, 68, 0.1);
  border: 1px solid var(--error);
  border-radius: 8px;
  color: var(--error);
  margin-bottom: 1rem;
}

.success-message {
  padding: 1rem;
  background: rgba(68, 255, 68, 0.1);
  border: 1px solid var(--success);
  border-radius: 8px;
  color: var(--success);
  margin-bottom: 1rem;
}

.empty-message {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-secondary);
}

.loading {
  text-align: center;
  padding: 2rem;
  color: var(--text-secondary);
}

/* Responsive pour profil */
@media (min-width: 768px) {
  .profile-header {
    flex-direction: row;
    align-items: flex-start;
  }

  .profile-avatar {
    margin-bottom: 0;
    margin-right: 1.5rem;
  }

  .profile-info {
    flex: 1;
  }

  .profile-stats {
    margin-top: 0;
  }
}

/* Permissions */
.permission-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  margin-bottom: 0.5rem;
  transition: all 0.2s ease;
}

.permission-item:hover {
  background: var(--bg-tertiary);
  border-color: var(--accent-orange);
}

.permission-item > div:first-child {
  flex: 1;
}

.permission-item button {
  margin-left: 1rem;
}

/* Modal/Popup */
#markCompletedModal {
  animation: fadeIn 0.2s ease;
}

#markCompletedModal .card {
  animation: slideUp 0.3s ease;
}

@media (max-width: 768px) {
  #markCompletedModal {
    padding: 0.5rem;
  }
  
  #markCompletedModal .card {
    max-height: 95vh;
  }
}

/* ============================================
   Styles V1.0 - Likes, Commentaires, Animations
   ============================================ */

/* Bouton Like */
.like-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  transition: all 0.2s ease;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.like-btn:hover {
  transform: scale(1.1);
}

.like-btn:active {
  transform: scale(0.95);
}

/* Commentaires */
.comment-item {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  transition: background 0.2s ease;
}

.comment-item:hover {
  background: var(--bg-tertiary);
}

.comment-item:last-child {
  border-bottom: none;
}

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

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

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

.card {
  animation: fadeIn 0.4s ease;
}

/* Amélioration des transitions globales */
* {
  -webkit-tap-highlight-color: rgba(252, 163, 17, 0.2);
}

/* Amélioration du scroll pour mobile */
@media (max-width: 768px) {
  * {
    -webkit-overflow-scrolling: touch;
  }
}

/* ============================================
   FOOTER - Design mobile-first
   ============================================ */

.footer {
  background: var(--bg-card);
  border-top: 2px solid var(--border-color);
  margin-top: var(--spacing-2xl);
  padding: var(--spacing-xl) var(--spacing-md);
  position: relative;
  overflow: hidden;
}

.footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient-primary);
  opacity: 0.3;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--spacing-xl);
}

.footer-section {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.footer-logo {
  margin-bottom: var(--spacing-md);
}

.footer-logo img {
  height: 40px;
  width: auto;
  opacity: 0.9;
  transition: opacity var(--transition-base);
}

.footer-logo img:hover {
  opacity: 1;
}

.footer-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--spacing-sm);
  position: relative;
  padding-bottom: var(--spacing-xs);
}

.footer-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 40px;
  height: 2px;
  background: var(--gradient-primary);
  border-radius: 2px;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  transition: all var(--transition-base);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0;
}

.footer-link:hover {
  color: var(--accent-orange);
  transform: translateX(4px);
}

.footer-link-icon {
  font-size: 0.875rem;
}

.footer-bottom {
  margin-top: var(--spacing-xl);
  padding-top: var(--spacing-lg);
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  align-items: center;
  text-align: center;
}

.footer-copyright {
  color: var(--text-tertiary);
  font-size: 0.8125rem;
}

.footer-social {
  display: flex;
  gap: var(--spacing-md);
  align-items: center;
}

.footer-social-link {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 1.125rem;
  transition: all var(--transition-base);
}

.footer-social-link:hover {
  background: var(--accent-orange);
  color: var(--bg-primary);
  border-color: var(--accent-orange);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(252, 163, 17, 0.3);
}

@media (min-width: 768px) {
  .footer-content {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-2xl);
  }
  
  .footer-bottom {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}

/* Page 404 */
.error-404-container {
  min-height: calc(100vh - 200px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-2xl) var(--spacing-md);
  text-align: center;
}

.error-404-content {
  max-width: 600px;
  width: 100%;
}

.error-404-code {
  font-size: 8rem;
  font-weight: 800;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: var(--spacing-md);
  animation: float 3s ease-in-out infinite;
}

.error-404-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--spacing-md);
}

.error-404-message {
  font-size: 1.125rem;
  color: var(--text-secondary);
  margin-bottom: var(--spacing-xl);
  line-height: 1.6;
}

.error-404-actions {
  display: flex;
  gap: var(--spacing-md);
  justify-content: center;
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  .error-404-code {
    font-size: 5rem;
  }
  
  .error-404-title {
    font-size: 1.5rem;
  }
  
  .error-404-message {
    font-size: 1rem;
  }
  
  .error-404-actions {
    flex-direction: column;
  }
  
  .error-404-actions .btn {
    width: 100%;
  }
}

.btn {
  transition: all 0.2s ease;
}

.btn:active {
  transform: scale(0.98);
}

/* Bottom drawer pour commentaires (mobile) */
@media (max-width: 768px) {
  #commentsSection {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    border-radius: 16px 16px 0 0;
    max-height: 70vh;
    padding: 1.5rem;
    box-shadow: 0 -4px 20px var(--shadow);
    z-index: 1000;
    animation: slideUp 0.3s ease;
  }

  #commentsList {
    max-height: 50vh !important;
  }

  /* Calendrier date picker dans la modal */
  #datePicker {
    max-height: 300px;
    overflow-y: auto;
  }

  #datePicker button {
    min-height: 36px; /* Taille tactile pour mobile */
  }
}

/* ============================================
   PAGE STATISTIQUES - Dashboard d'analyse
   ============================================ */

.stats-main {
  min-height: calc(100vh - 200px);
  padding-bottom: 3rem;
}

.stats-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* Header */
.stats-header-section {
  margin-top: 3rem;
  margin-bottom: 2.5rem;
  text-align: center;
}

.stats-page-title {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--accent-orange);
  margin: 0;
  line-height: 1.2;
  text-align: center;
}

@media (max-width: 768px) {
  .stats-container {
    padding: 1rem;
  }
  
  .stats-header-section {
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
  }
  
  .stats-page-title {
    font-size: 1.75rem;
    text-align: center;
  }
  
  .stats-section-title {
    text-align: center;
  }
  
  .stats-section-subtitle {
    text-align: center;
  }
}

/* Zone de filtres */
.stats-filters-bar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 3rem;
  padding: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.stats-filters-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.stats-filter-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stats-filter-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.stats-filter-btn {
  padding: 0.625rem 1.25rem;
  border: 1px solid var(--border-color);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  white-space: nowrap;
}

.stats-filter-btn:hover {
  background: var(--bg-secondary);
  border-color: var(--accent-orange);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.stats-filter-btn.active {
  background: var(--accent-orange);
  color: var(--bg-primary);
  border-color: var(--accent-orange);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(252, 163, 17, 0.3);
}

@media (min-width: 768px) {
  .stats-filters-bar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .stats-filters-group {
    flex-direction: row;
    align-items: center;
    gap: 1rem;
  }
}

/* Skeleton loaders */
.stats-skeleton {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

.skeleton-card {
  height: 200px;
  background: var(--bg-card);
  border-radius: 16px;
  border: 1px solid var(--border-color);
  animation: skeleton-pulse 1.5s ease-in-out infinite;
}

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

/* Sections */
.stats-section {
  margin-bottom: 3.5rem;
  padding-top: 1rem;
}

.stats-section-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  text-align: center;
  position: relative;
  padding-bottom: 0.75rem;
}

@media (min-width: 768px) {
  .stats-section-title {
    text-align: left;
  }
}

.stats-section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60px;
  height: 3px;
  background: var(--accent-orange);
  border-radius: 2px;
}

.stats-section-subtitle {
  font-size: 0.875rem;
  color: var(--text-tertiary);
  margin-bottom: 1.5rem;
  text-align: center;
}

@media (min-width: 768px) {
  .stats-section-subtitle {
    text-align: left;
  }
}

.stats-subsection-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1rem;
  text-align: center;
}

@media (min-width: 768px) {
  .stats-subsection-title {
    text-align: left;
  }
}

/* Habitudes - Mini-cards (KPI principaux) */
.stats-habits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
}

.stats-habit-card {
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: 18px;
  padding: 2rem 1.5rem;
  text-align: center;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  position: relative;
  overflow: hidden;
}

.stats-habit-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--accent-orange);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.stats-habit-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(252, 163, 17, 0.3);
  border-color: var(--accent-orange);
}

.stats-habit-card:hover::before {
  transform: scaleX(1);
}

.stats-habit-icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

.stats-habit-value {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--accent-orange);
  line-height: 1;
  margin-bottom: 0.5rem;
  text-shadow: 0 2px 8px rgba(252, 163, 17, 0.3);
}

.stats-habit-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* Progression - Cartes d'exercices */
.stats-progression-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.stats-progression-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.5rem;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.stats-progression-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  border-color: var(--accent-orange);
}

.stats-progression-exercise {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.stats-progression-values {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.stats-progression-value {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.stats-progression-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.stats-progression-number {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--accent-orange);
}

.stats-progression-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  font-weight: 600;
  width: fit-content;
}

.stats-progression-indicator.positive {
  background: rgba(85, 255, 85, 0.1);
  color: var(--success);
}

.stats-progression-indicator.negative {
  background: rgba(255, 85, 85, 0.1);
  color: var(--error);
}

.stats-progression-indicator.neutral {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

.stats-progression-arrow {
  font-size: 1.25rem;
}

.stats-progression-percent {
  font-size: 0.875rem;
}

/* Muscles - Barres de progression */
.stats-muscles-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.stats-muscle-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.25rem;
  transition: all 0.2s ease;
}

.stats-muscle-item:hover {
  border-color: var(--accent-orange);
  box-shadow: 0 2px 8px rgba(252, 163, 17, 0.2);
}

.stats-muscle-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.stats-muscle-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.stats-muscle-volume {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--accent-orange);
}

.stats-muscle-bar {
  width: 100%;
}

.stats-muscle-bar-bg {
  width: 100%;
  height: 12px;
  background: var(--bg-secondary);
  border-radius: 6px;
  overflow: hidden;
}

.stats-muscle-bar-fill {
  height: 100%;
  background: var(--accent-orange);
  border-radius: 6px;
  transition: width 0.5s ease;
}

/* Fréquence par type */
.stats-frequency-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.stats-frequency-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  transition: all 0.2s ease;
}

.stats-frequency-item:hover {
  border-color: var(--accent-orange);
}

.stats-frequency-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  min-width: 120px;
}

.stats-frequency-bar {
  flex: 1;
  font-family: monospace;
  font-size: 1rem;
  color: var(--accent-orange);
  letter-spacing: 2px;
}

.stats-frequency-count {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--accent-orange);
  min-width: 40px;
  text-align: right;
}

/* Ressentis */
.stats-feelings-content {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.stats-feelings-summary {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.5rem;
}

.stats-feelings-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
}

.stats-feeling-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  transition: all 0.2s ease;
}

.stats-feeling-badge:hover {
  border-color: var(--accent-orange);
  transform: translateY(-2px);
}

.stats-feeling-emoji {
  font-size: 1.5rem;
}

.stats-feeling-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
}

.stats-feeling-percent {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--accent-orange);
}

.stats-feelings-distribution {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.6;
}

.stats-feelings-by-day {
  margin-top: 1rem;
}

.stats-feelings-days-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.stats-feeling-day-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1rem;
  transition: all 0.2s ease;
}

.stats-feeling-day-card:hover {
  border-color: var(--accent-orange);
  transform: translateY(-2px);
}

.stats-feeling-day-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
}

.stats-feeling-day-header strong {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
}

.stats-feeling-day-count {
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

.stats-feeling-day-main {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.stats-feeling-day-emoji {
  font-size: 2rem;
}

.stats-feeling-day-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
}

.stats-feeling-day-feeling {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
}

.stats-feeling-day-percent {
  font-size: 0.75rem;
  color: var(--accent-orange);
  font-weight: 600;
}

/* États vides */
.stats-empty-state {
  text-align: center;
  padding: 3rem 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
}

.stats-empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.6;
}

.stats-empty-text {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.stats-empty-hint {
  font-size: 0.875rem;
  color: var(--text-tertiary);
  margin: 0;
}

.stats-error-message {
  padding: 1.5rem;
  background: rgba(255, 68, 68, 0.1);
  border: 1px solid var(--error);
  border-radius: 12px;
  color: var(--error);
  text-align: center;
  margin-bottom: 2rem;
}

/* Responsive */
@media (max-width: 768px) {
  .stats-container {
    padding: 1rem;
  }

  .stats-filters-bar {
    padding: 1rem;
  }

  .stats-filter-buttons {
    width: 100%;
  }

  .stats-filter-btn {
    flex: 1;
    min-width: 0;
  }

  .stats-habits-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

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

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

/* ============================================
   PAGE VISUALISATION SÉANCE
   ============================================ */

.session-view-main {
  min-height: calc(100vh - 200px);
  padding-bottom: 3rem;
}

.session-view-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* Skeleton loader */
.session-skeleton {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

.skeleton-card {
  height: 200px;
  background: var(--bg-card);
  border-radius: 20px;
  border: 1px solid var(--border-color);
  animation: skeleton-pulse 1.5s ease-in-out infinite;
}

/* En-tête de la séance */
.session-header-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
  transition: all 0.2s ease;
}

.session-header-card:hover {
  border-color: var(--accent-orange);
  box-shadow: 0 6px 20px rgba(252, 163, 17, 0.2);
}

.session-header-left {
  flex: 1;
}

.session-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 0.5rem 0;
  line-height: 1.2;
}

.session-subtitle {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin: 0 0 1rem 0;
}

.session-badges {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.session-visibility-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 12px;
  font-size: 0.875rem;
  font-weight: 600;
}

.session-visibility-public {
  background: rgba(85, 255, 85, 0.15);
  color: #55ff55;
  border: 1px solid rgba(85, 255, 85, 0.3);
}

.session-visibility-private {
  background: rgba(163, 85, 255, 0.15);
  color: #a355ff;
  border: 1px solid rgba(163, 85, 255, 0.3);
}

.session-header-right {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.session-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.session-btn-secondary {
  padding: 0.75rem 1.5rem;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s ease;
  display: inline-block;
}

.session-btn-secondary:hover {
  background: var(--bg-secondary);
  border-color: var(--accent-orange);
  transform: translateY(-2px);
}

.session-btn-primary {
  padding: 0.75rem 1.5rem;
  background: var(--accent-orange);
  color: var(--bg-primary);
  border: 1px solid var(--accent-orange);
  border-radius: 12px;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
  transition: all 0.2s ease;
  display: inline-block;
}

.session-btn-primary:hover {
  background: var(--accent-secondary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(252, 163, 17, 0.3);
}

/* Sections */
.session-section {
  margin-bottom: 2.5rem;
}

.session-section-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
}

/* Exercices */
.session-exercises-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.session-empty-exercises {
  text-align: center;
  padding: 3rem 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
}

.session-empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.6;
}

.session-empty-text {
  font-size: 1.125rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.session-empty-hint {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin: 0;
}

.session-exercise-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 1.5rem;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.session-exercise-card:hover {
  border-color: var(--accent-orange);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(252, 163, 17, 0.2);
}

.session-exercise-header {
  margin-bottom: 0.75rem;
}

.session-exercise-name {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.session-exercise-details {
  display: flex;
  gap: 1rem;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.session-exercise-sets-reps {
  font-weight: 500;
}

.session-exercise-weight {
  color: var(--accent-orange);
  font-weight: 600;
}

.session-exercise-indicators {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.session-exercise-indicator {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  background: var(--bg-tertiary);
  border-radius: 6px;
  color: var(--text-secondary);
}

/* CTA Principal */
.session-cta-wrapper {
  margin: 3rem 0;
  text-align: center;
}

.session-cta-btn {
  width: 100%;
  max-width: 500px;
  padding: 1.25rem 2rem;
  background: var(--accent-orange);
  color: var(--bg-primary);
  border: none;
  border-radius: 16px;
  font-size: 1.125rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 16px rgba(252, 163, 17, 0.3);
}

.session-cta-btn:hover {
  background: var(--accent-secondary);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(252, 163, 17, 0.4);
}

.session-cta-btn:active {
  transform: translateY(0);
}

/* Likes */
.session-likes-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all 0.2s ease;
}

.session-likes-card:hover {
  border-color: var(--accent-orange);
}

.session-like-btn {
  background: none;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  padding: 0.5rem;
  transition: transform 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.session-like-btn:hover {
  transform: scale(1.1);
}

.session-like-icon {
  transition: all 0.2s ease;
  display: inline-block;
}

.session-likes-count {
  font-size: 1rem;
  color: var(--text-primary);
  font-weight: 500;
}

/* Commentaires */
.session-comments-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 1.5rem;
  transition: all 0.2s ease;
}

.session-comments-card:hover {
  border-color: var(--accent-orange);
}

.session-comments-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 1.5rem 0;
}

.session-comments-preview {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.session-comment-preview-item {
  padding: 1rem;
  background: var(--bg-secondary);
  border-radius: 12px;
  transition: all 0.2s ease;
}

.session-comment-preview-item:hover {
  background: var(--bg-tertiary);
}

.session-comment-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  gap: 1rem;
}

.session-comment-username {
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.875rem;
}

.session-comment-date {
  color: var(--text-tertiary);
  font-size: 0.75rem;
}

.session-comment-content {
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.6;
  margin: 0;
}

.session-comments-empty {
  text-align: center;
  color: var(--text-secondary);
  padding: 2rem;
  font-size: 0.875rem;
}

.session-comment-form {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.session-comment-input {
  flex: 1;
  padding: 0.75rem 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 0.875rem;
  font-family: inherit;
}

.session-comment-input:focus {
  outline: none;
  border-color: var(--accent-orange);
  box-shadow: 0 0 0 3px rgba(252, 163, 17, 0.1);
}

.session-comment-submit {
  padding: 0.75rem 1.5rem;
  background: var(--accent-orange);
  color: var(--bg-primary);
  border: none;
  border-radius: 12px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.session-comment-submit:hover {
  background: var(--accent-secondary);
  transform: translateY(-1px);
}

.session-comments-toggle {
  width: 100%;
  padding: 0.75rem;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  color: var(--text-secondary);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 0.5rem;
}

.session-comments-toggle:hover {
  border-color: var(--accent-orange);
  color: var(--accent-orange);
}

.session-comments-full {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
}

.session-comments-list {
  max-height: 400px;
  overflow-y: auto;
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.session-comment-item {
  padding: 1rem;
  background: var(--bg-secondary);
  border-radius: 12px;
}

.session-comment-delete {
  background: none;
  border: none;
  color: var(--error);
  cursor: pointer;
  font-size: 1rem;
  padding: 0.25rem;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.session-comment-delete:hover {
  opacity: 1;
}

/* Toast */
.session-toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 1rem 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 500;
  z-index: 10000;
  opacity: 0;
  transition: all 0.3s ease;
  max-width: 90%;
  text-align: center;
}

.session-toast-success {
  border-color: var(--success);
  background: rgba(85, 255, 85, 0.1);
}

.session-toast-error {
  border-color: var(--error);
  background: rgba(255, 68, 68, 0.1);
  color: var(--error);
}

.session-error-message {
  padding: 1.5rem;
  background: rgba(255, 68, 68, 0.1);
  border: 1px solid var(--error);
  border-radius: 12px;
  color: var(--error);
  text-align: center;
  margin-bottom: 2rem;
}

/* Responsive */
@media (max-width: 768px) {
  .session-view-container {
    padding: 1rem;
  }

  .session-header-card {
    flex-direction: column;
    padding: 1.5rem;
  }

  .session-actions {
    width: 100%;
  }

  .session-btn-secondary,
  .session-btn-primary {
    flex: 1;
    text-align: center;
  }

  .session-cta-btn {
    width: 100%;
  }

  .session-exercises-list {
    gap: 0.75rem;
  }

  .session-comment-form {
    flex-direction: column;
  }

  .session-comment-submit {
    width: 100%;
  }
}


