/* 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);
}

/* 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: 1400px;
  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;
}

/* Barre de progression de la page */
.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;
}

/* Content section */
.content-section {
  display: flex;
  flex-direction: column;
  gap: 50px;
}

/* Zone PDF améliorée */
.pdf-zone {
  background: var(--card-background);
  border-radius: 20px;
  padding: 30px;
  box-shadow: var(--shadow-light);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

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

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

.btn-pdf-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-pdf-download:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 123, 0, 0.4);
}

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

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

/* QCM Section */
.qcm-section {
  background: var(--card-background);
  border-radius: 20px;
  padding: 40px;
  box-shadow: var(--shadow-light);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.qcm-header {
  text-align: center;
  margin-bottom: 40px;
}

.qcm-header h2 {
  font-size: 2.2rem;
  color: var(--text-primary);
  margin-bottom: 10px;
  font-weight: 700;
}

.qcm-header p {
  font-size: 1.1rem;
  color: var(--text-secondary);
}

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

/* Questions */
.question-card {
  background: white;
  border-radius: 15px;
  padding: 25px;
  margin-bottom: 25px;
  box-shadow: var(--shadow-light);
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.question-card.correct {
  border-color: #4CAF50;
  background: linear-gradient(145deg, #f8fff8, #e8f5e8);
}

.question-card.incorrect {
  border-color: #f44336;
  background: linear-gradient(145deg, #fff8f8, #ffe8e8);
}

.question-card h3 {
  color: var(--primary-orange);
  font-size: 1.3rem;
  margin-bottom: 15px;
  font-weight: 600;
}

.question-card p {
  font-size: 1.1rem;
  color: var(--text-primary);
  margin-bottom: 20px;
  font-weight: 500;
}

/* Options */
.options {
  display: grid;
  gap: 12px;
}

.option {
  display: flex;
  align-items: center;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.option:hover {
  background: #e9ecef;
  transform: translateX(5px);
}

.option input[type="radio"] {
  margin-right: 12px;
  accent-color: var(--primary-orange);
  transform: scale(1.2);
}

.option-text {
  font-size: 1rem;
  color: var(--text-primary);
  font-weight: 500;
}

/* Actions du QCM */
.qcm-actions {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin: 40px 0;
  flex-wrap: wrap;
}

.btn-check, .btn-reset {
  padding: 15px 30px;
  border: none;
  border-radius: 12px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: 'Poppins', sans-serif;
}

.btn-check {
  background: linear-gradient(135deg, var(--primary-orange), #ff9500);
  color: white;
  box-shadow: 0 4px 15px rgba(255, 123, 0, 0.3);
}

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

.btn-reset {
  background: #6c757d;
  color: white;
  box-shadow: 0 4px 15px rgba(108, 117, 125, 0.3);
}

.btn-reset:hover {
  background: #5a6268;
  transform: translateY(-2px);
}

/* Résultats */
.results-container {
  margin-top: 30px;
}

.score-summary {
  text-align: center;
  padding: 25px;
  border-radius: 15px;
  margin-bottom: 30px;
  font-size: 1.2rem;
}

.score-summary.good {
  background: linear-gradient(145deg, #d4edda, #c3e6cb);
  color: #155724;
  border: 2px solid #4CAF50;
}

.score-summary.needs-work {
  background: linear-gradient(145deg, #f8d7da, #f5c6cb);
  color: #721c24;
  border: 2px solid #f44336;
}

.result-item {
  background: white;
  padding: 20px;
  border-radius: 12px;
  margin-bottom: 15px;
  box-shadow: var(--shadow-light);
  border-left: 4px solid #ddd;
}

.result-item.correct {
  border-left-color: #4CAF50;
  background: linear-gradient(145deg, #f8fff8, #f0f8f0);
}

.result-item.incorrect {
  border-left-color: #f44336;
  background: linear-gradient(145deg, #fff8f8, #f8f0f0);
}

.result-item.unanswered {
  border-left-color: #ffc107;
  background: linear-gradient(145deg, #fffbf0, #fdf6e3);
}

/* Responsive Design */
@media (max-width: 768px) {
  .cours-main {
    padding: 15px;
  }
  
  .hero-content h1 {
    font-size: 2.2rem;
  }
  
  .qcm-section, .pdf-zone {
    padding: 25px;
  }
  
  .question-card {
    padding: 20px;
  }
  
  .pdf-iframe {
    height: 400px;
  }
  
  .pdf-header {
    flex-direction: column;
    text-align: center;
  }
  
  .qcm-actions {
    flex-direction: column;
    align-items: center;
  }
  
  .btn-check, .btn-reset {
    width: 100%;
    max-width: 250px;
  }
}

@media (max-width: 480px) {
  .hero-content h1 {
    font-size: 1.8rem;
  }
  
  .qcm-header h2 {
    font-size: 1.8rem;
  }
  
  .question-card {
    padding: 15px;
  }
  
  .option {
    padding: 12px;
  }
}