/* Reset et base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #4a90e2;
  --primary-dark: #357abd;
  --success: #50c878;
  --warning: #ffa500;
  --error: #e74c3c;
  --bg: #f5f7fa;
  --text: #2c3e50;
  --text-light: #7f8c8d;
  --white: #ffffff;
  --border: #dfe6e9;
  --shadow: rgba(0, 0, 0, 0.1);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell,
    sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* Mode dyslexie */
body.dyslexia-mode {
  font-family: 'Comic Sans MS', 'Trebuchet MS', sans-serif;
  letter-spacing: 0.05em;
  word-spacing: 0.15em;
}

/* Container */
.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
}

/* Header */
.header {
  text-align: center;
  margin-bottom: 40px;
  padding: 30px 20px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: var(--white);
  border-radius: 20px;
  box-shadow: 0 4px 12px var(--shadow);
}

/* Brand header avec logo */
.brand-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  justify-content: center;
}

.brand-logo {
  width: 100px;
  height: 100px;
  object-fit: contain;
  border-radius: 12px;
  background: white;
  padding: 8px;
  cursor: pointer;
  transition: transform 0.3s;
}

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

.brand-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.brand-text h1 {
  margin: 0;
  font-size: 2.5rem;
  color: var(--white);
}

.brand-text .subtitle {
  margin: 5px 0 0 0;
  font-size: 1.1rem;
  opacity: 0.95;
  font-weight: 500;
}

/* Sélecteur de langue */
.language-selector {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 15px;
}

.lang-btn {
  width: 45px;
  height: 45px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lang-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
  transform: scale(1.1);
}

.lang-btn.active {
  background: var(--white);
  border-color: var(--white);
  transform: scale(1.15);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Lien mot de passe oublié */
.forgot-password-link {
  display: block;
  text-align: center;
  margin-top: 15px;
  color: var(--primary);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.3s;
}

.forgot-password-link:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

.header h1 {
  font-size: 2.5rem;
  margin-bottom: 10px;
}

.subtitle {
  font-size: 1.1rem;
  opacity: 0.95;
}

/* Options */
.options {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-bottom: 30px;
}

.btn-option {
  width: 50px;
  height: 50px;
  border: none;
  border-radius: 50%;
  background: var(--white);
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: 0 2px 8px var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn-option:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--shadow);
}

/* Menu */
.menu {
  display: flex;
  gap: 20px;
  margin-bottom: 30px;
}

/* Boutons */
.btn-large {
  padding: 15px 30px;
  font-size: 1.1rem;
  font-weight: 600;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn-admin {
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
  color: var(--white);
}

.btn-admin:hover {
  background: linear-gradient(135deg, #7c3aed, #4f46e5);
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(139, 92, 246, 0.3);
}

.btn-primary {
  background: var(--primary);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--shadow);
}

.btn-secondary {
  background: var(--white);
  color: var(--text);
  border: 2px solid var(--border);
}

.btn-secondary:hover {
  border-color: var(--primary);
  color: var(--primary);
}

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

.btn-success:hover {
  background: #45b369;
  transform: translateY(-2px);
}

.btn-icon {
  width: 50px;
  height: 50px;
  border: none;
  background: var(--white);
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: 0 2px 8px var(--shadow);
  transition: all 0.2s;
}

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

/* Vues */
.view {
  display: none;
}

.view.active {
  display: block;
}

/* Exercise header */
.exercise-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
}

.score-display {
  background: var(--white);
  padding: 10px 20px;
  border-radius: 20px;
  box-shadow: 0 2px 8px var(--shadow);
  font-weight: 600;
}

.score-value {
  color: var(--primary);
  font-size: 1.5rem;
  margin-left: 8px;
}

/* Progress bar */
.progress-bar {
  width: 100%;
  height: 12px;
  background: var(--white);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: inset 0 2px 4px var(--shadow);
  margin-bottom: 10px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-dark));
  transition: width 0.5s ease;
}

.progress-text {
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-light);
  margin-bottom: 20px;
}

