/* Reprise du CSS précédent avec ajouts pour Dashboard */
/* =========================================
   VARIABLES DE THÈME (Light / Dark)
   ========================================= */
:root {
  --bg: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  --bg-solid: #f0f9ff;
  --fg: #0f172a;
  --muted: #64748b;
  --card: #ffffff;
  --card-hover: #fefefe;
  --card-border: #e2e8f0;
  --btn-bg: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 100%);
  --btn-bg-hover: linear-gradient(135deg, #0284c7 0%, #0891b2 100%);
  --btn-fg: #ffffff;
  --btn-ghost: #f1f5f9;
  --btn-ghost-hover: #e2e8f0;
  --badge-bg: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
  --badge-fg: #0f172a;
  --accent: #22c55e;
  --accent-light: #86efac;
  --danger: #ef4444;
  --danger-light: #fca5a5;
  --warning: #f59e0b;
  --info: #3b82f6;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --shadow-card: 0 4px 12px rgba(14, 165, 233, 0.08);
  --shadow-card-hover: 0 8px 24px rgba(14, 165, 233, 0.15);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

html[data-theme="dark"] {
  --bg: linear-gradient(135deg, #0b1220 0%, #0f172a 100%);
  --bg-solid: #0b1220;
  --fg: #e5e7eb;
  --muted: #94a3b8;
  --card: #1e293b;
  --card-hover: #253447;
  --card-border: #334155;
  --btn-bg: linear-gradient(135deg, #38bdf8 0%, #22d3ee 100%);
  --btn-bg-hover: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 100%);
  --btn-fg: #0b1220;
  --btn-ghost: #334155;
  --btn-ghost-hover: #475569;
  --badge-bg: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  --badge-fg: #e5e7eb;
  --accent: #4ade80;
  --accent-light: #86efac;
  --danger: #f87171;
  --danger-light: #fca5a5;
  --warning: #fbbf24;
  --info: #60a5fa;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.4);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.6), 0 10px 10px -5px rgba(0, 0, 0, 0.5);
  --shadow-card: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-card-hover: 0 8px 24px rgba(56, 189, 248, 0.2);
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

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

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

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

@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px) saturate(180%);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--card-border);
  animation: slideInFromBottom var(--transition-base);
}

html[data-theme="dark"] .app-header {
  background: rgba(30, 41, 59, 0.8);
}

.app-header h1 {
  font-size: clamp(1.25rem, 3vw, 1.5rem);
  font-weight: 700;
  background: var(--btn-bg);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0;
}

.app-header nav {
  display: flex;
  gap: 8px;
  align-items: center;
}

.app-footer {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  margin-top: 40px;
  color: var(--muted);
  font-size: 0.875rem;
  text-align: center;
}

main {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 16px 80px;
}

.card {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 24px;
  border: 1px solid var(--card-border);
  transition: all var(--transition-base);
  animation: fadeIn var(--transition-base);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--btn-bg);
  opacity: 0;
  transition: opacity var(--transition-base);
}

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

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

.card-list {
  display: grid;
  gap: 16px;
}

.btn {
  appearance: none;
  border: none;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
}

.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 var(--transition-spring), height var(--transition-spring);
}

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

.btn.primary {
  background: var(--btn-bg);
  color: var(--btn-fg);
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
}

.btn.primary:hover {
  background: var(--btn-bg-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(14, 165, 233, 0.4);
}

.btn.ghost {
  background: var(--btn-ghost);
  color: var(--fg);
  border: 1px solid var(--card-border);
}

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

.btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

.btn[disabled]:hover {
  box-shadow: none;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--badge-bg);
  color: var(--badge-fg);
  border-radius: var(--radius-full);
  padding: 6px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid var(--card-border);
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.badge:hover {
  transform: scale(1.05);
}

.badge.success {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
  color: white;
  border-color: var(--accent);
}

.badge.danger {
  background: linear-gradient(135deg, var(--danger) 0%, var(--danger-light) 100%);
  color: white;
  border-color: var(--danger);
}

.quiz-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
  animation: fadeIn var(--transition-base);
}

.quiz-meta {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

#question-container {
  margin-bottom: 24px;
  animation: scaleIn var(--transition-base);
}

.choice {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border: 2px solid var(--card-border);
  border-radius: var(--radius-md);
  background: var(--card);
  cursor: pointer;
  transition: all var(--transition-base);
  margin-bottom: 12px;
  position: relative;
  overflow: hidden;
}

.choice::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: var(--btn-bg);
  opacity: 0.1;
  transition: width var(--transition-base);
}

.choice:hover {
  border-color: var(--accent);
  background: var(--card-hover);
  transform: translateX(4px);
}

