/* Variables CSS */
:root {
  --primary-orange: #ff7b00;
  --secondary-yellow: #ffe066;
  --background-gradient: linear-gradient(to bottom, #ffffff 0%, #ffeeaa 30%, #ffeeaa 70%, #ffffff 100%);
  --card-background: linear-gradient(145deg, hsl(46, 100%, 89%), #fff8cf);
  --text-primary: #222;
  --text-secondary: #555;
  --shadow-light: 0 4px 20px rgba(0, 0, 0, 0.08);
  --shadow-medium: 0 8px 25px rgba(0, 0, 0, 0.15);
  --success-color: #4CAF50;
  --warning-color: #ff9800;
}

/* Reset et base */
*, *::before, *::after {
  box-sizing: border-box;
}

body {
  font-family: 'Poppins', sans-serif;
  background: var(--background-gradient);
  color: var(--text-primary);
  margin: 0;
  padding: 0;
  line-height: 1.6;
}

/* Main content */
.cours-main {
  max-width: 1600px;
  margin: 0 auto;
  padding: 20px;
}

/* Hero section */
.hero-section {
  text-align: center;
  padding: 40px 20px;
  margin-bottom: 40px;
}

.hero-content h1 {
  font-size: 3rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 15px;
  background: linear-gradient(135deg, var(--primary-orange), #ff9500);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.cours-sous-titre {
  font-size: 1.2rem;
  color: var(--text-secondary);
  margin-bottom: 30px;
}

/* Progress info */
.progress-info {
  max-width: 400px;
  margin: 0 auto;
}

.progress-container-page {
  position: relative;
  margin-bottom: 10px;
}

.progress-bar-page {
  width: 100%;
  height: 10px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 15px;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-fill-page {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-orange), #ff9500);
  border-radius: 15px;
  width: 0%;
  transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-text-page {
  font-size: 0.9rem;
  color: var(--primary-orange);
  font-weight: 600;
}

/* Layout principal */
.content-section {
  display: flex;
  gap: 30px;
  margin-top: 40px;
}

/* Zone des exercices (côté gauche) */
.exercises-zone {
  flex: 1;
  background: var(--card-background);
  border-radius: 20px;
  padding: 30px;
  box-shadow: var(--shadow-light);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.exercises-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 15px;
}

.exercises-header h3 {
  margin: 0;
  font-size: 1.5rem;
  color: var(--text-primary);
  font-weight: 600;
}

.btn-download {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--primary-orange), #ff9500);
  color: white;
  padding: 12px 24px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  box-shadow: 0 4px 15px rgba(255, 123, 0, 0.3);
  transition: all 0.3s ease;
}

.btn-download:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 123, 0, 0.4);
}

.exercises-container {
  background: white;
  border-radius: 15px;
  padding: 20px;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.05);
}

.exercises-iframe {
  width: 100%;
  height: 700px;
  border: none;
  border-radius: 10px;
}

/* Zone des corrections (côté droit) */
.corrections-zone {
  flex: 1;
  background: var(--card-background);
  border-radius: 20px;
  padding: 30px;
  box-shadow: var(--shadow-light);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.corrections-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 15px;
}

.corrections-header h3 {
  margin: 0;
  font-size: 1.5rem;
  color: var(--text-primary);
  font-weight: 600;
}

/* Toggle pour afficher/masquer les corrections */
.corrections-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.toggle-switch {
  position: relative;
  width: 60px;
  height: 30px;
  background: #ccc;
  border-radius: 15px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.toggle-switch.active {
  background: var(--success-color);
}

.toggle-slider {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  background: white;
  border-radius: 50%;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch.active .toggle-slider {
  transform: translateX(30px);
}

.toggle-label {
  font-weight: 600;
  color: var(--text-primary);
}

/* Conteneur des corrections */
.corrections-container {
  background: white;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.05);
  transition: all 0.5s ease;
  max-height: 0;
  opacity: 0;
}

.corrections-container.visible {
  max-height: 700px;
  opacity: 1;
  padding: 20px;
}

.corrections-iframe {
  width: 100%;
  height: 660px;
  border: none;
  border-radius: 10px;
}

/* Message quand corrections masquées */
.corrections-hidden-message {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-secondary);
  font-size: 1.1rem;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 15px;
  border: 2px dashed #ddd;
}

.corrections-hidden-message.hidden {
  display: none;
}

/* Responsive Design */
@media (max-width: 1200px) {
  .content-section {
    flex-direction: column;
  }
  
  .exercises-zone,
  .corrections-zone {
    flex: none;
  }
}

@media (max-width: 768px) {
  .cours-main {
    padding: 15px;
  }
  
  .hero-content h1 {
    font-size: 2.2rem;
  }
  
  .exercises-zone,
  .corrections-zone {
    padding: 25px;
  }
  
  .exercises-header,
  .corrections-header {
    flex-direction: column;
    text-align: center;
  }
  
  .exercises-iframe,
  .corrections-iframe {
    height: 500px;
  }
  
  .corrections-container.visible {
    max-height: 520px;
  }
}

@media (max-width: 480px) {
  .hero-content h1 {
    font-size: 1.8rem;
  }
  
  .exercises-zone,
  .corrections-zone {
    padding: 20px;
  }
  
  .exercises-iframe,
  .corrections-iframe {
    height: 400px;
  }
  
  .corrections-container.visible {
    max-height: 420px;
  }
}