/* Liens dans l'exercice */
.exercise-links {
  max-width: 600px;
  margin: 0 auto 20px auto;
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-exercise-link {
  padding: 8px 16px;
  border: 2px solid #3B82F6;
  border-radius: 8px;
  background: var(--white);
  color: #3B82F6;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-exercise-link:hover {
  background: #3B82F6;
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-exercise-link.preparation {
  border-color: #7C3AED;
  color: #7C3AED;
}

.btn-exercise-link.preparation:hover {
  background: #7C3AED;
  color: var(--white);
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

/* Item info */
.item-info {
  text-align: center;
  margin-bottom: 20px;
}

.item-level {
  display: inline-block;
  background: var(--white);
  padding: 8px 16px;
  border-radius: 20px;
  font-weight: 600;
  color: var(--primary);
  box-shadow: 0 2px 8px var(--shadow);
}

/* Audio controls */
.audio-controls {
  display: flex;
  gap: 15px;
  justify-content: center;
  margin-bottom: 20px;
}

.btn-play {
  font-size: 1.2rem;
  padding: 15px 40px;
}

/* Traductions dans l'exercice */
.exercise-translations {
  max-width: 600px;
  margin: 0 auto 20px auto;
  padding: 15px;
  background: #F0F9FF;
  border: 2px solid #3B82F6;
  border-radius: 12px;
  display: none;
}

.exercise-translations.show {
  display: block;
}

.exercise-translations h4 {
  margin: 0 0 10px 0;
  font-size: 0.95rem;
  color: #1E40AF;
  text-align: center;
}

.translations-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.translation-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--white);
  border: 1px solid #BFDBFE;
  border-radius: 8px;
  font-size: 0.9rem;
  color: var(--text);
}

.translation-badge .flag {
  font-size: 1.1rem;
}

.translation-badge .text {
  font-weight: 600;
}

/* Answer section */
.answer-section {
  margin-bottom: 20px;
}

.input-answer {
  width: 100%;
  padding: 20px;
  font-size: 1.3rem;
  border: 3px solid var(--border);
  border-radius: 12px;
  outline: none;
  transition: border-color 0.3s;
  box-shadow: 0 2px 8px var(--shadow);
}

.input-answer:focus {
  border-color: var(--primary);
}

/* Accent keyboard */
.accent-keyboard {
  display: none;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 15px;
  justify-content: center;
}

.accent-keyboard.show {
  display: flex;
}

.accent-key {
  width: 50px;
  height: 50px;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: var(--white);
  font-size: 1.3rem;
  cursor: pointer;
  transition: all 0.2s;
}

.accent-key:hover {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
  transform: scale(1.1);
}

/* Feedback */
.feedback {
  display: none;
  padding: 20px;
  border-radius: 12px;
  text-align: center;
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 20px;
  animation: slideIn 0.3s ease;
}

.feedback.show {
  display: block;
}

.feedback.correct {
  background: #d4edda;
  color: #155724;
  border: 2px solid var(--success);
}

.feedback.incorrect {
  background: #f8d7da;
  color: #721c24;
  border: 2px solid var(--error);
}

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

/* Actions */
.actions {
  display: flex;
  justify-content: center;
  gap: 15px;
}

/* Bouton préparation dans les cartes */
.btn-preparation {
  padding: 8px 16px;
  border: 2px solid #9333EA;
  border-radius: 8px;
  background: #F3E8FF;
  color: #7C3AED;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-preparation:hover {
  background: #7C3AED;
  color: var(--white);
  border-color: #7C3AED;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

/* Mode Préparation */
.preparation-actions {
  max-width: 800px;
  margin: 20px auto;
  text-align: center;
}

.btn-start-from-prep {
  padding: 15px 40px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  color: var(--white);
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-start-from-prep:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.btn-start-from-prep:active {
  transform: translateY(0);
}

.preparation-linked {
  max-width: 800px;
  margin: 20px auto;
  padding: 15px;
  background: #EFF6FF;
  border: 2px solid #3B82F6;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 15px;
}

.preparation-linked-text {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  flex: 1;
}

.btn-linked-prep {
  padding: 10px 20px;
  border: 2px solid #3B82F6;
  border-radius: 8px;
  background: var(--white);
  color: #3B82F6;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-linked-prep:hover {
  background: #3B82F6;
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.preparation-items {
  max-width: 800px;
  margin: 30px auto;
}

.preparation-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  margin-bottom: 15px;
  background: var(--white);
  border: 2px solid var(--border);
  border-radius: 12px;
  transition: all 0.3s;
}

.preparation-item:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.preparation-item-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.preparation-item-text {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
}

.preparation-item-translations {
  font-size: 0.95rem;
  color: #6B7280;
  font-style: italic;
}

.btn-play-item {
  width: 50px;
  height: 50px;
  border: none;
  background: var(--primary);
  color: var(--white);
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-play-item:hover {
  background: var(--primary-dark);
  transform: scale(1.1);
}

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

/* Modal Stats */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s;
}

.modal.show {
  display: flex;
}

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

.modal-content {
  background: var(--white);
  padding: 30px;
  border-radius: 20px;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.3s;
}

@keyframes slideUp {
  from {
    transform: translateY(50px);
  }
  to {
    transform: translateY(0);
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
}

.modal-header h2 {
  color: var(--primary);
}

.btn-close {
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-light);
  transition: color 0.2s;
}

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

/* Stats grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
  margin-bottom: 30px;
}

.stat-card {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: var(--white);
  padding: 20px;
  border-radius: 12px;
  text-align: center;
}

.stat-label {
  font-size: 0.9rem;
  opacity: 0.9;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
}

/* Bonus grid */
.bonus-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  margin-bottom: 20px;
}

@media (max-width: 768px) {
  .bonus-grid {
    grid-template-columns: 1fr;
  }
}

.bonus-card {
  background: linear-gradient(135deg, #f39c12, #e67e22);
  color: var(--white);
  padding: 15px;
  border-radius: 10px;
  text-align: center;
}

.bonus-label {
  font-size: 0.85rem;
  opacity: 0.95;
  margin-bottom: 8px;
  font-weight: 600;
}

.bonus-value {
  font-size: 1.5rem;
  font-weight: 700;
}

/* Stats sections */
.stats-section {
  margin-bottom: 25px;
}

.stats-section h3 {
  margin-bottom: 15px;
  color: var(--primary);
}

.badges-container {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
}

.badge {
  background: var(--bg);
  padding: 15px;
  border-radius: 12px;
  text-align: center;
  flex: 1;
  min-width: 140px;
}

.badge-emoji {
  font-size: 2.5rem;
  margin-bottom: 8px;
}

.badge-title {
  font-weight: 600;
  margin-bottom: 5px;
}

.badge-desc {
  font-size: 0.85rem;
  color: var(--text-light);
}

.no-badges,
.no-items {
  text-align: center;
  color: var(--text-light);
  font-style: italic;
}

.stats-items-list {
  background: var(--bg);
  padding: 15px;
  border-radius: 12px;
  max-height: 200px;
  overflow-y: auto;
}

.stats-item {
  padding: 10px;
  border-bottom: 1px solid var(--border);
}

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

/* Toast */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--text);
  color: var(--white);
  padding: 15px 30px;
  border-radius: 25px;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 2000;
  transition: transform 0.3s ease;
}

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

.toast-success {
  background: var(--success);
}

.toast-warning {
  background: var(--warning);
}

.toast-error {
  background: var(--error);
}

/* Confetti */
.confetti {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 5rem;
  z-index: 2000;
  animation: confettiPop 2s ease;
  pointer-events: none;
}

@keyframes confettiPop {
  0% {
    transform: translate(-50%, -50%) scale(0);
    opacity: 1;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.5);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0;
  }
}