.choice:hover::before {
  width: 100%;
}

.choice.correct {
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
  border-color: var(--accent);
  animation: scaleIn var(--transition-base);
}

html[data-theme="dark"] .choice.correct {
  background: linear-gradient(135deg, rgba(74, 222, 128, 0.15) 0%, rgba(74, 222, 128, 0.05) 100%);
}

.choice.incorrect {
  background: linear-gradient(135deg, #fef2f2 0%, #fecaca 100%);
  border-color: var(--danger);
  animation: scaleIn var(--transition-base);
}

html[data-theme="dark"] .choice.incorrect {
  background: linear-gradient(135deg, rgba(248, 113, 113, 0.15) 0%, rgba(248, 113, 113, 0.05) 100%);
}

.feedback {
  margin-top: 16px;
  padding: 16px;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  animation: fadeIn var(--transition-base);
}

.feedback.correct {
  color: var(--accent);
  background: rgba(74, 222, 128, 0.1);
  border: 1px solid var(--accent);
}

.feedback.incorrect {
  color: var(--danger);
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid var(--danger);
}

.flashcard-container {
  perspective: 1000px;
  min-height: 300px;
}

.flashcard {
  position: relative;
  transition: transform var(--transition-slow);
  transform-style: preserve-3d;
  cursor: pointer;
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.flashcard.flipping {
  animation: flip3d 0.6s ease-in-out;
}

@keyframes flip3d {
  0% {
    transform: rotateY(0deg);
  }
  50% {
    transform: rotateY(90deg);
  }
  100% {
    transform: rotateY(0deg);
  }
}

.flashcard-face {
  width: 100%;
  padding: 32px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  min-height: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.flashcard-face.front {
  transform: rotateY(0deg);
}

.flashcard-face.back {
  transform: rotateY(180deg);
}

.fc-face {
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: center;
  animation: fadeIn var(--transition-base);
}

.fc-title {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.4;
}

.fc-answer {
  font-size: 1.1rem;
  color: var(--accent);
  padding: 16px;
  background: rgba(74, 222, 128, 0.1);
  border-radius: var(--radius-md);
  border: 2px solid var(--accent);
  margin-top: 8px;
}

.actions, .quiz-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
  animation: fadeIn var(--transition-base) 0.2s;
}

input[type="text"],
input[type="search"],
textarea,
input[type="file"] {
  width: 100%;
  padding: 14px 18px;
  border: 2px solid var(--card-border);
  border-radius: var(--radius-md);
  background: var(--card);
  color: var(--fg);
  font-size: 1rem;
  transition: all var(--transition-base);
  font-family: inherit;
}

input[type="text"]:focus,
input[type="search"]:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

input[type="radio"],
input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--accent);
  cursor: pointer;
}

input[type="file"] {
  display: none;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.75rem;
}

h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
}

h3 {
  font-size: clamp(1.25rem, 2.5vw, 1.5rem);
}

.muted, small {
  color: var(--muted);
  font-size: 0.9rem;
}

strong {
  font-weight: 600;
}

.view {
  animation: fadeIn var(--transition-base);
}

.view[hidden] {
  display: none;
}

.meta {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin: 12px 0;
  font-size: 0.9rem;
  color: var(--muted);
}

/* =========================================
   DASHBOARD STYLES - US 3.1
   ========================================= */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
  border: 2px solid var(--card-border);
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--btn-bg);
  opacity: 0;
  transition: opacity var(--transition-base);
}

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

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

.stat-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
  animation: scaleIn var(--transition-base);
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--fg);
  margin-bottom: 8px;
}

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

.dashboard-theme-card {
  margin-bottom: 20px;
}

.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 16px;
  padding: 16px;
  background: rgba(14, 165, 233, 0.05);
  border-radius: var(--radius-md);
  border: 1px solid var(--card-border);
}

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

.dashboard-stat .stat-label {
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 4px;
}

.dashboard-stat .stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--fg);
}

/* Export/Import Section - US 3.4 */
.export-section {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.05) 0%, rgba(6, 182, 212, 0.05) 100%);
  border-radius: var(--radius-lg);
  padding: 24px;
  border: 2px solid var(--card-border);
  margin-top: 24px;
}

.export-section h3 {
  margin-bottom: 16px;
  color: var(--fg);
}

.export-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* =========================================
   RESPONSIVE
   ========================================= */
