:root {
  --gradient-mod-1: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-mod-2: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
  --gradient-mod-3: linear-gradient(135deg, #f5af19 0%, #ec008c 100%);
  --gradient-mod-4: linear-gradient(135deg, #ec008c 0%, #9400d3 100%);
  --gradient-mod-5: linear-gradient(135deg, #f39c12 0%, #f67e22 100%);
  --gradient-mod-6: linear-gradient(135deg, #00d2fc 0%, #0066ff 100%);
  --gradient-mod-7: linear-gradient(135deg, #e74c3c 0%, #8b4513 100%);
  --gradient-mod-8: linear-gradient(135deg, #1abc9c 0%, #16a085 100%);
  --gradient-mod-9: linear-gradient(135deg, #9400d3 0%, #ff1493 100%);
  --text-dark: #2c3e50;
  --text-light: #ecf0f1;
  --bg-light: #f8f9fa;
  --bg-dark: #1a2332;
}

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

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg-light);
  color: var(--text-dark);
  line-height: 1.6;
}

/* Header */
.header {
  padding: 2rem;
  color: white;
  text-align: center;
  position: relative;
}

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

.header .meta {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.meta-chip {
  background: rgba(255,255,255,0.2);
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.9rem;
}

/* Bouton Accueil */
.btn-home {
  position: fixed;
  top: 20px;
  right: 20px;
  background: white;
  color: var(--text-dark);
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  z-index: 200;
  transition: transform 0.2s;
}

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

/* Navigation */
.nav-tabs {
  display: flex;
  gap: 0.5rem;
  padding: 1rem;
  background: white;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  overflow-x: auto;
}

.nav-btn {
  padding: 0.6rem 1rem;
  border: none;
  background: #e9ecef;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  font-size: 0.9rem;
}

.nav-btn:hover {
  background: #dee2e6;
}

.nav-btn.active {
  background: var(--text-dark);
  color: white;
}

/* Blocs */
.bloc {
  display: none;
  padding: 2rem;
  max-width: 900px;
  margin: 0 auto;
  animation: fadeIn 0.3s ease;
}

.bloc.active {
  display: block;
}

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

.bloc-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid #e9ecef;
}

.bloc-header h2 {
  color: var(--text-dark);
  margin-bottom: 0.3rem;
}

.bloc-header .duration {
  color: #6c757d;
  font-size: 0.9rem;
}

/* Contenu */
.bloc-content h3 {
  margin: 1.5rem 0 0.8rem;
  color: var(--text-dark);
}

.bloc-content ul, .bloc-content ol {
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}

.bloc-content li {
  margin-bottom: 0.4rem;
}

/* Callouts */
.callout {
  padding: 1rem 1.2rem;
  border-radius: 8px;
  margin: 1rem 0;
}

.callout.info {
  background: #e3f2fd;
  border-left: 4px solid #2196f3;
}

.callout.conseil {
  background: #ddf182;
  border-left: 4px solid #04dd77;
  border-right: 4px solid #04dd77;
}

.callout.warning {
  background: #fff3e0;
  border-left: 4px solid #ff9800;
}

.callout.success {
  background: #e8f5e9;
  border-left: 4px solid #4caf50;
}

.callout.danger {
  background: #ffebee;
  border-left: 4px solid #f44336;
}

/* Exercices */
.exercise-box {
  background: #f8f9fa;
  border: 2px solid #dee2e6;
  border-radius: 12px;
  padding: 1.5rem;
  margin: 1.5rem 0;
}

.exercise-box h4 {
  color: var(--text-dark);
  margin-bottom: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

thead {
  background: var(--text-dark);
  color: white;
}

th, td {
  padding: 0.8rem;
  text-align: left;
  border-bottom: 1px solid #dee2e6;
}

tbody tr:hover {
  background: #f8f9fa;
}

/* Footer */
.footer {
  background: var(--bg-dark);
  color: var(--text-light);
  text-align: center;
  padding: 1.5rem;
  margin-top: 2rem;
}

.footer p {
  color: #bdc3c7;
  font-size: 0.9rem;
}

/* Page d'accueil */
.home-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 3rem 2rem;
  color: white;
  text-align: center;
}

.modules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  padding: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.module-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  transition: transform 0.2s;
  text-decoration: none;
  color: var(--text-dark);
}

.module-card:hover {
  transform: translateY(-5px);
}

.card-header {
  padding: 1.5rem;
  color: white;
}

.card-header h3 {
  font-size: 1.2rem;
  margin-bottom: 0.3rem;
}

.card-header .mod-number {
  font-size: 0.85rem;
  opacity: 0.9;
}

.card-body {
  padding: 1.2rem;
}

.card-body .duration {
  color: #6c757d;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

/* Responsive */
@media (max-width: 768px) {
  .header h1 {
    font-size: 1.5rem;
  }
  
  .nav-tabs {
    padding: 0.5rem;
  }
  
  .nav-btn {
    padding: 0.5rem 0.8rem;
    font-size: 0.85rem;
  }
  
  .bloc {
    padding: 1rem;
  }
  
  .btn-home {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
  }
}

/* Boutons de navigation entre blocs et modules */
.bloc-nav {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-top: 30px;
  flex-wrap: wrap;
}

.btn-nav {
  padding: 12px 24px;
  border-radius: 25px;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
  transition: all 0.2s;
  border: 2px solid #11998e;
  cursor: pointer;
}

.btn-prev {
  color: #11998e;
  background: white;
}

.btn-prev:hover {
  background: #11998e;
  color: white;
}

.btn-next {
  background: linear-gradient(135deg, #11998e, #38ef7d);
  color: white;
  border: none;
}

.btn-next:hover {
  opacity: 0.88;
  transform: scale(1.03);
}