/* Authentification */
.auth-container {
  max-width: 450px;
  margin: 0 auto;
  background: var(--white);
  border-radius: 20px;
  padding: 30px;
  box-shadow: 0 4px 12px var(--shadow);
}

.auth-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 25px;
  border-bottom: 2px solid var(--border);
}

.auth-tab {
  flex: 1;
  padding: 12px 20px;
  font-size: 1.1rem;
  font-weight: 600;
  border: none;
  background: transparent;
  color: var(--text-light);
  cursor: pointer;
  transition: all 0.3s;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
}

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

.auth-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.auth-form {
  display: none;
  flex-direction: column;
  gap: 15px;
}

.auth-form.active {
  display: flex;
}

.input-field {
  padding: 15px 20px;
  font-size: 1.1rem;
  border: 2px solid var(--border);
  border-radius: 12px;
  outline: none;
  transition: border-color 0.3s;
}

.input-field:focus {
  border-color: var(--primary);
}

.input-field::placeholder {
  color: var(--text-light);
}

/* Bouton toggle filtres */
.btn-toggle-filters {
  width: 100%;
  padding: 12px 20px;
  margin: 20px 0 10px 0;
  background: var(--white);
  border: 2px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.btn-toggle-filters:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-toggle-filters .toggle-icon {
  font-size: 1.2rem;
  transition: transform 0.3s;
}

.btn-toggle-filters.open .toggle-icon {
  transform: rotate(180deg);
}

/* Filtres */
.filters-section {
  margin: 0 0 30px 0;
  padding: 20px;
  background: var(--white);
  border: 2px solid var(--border);
  border-radius: 15px;
  overflow: hidden;
  transition: all 0.3s ease-in-out;
}

.filters-section.collapsed {
  max-height: 0;
  padding: 0 20px;
  margin: 0;
  border: none;
  opacity: 0;
}

.filter-group {
  margin-bottom: 20px;
}

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

.filter-label {
  display: block;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
}

.search-exercise-input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: 12px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--text);
  background: var(--white);
  transition: all 0.3s;
}