@media (max-width: 768px) {
  .app-header {
    padding: 12px 16px;
  }
  
  .app-header h1 {
    font-size: 1.25rem;
  }
  
  main {
    padding: 16px 12px 60px;
  }
  
  .card {
    padding: 16px;
  }
  
  .btn {
    padding: 10px 18px;
    font-size: 0.9rem;
  }
  
  .quiz-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .choice {
    padding: 12px 16px;
  }
  
  .actions, .quiz-actions {
    gap: 8px;
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .dashboard-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 420px) {
  .card {
    padding: 12px;
    border-radius: var(--radius-md);
  }
  
  .btn {
    padding: 8px 16px;
    font-size: 0.85rem;
  }
  
  .badge {
    font-size: 0.75rem;
    padding: 4px 10px;
  }
  
  .actions .btn {
    flex: 1 1 calc(50% - 4px);
    min-width: 0;
  }
  
  .fc-title {
    font-size: 1.1rem;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .stat-icon {
    font-size: 2rem;
  }
  
  .stat-value {
    font-size: 1.5rem;
  }
}

.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid var(--card-border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-solid);
}

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

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

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

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

*:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

button:focus-visible,
.btn:focus-visible {
  outline-offset: 4px;
}

/* ============================================ */
/* STYLES POUR L'IMPORT DE THÈMES */
/* ============================================ */

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

/* Zone de drag & drop */
.drop-zone {
  border: 3px dashed var(--border);
  border-radius: 12px;
  padding: 48px 24px;
  text-align: center;
  transition: all 0.3s ease;
  background: var(--bg-secondary);
  cursor: pointer;
}

.drop-zone:hover {
  border-color: var(--accent);
  background: var(--bg);
}

.drop-zone.drag-over {
  border-color: var(--accent);
  background: var(--accent-light);
  transform: scale(1.02);
}

.drop-zone-content {
  pointer-events: none;
}

.drop-icon {
  font-size: 4rem;
  margin-bottom: 16px;
  animation: float 3s ease-in-out infinite;
}

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

.drop-text {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0 0 12px 0;
  color: var(--text);
}

/* Prévisualisation du thème */
.theme-preview {
  margin-top: 24px;
  animation: slideIn 0.3s ease;
}

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

/* Erreurs de validation */
.validation-errors {
  margin-top: 24px;
  animation: slideIn 0.3s ease;
}

/* Bouton large */
.btn.large {
  padding: 16px 32px;
  font-size: 1.1rem;
  font-weight: 600;
}

/* Badge info pour thèmes personnalisés */
.badge.info {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  font-weight: 600;
}

/* Warning color */
:root {
  --warning: #f59e0b;
}

[data-theme="dark"] {
  --warning: #fbbf24;
}

/* ============================================ */
/* STYLES POUR LA GESTION DES THÈMES */
/* ============================================ */

.stats-summary {
  margin-bottom: 24px;
}

.stat-value {
  font-size: 2rem;
  font-weight: bold;
  color: var(--accent);
  margin-bottom: 4px;
}

/* Headers de vue améliorés */
.view-header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  gap: 16px;
}

.view-header h2 {
  margin: 0;
  flex: 1;
}

/* ============================================ */
/* RESPONSIVE - MOBILE */
/* ============================================ */

@media (max-width: 768px) {
  .drop-zone {
    padding: 32px 16px;
  }
  
  .drop-icon {
    font-size: 3rem;
  }
  
  .drop-text {
    font-size: 1rem;
  }
  
  .btn.large {
    padding: 12px 24px;
    font-size: 1rem;
    width: 100%;
  }
  
  .view-header-content {
    flex-direction: column;
    align-items: stretch;
  }
  
  .view-header-content h2 {
    text-align: center;
  }
  
  .stats-summary .card > div {
    flex-direction: column !important;
    gap: 16px !important;
  }
  
  .stat-value {
    font-size: 1.5rem;
  }
}

/* ============================================ */
/* ANIMATIONS SUPPLÉMENTAIRES */
/* ============================================ */

/* Animation pour les cartes qui apparaissent */
.card {
  animation: fadeInUp 0.4s ease forwards;
  opacity: 0;
}

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

/* Animation pour les badges */
.badge {
  transition: all 0.2s ease;
}

.badge:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* ============================================ */
/* STYLES POUR LES CODES PRE */
/* ============================================ */

pre {
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  line-height: 1.5;
  tab-size: 2;
}

pre code {
  display: block;
  color: var(--text);
}

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

pre::-webkit-scrollbar-track {
  background: var(--bg-secondary);
  border-radius: 4px;
}

pre::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

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

/* ============================================ */
/* DARK MODE - COULEURS ACCENT LIGHT */
/* ============================================ */

:root {
  --accent-light: rgba(99, 102, 241, 0.1);
}

[data-theme="dark"] {
  --accent-light: rgba(99, 102, 241, 0.2);
}

