/* home.css — Style de la page d'accueil élégante */
:root {
  --primary: #1e3a8a;
  --primary-light: #3b82f6;
  --secondary: #059669;
  --danger: #dc2626;
  --warning: #d97706;
  --accent: #7c3aed;
  --light: #f3f4f6;
  --dark: #1f2937;
  --darker: #111827;
  --card: #ffffff;
  --border: #e5e7eb;
  --shadow: rgba(0, 0, 0, 0.08);
  --shadow-lg: rgba(0, 0, 0, 0.12);
}

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

body {
  font-family: 'Segoe UI', 'Roboto', sans-serif;
  background: linear-gradient(165deg, #f5f7fa 0%, #e8f0fe 100%);
  color: var(--darker);
  min-height: 100vh;
}

/* ===== Hero ===== */
.hero {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  padding: 3rem 1.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNjAiIGhlaWdodD0iNjAiIHZpZXdCb3g9IjAgMCA2MCA2MCI+PGcgb3BhY2l0eT0iMC4xIj48Y2lyY2xlIGN4PSIzMCIgY3k9IjMwIiByPSI0IiBmaWxsPSIiLz48L2c+PC9zdmc+');
  opacity: 0.15;
  background-size: 30px 30px;
}
.hero h1 {
  font-size: 2.2rem;
  position: relative;
  z-index: 1;
  text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.hero .subtitle {
  font-size: 1.05rem;
  opacity: 0.9;
  margin-top: 0.5rem;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
  position: relative;
  z-index: 1;
}

/* ===== Container ===== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

/* ===== Matière ===== */
.matiere-section {
  margin-bottom: 2.5rem;
}
.matiere-title {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--primary-light);
}
.matiere-title h2 {
  font-size: 1.6rem;
  color: var(--primary);
}
.matiere-title .count {
  background: var(--primary-light);
  color: #fff;
  font-size: 0.85rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
}
.matiere-title .icon {
  font-size: 1.4rem;
}

/* ===== Grille de leçons ===== */
.lecon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}

.lecon-card {
  background: var(--card);
  border-radius: 14px;
  padding: 1.5rem;
  box-shadow: 0 4px 6px var(--shadow);
  border: 1px solid var(--border);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}
.lecon-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px var(--shadow-lg);
  border-color: var(--primary-light);
}

.lecon-card .card-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}
.lecon-card .num-badge {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  font-size: 1.5rem;
  font-weight: 800;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.lecon-card .card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--darker);
  flex: 1;
}

.lecon-card .version-selector {
  margin: 1rem 0;
}
.lecon-card .version-selector label {
  font-size: 0.85rem;
  color: #6b7280;
  margin-right: 0.5rem;
}
.lecon-card select {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.9rem;
  background: #f9fafb;
}

.lecon-card .test-buttons {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.5rem;
  margin-top: 1rem;
}
.lecon-card .test-btn {
  padding: 0.55rem 0.3rem;
  font-size: 0.8rem;
  border-radius: 6px;
  border: none;
  background: var(--primary-light);
  color: #fff;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 600;
}
.lecon-card .test-btn:hover {
  background: var(--primary);
  transform: scale(1.05);
}
.lecon-card .test-btn.active {
  background: var(--primary);
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--primary-light);
}

.lecon-card .quick-link {
  margin-top: 0.75rem;
  text-align: center;
}
.lecon-card .quick-link a {
  color: var(--secondary);
  font-size: 0.85rem;
  text-decoration: none;
  font-weight: 500;
}
.lecon-card .quick-link a:hover { text-decoration: underline; }

/* ===== Badges version ===== */
.version-short { background: #dcfce7; color: #166534; }
.version-std   { background: #dbeafe; color: #1e40af; }
.version-long  { background: #fee2e2; color: #991b1b; }

/* ===== Footer ===== */
footer {
  text-align: center;
  padding: 2rem;
  color: #6b7280;
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
  margin-top: 2rem;
}

@media (max-width: 600px) {
  .hero h1 { font-size: 1.6rem; }
  .lecon-card .test-buttons { grid-template-columns: repeat(5, 1fr); }
}