.search-exercise-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

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

.filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.filter-btn {
  padding: 8px 16px;
  border: 2px solid var(--border);
  border-radius: 20px;
  background: var(--white);
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.filter-btn:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  transform: translateY(-2px);
}

.filter-btn.active {
  border-color: var(--primary);
  background: var(--primary);
  color: var(--white);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.filter-btn.all {
  background: var(--primary-light);
  border-color: var(--primary);
}

.filter-btn.all.active {
  background: var(--primary);
  color: var(--white);
}

/* Liste des exercices */
.exercises-list {
  margin-bottom: 20px;
}

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

/* Carte d'exercice */
.exercise-card {
  background: var(--white);
  border: 3px solid var(--border);
  border-radius: 15px;
  padding: 25px;
  transition: all 0.3s;
  box-shadow: 0 2px 8px var(--shadow);
  cursor: pointer;
}

.exercise-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px var(--shadow);
  border-color: var(--primary);
}

.exercise-card.completed {
  border-color: var(--success);
  background: linear-gradient(135deg, var(--white) 0%, #f0fdf4 100%);
}

.exercise-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
  text-align: center;
}

/* Badge de catégorie */
.category-badge {
  display: inline-block;
  padding: 6px 12px;
  margin-bottom: 15px;
  background: var(--bg-secondary);
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-light);
  text-align: center;
}

/* Indicateur de chargement */
.exercises-loading {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-light);
}

.spinner {
  width: 50px;
  height: 50px;
  margin: 0 auto 20px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Désactiver les filtres pendant le chargement */
.filter-buttons.loading {
  pointer-events: none;
  opacity: 0.5;
}

.exercise-footer {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.exercise-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  width: 100%;
}

.exercise-stats {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-height: 40px;
}

/* Badge de réussite */
.success-badge {
  padding: 6px 14px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--white);
}