/* ============================================ */
/* STYLES POUR LES ACTIONS DE THÈMES */
/* ============================================ */

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.actions .btn {
  flex: 1;
  min-width: 120px;
}

@media (max-width: 576px) {
  .actions {
    flex-direction: column;
  }
  
  .actions .btn {
    width: 100%;
  }
}

/* ============================================ */
/* AMÉLIORATION DES META TAGS */
/* ============================================ */

.meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
}

.meta > span {
  display: inline-flex;
  align-items: center;
}

/* ============================================ */
/* STYLES POUR LES MESSAGES D'INFO */
/* ============================================ */

.info-message {
  padding: 16px;
  border-radius: 8px;
  background: var(--accent-light);
  border-left: 4px solid var(--accent);
  margin: 16px 0;
}

.warning-message {
  padding: 16px;
  border-radius: 8px;
  background: rgba(245, 158, 11, 0.1);
  border-left: 4px solid var(--warning);
  margin: 16px 0;
}

.error-message {
  padding: 16px;
  border-radius: 8px;
  background: rgba(239, 68, 68, 0.1);
  border-left: 4px solid var(--danger);
  margin: 16px 0;
}

/* ============================================ */
/* NAVIGATION - RESPONSIVE */
/* ============================================ */

@media (max-width: 992px) {
  .nav-left,
  .nav-right {
    gap: 4px;
  }
  
  .navbar .btn {
    padding: 8px 12px;
    font-size: 0.9rem;
  }
}

