/* =========================
   🎨 main.css — Styles principaux
   ========================= */

/* Reset CSS et variables globales */
:root {
  --primary: #2d6cdf;
  --secondary: #f5f6fa;
  --success: #2ecc71;
  --warning: #f39c12;
  --danger: #e74c3c;
  --dark: #222;
  --light: #fff;
  --font-main: 'Inter', Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  font-family: var(--font-main);
  background: var(--secondary);
  color: var(--dark);
  min-height: 100vh;
}

/* Layout principal */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1rem;
}
header, nav, main, footer {
  margin-bottom: 1.5rem;
}

/* Composants de base */
button, .btn {
  background: var(--primary);
  color: var(--light);
  border: none;
  border-radius: 4px;
  padding: 0.6em 1.2em;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s;
}
button:hover, .btn:hover {
  background: #174a8b;
}
input, textarea {
  border: 1px solid #ccc;
  border-radius: 3px;
  padding: 0.5em;
  font-size: 1em;
}

/* Système de progression */
.progression-bar {
  width: 100%;
  height: 12px;
  background: #e0e0e0;
  border-radius: 6px;
  overflow: hidden;
  margin: 1em 0;
}
.progression-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--primary), var(--success));
  border-radius: 6px;
  transition: width 0.5s;
  opacity: 0.8;
}

/* Animations et transitions */
.fade-in {
  animation: fadeIn 0.6s ease;
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* États de chargement et notifications */
#global-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh;
  background: rgba(0,0,0,0.7);
  z-index: 9999;
}
.loader-spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid var(--primary);
  border-radius: 50%;
  width: 40px; height: 40px;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
.notification {
  min-width: 200px;
  padding: 1em;
  border-radius: 5px;
  margin: 0.5em 0;
  font-weight: bold;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.notification-info { background: var(--primary); color: var(--light); }
.notification-success { background: var(--success); color: var(--light); }
.notification-warning { background: var(--warning); color: var(--dark); }
.notification-error { background: var(--danger); color: var(--light); }

/* Badges et indicateurs de difficulté */
.badge {
  display: inline-block;
  padding: 0.3em 0.7em;
  border-radius: 12px;
  font-size: 0.95em;
  background: var(--primary);
  color: var(--light);
  margin-right: 0.5em;
  font-weight: 600;
}
.badge.earned {
  background: var(--success);
  animation: badgeEarn 0.6s;
}
@keyframes badgeEarn {
  0% { transform: scale(1); }
  60% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

/* Mode sombre automatique */
@media (prefers-color-scheme: dark) {
  body { background: #181c24; color: #f5f6fa; }
  .container { background: #232a36; }
  button, .btn { background: #174a8b; }
  .progression-bar { background: #232a36; }
}

/* Classes utilitaires */
.text-center { text-align: center; }
.mt-2 { margin-top: 2rem; }
.mb-2 { margin-bottom: 2rem; }
.p-1 { padding: 1rem; }