.success-badge.excellent {
  background: linear-gradient(135deg, #10b981, #059669);
}

.success-badge.good {
  background: linear-gradient(135deg, #f59e0b, #d97706);
}

.success-badge.needs-work {
  background: linear-gradient(135deg, #ef4444, #dc2626);
}

/* Badge bonus 100% */
.bonus-badge {
  padding: 4px 8px;
  border-radius: 50%;
  font-size: 1.2rem;
  margin-left: 8px;
  display: inline-block;
  cursor: help;
}

.bonus-badge.earned {
  opacity: 1;
  filter: grayscale(0);
}

.bonus-badge.not-earned {
  opacity: 0.4;
  filter: grayscale(1);
}

/* Badge séries parfaites */
.streak-badge {
  padding: 4px 10px;
  border-radius: 15px;
  font-size: 0.85rem;
  margin-left: 8px;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: var(--white);
  font-weight: 700;
  display: inline-block;
  cursor: help;
}

.btn-start-exercise {
  padding: 10px 20px;
  background: var(--primary);
  color: var(--white);
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  flex: 1;
  min-width: 120px;
}

.btn-start-exercise:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-linked-exercise {
  padding: 10px 16px;
  background: var(--white);
  color: var(--primary);
  border: 2px solid var(--primary);
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  white-space: nowrap;
}

.btn-linked-exercise:hover {
  background: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

/* Badge maître (10 séries parfaites) */
.master-badge {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 700;
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
  color: var(--white);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: help;
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
}

.master-badge.earned {
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
  }
  50% {
    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.6);
  }
}

.master-badge.not-earned {
  opacity: 0.4;
  filter: grayscale(1);
}

.no-items {
  text-align: center;
  color: var(--text-light);
  font-style: italic;
  padding: 60px 20px;
  font-size: 1.1rem;
}

/* Affichage des points */
.points-display {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.points-card {
  display: flex;
  align-items: center;
  gap: 15px;
  background: linear-gradient(135deg, #ffd700, #ffed4e);
  padding: 15px 25px;
  border-radius: 15px;
  box-shadow: 0 4px 12px rgba(255, 215, 0, 0.3);
}

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

.points-info {
  display: flex;
  flex-direction: column;
}

.points-label {
  font-size: 0.9rem;
  color: #666;
  font-weight: 600;
}

.points-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: #333;
}

.btn-shop {
  padding: 12px 24px;
  font-size: 1rem;
  font-weight: 600;
  border: 2px solid var(--primary);
  border-radius: 10px;
  background: var(--white);
  color: var(--primary);
  cursor: pointer;
  transition: all 0.3s;
}

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

.btn-shop.btn-admin {
  border-color: #9333ea;
  color: #9333ea;
}

.btn-shop.btn-admin:hover {
  background: #9333ea;
  color: var(--white);
}

/* En-tête boutique */
.shop-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
}

.shop-header h2 {
  margin: 0;
  font-size: 1.8rem;
  color: var(--primary);
}

.points-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #ffd700, #ffed4e);
  padding: 10px 20px;
  border-radius: 25px;
  font-size: 1.3rem;
  font-weight: 700;
  color: #333;
  box-shadow: 0 2px 8px rgba(255, 215, 0, 0.3);
}

/* Grille boutique */
.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.reward-card {
  background: var(--white);
  border: 3px solid var(--border);
  border-radius: 15px;
  padding: 20px;
  transition: all 0.3s;
  box-shadow: 0 2px 8px var(--shadow);
  display: flex;
  flex-direction: column;
}

.reward-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px var(--shadow);
  border-color: var(--primary);
}

.reward-card.disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.reward-card.disabled:hover {
  transform: none;
}

.reward-image {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 15px;
  background: var(--bg);
}

.reward-name {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.reward-description {
  font-size: 0.95rem;
  color: var(--text-light);
  margin-bottom: 15px;
  flex: 1;
}

.reward-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
}

.reward-cost {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 1.3rem;
  font-weight: 700;
  color: #ffa500;
}