@media (max-width: 768px) {
  .navbar {
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .nav-left,
  .nav-right {
    flex: 0 0 100%;
    justify-content: center;
  }
  
  .navbar .btn {
    flex: 0 0 auto;
  }
}

/* ============================================ */
/* STYLES POUR L'IMPORT DE THÈMES */
/* À AJOUTER À LA FIN DE assets/styles.css */
/* ============================================ */

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

/* Zone de drag & drop */
.drop-zone {
  border: 3px dashed var(--border, #cbd5e1);
  border-radius: 12px;
  padding: 48px 24px;
  text-align: center;
  transition: all 0.3s ease;
  background: var(--bg-secondary, #f8fafc);
  cursor: pointer;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.drop-zone:hover {
  border-color: var(--accent, #06b6d4);
  background: var(--bg, #ffffff);
  transform: translateY(-2px);
}

.drop-zone.drag-over {
  border-color: var(--accent, #06b6d4);
  background: rgba(6, 182, 212, 0.1);
  transform: scale(1.02);
  box-shadow: 0 8px 16px rgba(6, 182, 212, 0.2);
}

.drop-zone-content {
  pointer-events: none;
  width: 100%;
}

.drop-icon {
  font-size: 4rem;
  margin-bottom: 16px;
  animation: float 3s ease-in-out infinite;
}

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

.drop-text {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0 0 12px 0;
  color: var(--text, #0f172a);
}

/* Prévisualisation du thème */
.theme-preview {
  margin-top: 24px;
  animation: slideIn 0.3s ease;
}

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

/* Erreurs de validation */
.validation-errors {
  margin-top: 24px;
  animation: slideIn 0.3s ease;
}

/* Bouton large */
.btn.large {
  padding: 16px 32px;
  font-size: 1.1rem;
  font-weight: 600;
  min-width: 200px;
}

/* Badge info pour thèmes personnalisés */
.badge.info {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 0.85rem;
}

/* Headers de vue améliorés */
.view-header {
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--border, #e2e8f0);
}

.view-header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  gap: 16px;
  flex-wrap: wrap;
}

.view-header h2 {
  margin: 0;
  flex: 1;
  font-size: 1.75rem;
}

/* Stats summary pour thèmes personnalisés */
.stats-summary {
  margin-bottom: 24px;
}

.stat-value {
  font-size: 2rem;
  font-weight: bold;
  color: var(--accent, #06b6d4);
  margin-bottom: 4px;
  line-height: 1;
}

/* Amélioration des cartes */
.card {
  animation: fadeInUp 0.4s ease forwards;
  opacity: 0;
}

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

/* Animation pour les badges */
.badge {
  transition: all 0.2s ease;
  display: inline-block;
}

.badge:hover {
  transform: translateY(-2px);
}

/* Styles pour les codes PRE */
pre {
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  line-height: 1.5;
  tab-size: 2;
  white-space: pre-wrap;
  word-wrap: break-word;
}

pre code {
  display: block;
  color: var(--text, #0f172a);
}

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

pre::-webkit-scrollbar-track {
  background: var(--bg-secondary, #f1f5f9);
  border-radius: 4px;
}

pre::-webkit-scrollbar-thumb {
  background: var(--border, #cbd5e1);
  border-radius: 4px;
}

pre::-webkit-scrollbar-thumb:hover {
  background: var(--accent, #06b6d4);
}

/* Styles pour les actions de thèmes */
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.actions .btn {
  flex: 1 1 auto;
  min-width: 120px;
}

/* Amélioration des meta tags */
.meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
}

.meta > span {
  display: inline-flex;
  align-items: center;
}

/* Messages d'info/warning/error */
.info-message {
  padding: 16px;
  border-radius: 8px;
  background: rgba(6, 182, 212, 0.1);
  border-left: 4px solid var(--accent, #06b6d4);
  margin: 16px 0;
}

.warning-message {
  padding: 16px;
  border-radius: 8px;
  background: rgba(245, 158, 11, 0.1);
  border-left: 4px solid #f59e0b;
  margin: 16px 0;
  color: #92400e;
}

.error-message {
  padding: 16px;
  border-radius: 8px;
  background: rgba(239, 68, 68, 0.1);
  border-left: 4px solid #ef4444;
  margin: 16px 0;
  color: #991b1b;
}

/* Dashboard stats pour thèmes personnalisés */
.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 16px;
  margin: 16px 0;
}

.dashboard-stat {
  text-align: center;
  padding: 12px;
  background: var(--bg-secondary, #f8fafc);
  border-radius: 8px;
}

.dashboard-stat .stat-label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted, #64748b);
  margin-bottom: 8px;
}

.dashboard-stat .stat-value {
  display: block;
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--accent, #06b6d4);
}

/* ============================================ */
/* FLASHCARDS - ANIMATION FLIP */
/* ============================================ */

.flashcard {
  perspective: 1000px;
  transition: transform 0.6s cubic-bezier(0.4, 0.0, 0.2, 1);
  transform-style: preserve-3d;
}

.flashcard.flipping {
  animation: flipCard 0.6s cubic-bezier(0.4, 0.0, 0.2, 1);
}

@keyframes flipCard {
  0% {
    transform: rotateY(0deg);
  }
  50% {
    transform: rotateY(90deg);
  }
  100% {
    transform: rotateY(0deg);
  }
}

.fc-face {
  backface-visibility: hidden;
  transform-style: preserve-3d;
}

/* ============================================ */
/* RESPONSIVE - MOBILE */
/* ============================================ */

@media (max-width: 768px) {
  .drop-zone {
    padding: 32px 16px;
    min-height: 150px;
  }
  
  .drop-icon {
    font-size: 3rem;
  }
  
  .drop-text {
    font-size: 1rem;
  }
  
  .btn.large {
    padding: 12px 24px;
    font-size: 1rem;
    width: 100%;
  }
  
  .view-header-content {
    flex-direction: column;
    align-items: stretch;
  }
  
  .view-header-content h2 {
    text-align: center;
    font-size: 1.5rem;
  }
  
  .stats-summary .card > div {
    flex-direction: column !important;
    gap: 16px !important;
  }
  
  .stat-value {
    font-size: 1.5rem;
  }
  
  .actions {
    flex-direction: column;
  }
  
  .actions .btn {
    width: 100%;
    min-width: unset;
  }
  
  .import-container {
    padding: 10px;
  }
}

@media (max-width: 576px) {
  .dashboard-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ============================================ */
/* DARK MODE SUPPORT */
/* ============================================ */

[data-theme="dark"] .drop-zone {
  background: rgba(15, 23, 42, 0.5);
  border-color: rgba(148, 163, 184, 0.3);
}

[data-theme="dark"] .drop-zone:hover {
  background: rgba(15, 23, 42, 0.8);
  border-color: var(--accent, #06b6d4);
}

[data-theme="dark"] .drop-zone.drag-over {
  background: rgba(6, 182, 212, 0.2);
}

[data-theme="dark"] .badge.info {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

[data-theme="dark"] pre {
  background: rgba(15, 23, 42, 0.8);
}

[data-theme="dark"] .dashboard-stat {
  background: rgba(15, 23, 42, 0.5);
}

[data-theme="dark"] .warning-message {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
}

[data-theme="dark"] .error-message {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
}

/* ============================================ */
/* VARIABLES CSS (si elles n'existent pas déjà) */
/* ============================================ */

:root {
  --accent: #06b6d4;
  --bg: #ffffff;
  --bg-secondary: #f8fafc;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --danger: #ef4444;
  --success: #10b981;
}

[data-theme="dark"] {
  --bg: #0f172a;
  --bg-secondary: #1e293b;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --border: #334155;
}