.btn-buy {
  padding: 10px 20px;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  background: var(--success);
  color: var(--white);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-buy:hover {
  background: #45b369;
  transform: scale(1.05);
}

.btn-buy:disabled {
  background: var(--border);
  cursor: not-allowed;
  transform: none;
}

/* Liste des commandes */
.orders-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.order-card {
  background: var(--white);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  gap: 20px;
  align-items: center;
  box-shadow: 0 2px 8px var(--shadow);
}

.order-card.pending {
  border-color: #ffa500;
  background: linear-gradient(135deg, var(--white) 0%, #fff7ed 100%);
}

.order-card.delivered {
  border-color: var(--success);
  background: linear-gradient(135deg, var(--white) 0%, #f0fdf4 100%);
}

.order-image {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  background: var(--bg);
}

.order-info {
  flex: 1;
}

.order-name {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 5px;
}

.order-date {
  font-size: 0.9rem;
  color: var(--text-light);
  margin-bottom: 8px;
}

.order-status {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 15px;
  font-size: 0.85rem;
  font-weight: 600;
}

.order-status.pending {
  background: #ffa500;
  color: var(--white);
}

.order-status.delivered {
  background: var(--success);
  color: var(--white);
}

.order-cost {
  font-size: 1.2rem;
  font-weight: 700;
  color: #ffa500;
}

.btn-deliver {
  padding: 8px 16px;
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  background: var(--success);
  color: var(--white);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-deliver:hover {
  background: #45b369;
}

/* Onglets admin */
.admin-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 25px;
  border-bottom: 2px solid var(--border);
}

.admin-tab {
  flex: 1;
  padding: 12px 20px;
  font-size: 1.1rem;
  font-weight: 600;
  border: none;
  background: transparent;
  color: var(--text-light);
  cursor: pointer;
  transition: all 0.3s;
  border-bottom: 3px solid transparent !important;
  margin-bottom: -2px;
  text-decoration: none;
}

.admin-tab span {
  text-decoration: none;
}

.admin-tab:hover {
  color: var(--primary);
  text-decoration: none;
  border-bottom: 3px solid transparent !important;
}

.admin-tab.active {
  color: var(--primary);
  border-bottom: 3px solid var(--primary) !important;
  text-decoration: none;
}

.admin-panel {
  display: none;
}

.admin-panel.active {
  display: block;
}

/* Liste admin récompenses */
.admin-rewards-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.admin-reward-card {
  background: var(--white);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  gap: 20px;
  align-items: center;
  box-shadow: 0 2px 8px var(--shadow);
}

.admin-reward-card.inactive {
  opacity: 0.5;
  border-style: dashed;
}

.admin-reward-actions {
  display: flex;
  gap: 10px;
}

.btn-edit, .btn-delete {
  padding: 8px 16px;
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-edit {
  background: var(--primary);
  color: var(--white);
}

.btn-edit:hover {
  background: var(--primary-dark);
}

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

.btn-delete:hover {
  background: #c53030;
}

/* Modals */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 2000;
  align-items: center;
  justify-content: center;
}

.modal.show {
  display: flex;
}

.modal .modal-content {
  background: var(--white);
  border-radius: 20px;
  padding: 30px;
  max-width: 500px;
  width: 90%;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.modal .modal-content h3 {
  margin-top: 0;
  margin-bottom: 20px;
  color: var(--primary);
}

.modal .modal-content p {
  margin-bottom: 20px;
  color: var(--text-light);
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
}

.modal textarea.input-field {
  resize: vertical;
  font-family: inherit;
}

/* Responsive */
@media (max-width: 600px) {
  .brand-logo {
    width: 80px;
    height: 80px;
  }
  
  .brand-text h1 {
    font-size: 2rem;
  }
  
  .brand-text .subtitle {
    font-size: 1rem;
  }

  .header h1 {
    font-size: 2rem;
  }

  .btn-large {
    padding: 15px 30px;
    font-size: 1.1rem;
  }

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

  .modal-content {
    margin: 20px;
    padding: 20px;
  }

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

  .new-user-form {
    flex-direction: column;
  }

  .exercise-type-tabs {
    flex-direction: column;
  }

  .btn-user {
    width: 100%;
  }

  .points-display {
    flex-direction: column;
    align-items: stretch;
  }

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

  .order-card {
    flex-direction: column;
    text-align: center;
  }

  .admin-reward-card {
    flex-direction: column;
  }
}
