/* Reset box-sizing pour tout le site */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* ----------- MAIN ----------- */
/* Remplacement de .maths- par .physique- */
.physique-main {
  max-width: 1300px;
  margin: 0 auto;
  padding: 40px 0 40px 0;
}

.physique-main h1 {
  text-align: center;
  font-size: 2.8rem;
  font-weight: 700;
  margin-top: 18px;
  margin-bottom: 12px;
  letter-spacing: 0.5px;
  background: black;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 2px 4px rgba(141, 141, 141, 0.3);
}

.physique-subtitle {
  text-align: center;
  font-size: 1.25rem;
  color: #555;
  margin-bottom: 38px;
  font-weight: 500;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.4;
}

/* STYLES POUR LES FILTRES (identiques, mais couleurs changées) */
.filter-container {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-bottom: 40px;
  flex-wrap: wrap;
  padding: 0 20px;
}

.filter-btn {
  padding: 10px 24px;
  font-size: 1rem;
  font-weight: 600;
  color: #555;
  background: #ffffff;
  border: 2px solid #ddd;
  border-radius: 25px;
  /* Boutons en "pilule" */
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.filter-btn:hover {
  background: #f9f9f9;
  border-color: #ccc;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Couleur "active" par défaut (pour "Tous") */
.filter-btn.active {
  background: #ff7b00;
  color: white;
  border-color: #ff7b00;
  box-shadow: 0 4px 15px rgba(255, 123, 0, 0.3);
  transform: translateY(-2px);
}

/* NOUVELLES Couleurs actives spécifiques PHYSIQUE */
.filter-btn[data-filter="mecanique"].active {
  background: #D32F2F;
  /* Rouge */
  border-color: #D32F2F;
  box-shadow: 0 4px 15px rgba(211, 47, 47, 0.3);
}

.filter-btn[data-filter="ondes"].active {
  background: #0288D1;
  /* Bleu */
  border-color: #0288D1;
  box-shadow: 0 4px 15px rgba(2, 136, 209, 0.3);
}

.filter-btn[data-filter="energie"].active {
  background: #4CAF50;
  /* Vert */
  border-color: #4CAF50;
  box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

/* FIN DES NOUVEAUX STYLES DE FILTRES */


/* Grid des cours (identique) */
.cours-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 2fr));
  gap: 30px;
  margin-top: 40px;
  padding: 0 20px;
}

/* Cartes individuelles (identique) */
.cours-card {
  background: linear-gradient(145deg, hsl(46, 100%, 89%), #fff8cf);
  /* COULEUR PAR DÉFAUT */
  border-radius: 16px;
  padding: 25px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  flex-direction: column;
  min-height: 200px;
  /* Hauteur minimum */
  height: auto;
  /* Hauteur automatique pour l'accordéon */
}

/* Styles de barre de progression (conservés du fichier maths) */
.progress-container {
  margin-bottom: 15px;
  position: relative;
  z-index: 2;
}

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

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #ff7b00, #ff9500, #ffab00);
  border-radius: 15px;
  width: 0%;
  transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg,
      transparent,
      rgba(255, 255, 255, 0.4),
      transparent);
  animation: progressShine 2s ease-in-out infinite;
}

.progress-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.75rem;
  font-weight: 700;
  color: #333;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
  z-index: 3;
  pointer-events: none;
}

@keyframes progressShine {
  0% {
    left: -100%;
  }

  50% {
    left: 100%;
  }

  100% {
    left: 100%;
  }
}

/* Fin des styles de barre de progression */


.cours-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg,
      transparent,
      rgba(255, 255, 255, 0.3),
      transparent);
  transition: left 0.6s ease;
  z-index: 1;
}

.cours-card:hover::before {
  left: 100%;
}

.cours-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
  border-color: rgba(255, 123, 0, 0.3);
}

/* Styles de la carte (identiques) */
.cours-card-header {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 15px;
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  min-height: 60px;
  /* Hauteur minimum pour éviter les variations */
  cursor: pointer;
  user-select: none;
}

.cours-card-arrow {
  margin-left: auto;
  font-size: 1.2rem;
  color: #ff7b00;
  /* Couleur par défaut */
  transition: transform 0.3s ease;
  font-weight: bold;
}

.cours-card-arrow.expanded {
  transform: rotate(180deg);
}

.cours-icon {
  font-size: 2.5rem;
  font-weight: bold;
  color: #ff7b00;
  /* Couleur par défaut */
  text-shadow: 0 2px 4px rgba(255, 123, 0, 0.3);
  transition: transform 0.3s ease;
  flex-shrink: 0;
}

.cours-card:hover .cours-icon {
  transform: scale(1.1) rotate(5deg);
}

.cours-card-titre {
  font-size: 1.3rem;
  font-weight: 700;
  color: #2c3e50;
  margin: 0;
  line-height: 1.2;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
  flex: 1;
}

/* Styles accordéon (identiques) */
.cours-card-desc {
  color: #666;
  font-size: 0.95rem;
  line-height: 1.4;
  margin-bottom: 20px;
  position: relative;
  z-index: 2;
  flex-grow: 1;
  /* Prend tout l'espace disponible */
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.cours-card-desc.expanded {
  max-height: 200px;
  /* Hauteur max quand déroulé */
  opacity: 1;
  margin-bottom: 20px;
}

/* Styles actions/boutons (identiques) */
.cours-card-actions {
  display: flex;
  gap: 12px;
  position: relative;
  z-index: 2;
  margin-top: auto;
  /* Pousse les boutons vers le bas */
  flex-shrink: 0;
}

.btn-cours {
  flex: 1;
  padding: 12px 16px;
  background: linear-gradient(135deg, #ff7b00, #ff9500);
  /* Couleur par défaut */
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  text-align: center;
  box-shadow: 0 2px 8px rgba(255, 123, 0, 0.3);
}

.btn-cours:hover {
  background: linear-gradient(135deg, #ff6600, #ff8800);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(255, 123, 0, 0.4);
}

.btn-cours:active {
  transform: translateY(0);
}

/* NOUVEAUX STYLES POUR LES COULEURS DE CATÉGORIES PHYSIQUE */
.cours-card[data-category="mecanique"] {
  background: linear-gradient(145deg, hsl(5, 70%, 90%), #ffebec);
}

.cours-card[data-category="mecanique"] .cours-icon,
.cours-card[data-category="mecanique"] .cours-card-arrow {
  color: #D32F2F;
}

.cours-card[data-category="mecanique"] .btn-cours {
  background: linear-gradient(135deg, #D32F2F, #F44336);
  box-shadow: 0 2px 8px rgba(211, 47, 47, 0.3);
}

.cours-card[data-category="mecanique"] .btn-cours:hover {
  background: linear-gradient(135deg, #C62828, #E53935);
  box-shadow: 0 4px 15px rgba(211, 47, 47, 0.4);
}


.cours-card[data-category="ondes"] {
  background: linear-gradient(145deg, hsl(200, 80%, 90%), #e1f5fe);
}

.cours-card[data-category="ondes"] .cours-icon,
.cours-card[data-category="ondes"] .cours-card-arrow {
  color: #0288D1;
}

.cours-card[data-category="ondes"] .btn-cours {
  background: linear-gradient(135deg, #0288D1, #03A9F4);
  box-shadow: 0 2px 8px rgba(2, 136, 209, 0.3);
}

.cours-card[data-category="ondes"] .btn-cours:hover {
  background: linear-gradient(135deg, #0277BD, #039BE5);
  box-shadow: 0 4px 15px rgba(2, 136, 209, 0.4);
}


.cours-card[data-category="energie"] {
  background: linear-gradient(145deg, hsl(120, 60%, 90%), #e8f5e9);
}

.cours-card[data-category="energie"] .cours-icon,
.cours-card[data-category="energie"] .cours-card-arrow {
  color: #4CAF50;
}

.cours-card[data-category="energie"] .btn-cours {
  background: linear-gradient(135deg, #4CAF50, #66bb6a);
  box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

.cours-card[data-category="energie"] .btn-cours:hover {
  background: linear-gradient(135deg, #43a047, #5cb860);
  box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4);
}

/* FIN DES NOUVEAUX STYLES DE COULEURS */

/* =============================================================
  == RÈGLE POUR GRISER LES BOUTONS NON DISPONIBLES (identique) ==
  =============================================================
*/
.cours-card button.btn-cours {
  background: linear-gradient(135deg, #b0b0b0, #c5c5c5) !important;
  /* Fond gris */
  color: #f0f0f0 !important;
  /* Texte gris clair */
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1) !important;
  /* Ombre neutre */
  cursor: not-allowed;
  opacity: 0.7;
}

/* Annule l'effet de survol pour les boutons grisés (identique) */
.cours-card button.btn-cours:hover {
  background: linear-gradient(135deg, #b0b0b0, #c5c5c5) !important;
  transform: translateY(0);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1) !important;
}

/* ============================================================= */


/* Animation au chargement (identique) */
.cours-card {
  opacity: 0;
  animation: fadeInUp 0.6s ease forwards;
}

.cours-card:nth-child(1) {
  animation-delay: 0.1s;
}

.cours-card:nth-child(2) {
  animation-delay: 0.2s;
}

.cours-card:nth-child(3) {
  animation-delay: 0.3s;
}

.cours-card:nth-child(4) {
  animation-delay: 0.4s;
}

.cours-card:nth-child(5) {
  animation-delay: 0.5s;
}

.cours-card:nth-child(6) {
  animation-delay: 0.6s;
}

.cours-card:nth-child(7) {
  animation-delay: 0.7s;
}

.cours-card:nth-child(8) {
  animation-delay: 0.8s;
}

.cours-card:nth-child(9) {
  animation-delay: 0.9s;
}

.cours-card:nth-child(10) {
  animation-delay: 1.0s;
}

.cours-card:nth-child(11) {
  animation-delay: 1.1s;
}

.cours-card:nth-child(12) {
  animation-delay: 1.2s;
}

.cours-card:nth-child(13) {
  animation-delay: 1.3s;
}

.cours-card:nth-child(14) {
  animation-delay: 1.4s;
}

.cours-card:nth-child(15) {
  animation-delay: 1.5s;
}

.cours-card:nth-child(16) {
  animation-delay: 1.6s;
}

/* (Vous avez 16 chapitres, donc les délais s'arrêtent ici) */

/* Désactive les animations après le premier filtre (identique) */
.filtering-active .cours-card {
  opacity: 1;
  /* Assure la visibilité immédiate */
  animation: none;
  /* Supprime l'animation fadeInUp */
}

.filtering-active .cours-card:nth-child(n) {
  animation-delay: 0s;
  /* Supprime tous les délais */
}

/* FIN DE LA MODIFICATION */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive (identique) */
@media (max-width: 768px) {
  .physique-main h1 {
    font-size: 2rem;
    margin-top: 10px;
    margin-bottom: 8px;
  }

  .physique-subtitle {
    font-size: 0.9rem;
    margin-bottom: 20px;
    padding: 0 10px;
  }

  .filter-container {
    gap: 8px;
    margin-bottom: 25px;
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: flex-start;
    padding: 5px 15px;
    -webkit-overflow-scrolling: touch;
    /* Hide scrollbar for cleaner look */
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .filter-container::-webkit-scrollbar {
    display: none;
  }

  .filter-btn {
    padding: 6px 12px;
    font-size: 0.8rem;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .cours-grid {
    grid-template-columns: 1fr;
    gap: 25px;
    padding: 0 15px;
  }

  .cours-card {
    padding: 25px 20px;
    min-height: auto;
    /* Hauteur minimum sur mobile */
    height: auto;
    display: flex;
    flex-direction: column;
  }

  .cours-card-header {
    margin-bottom: 15px;
    pointer-events: none;
  }

  .cours-card-titre {
    font-size: 1.3rem;
  }

  .cours-icon {
    font-size: 2.2rem;
  }

  /* Hide arrow */
  .cours-card-arrow {
    display: none !important;
  }

  .btn-cours {
    padding: 12px 16px;
    font-size: 0.95rem;
  }

  .progress-container {
    margin-bottom: 15px;
  }

  .progress-bar {
    height: 10px;
  }

  .progress-text {
    font-size: 0.75rem;
  }

  /* Force description visible */
  .cours-card-desc {
    font-size: 0.95rem;
    line-height: 1.5;
    max-height: none !important;
    opacity: 1 !important;
    overflow: visible !important;
    margin-bottom: 25px;
    display: block !important;
    -webkit-line-clamp: unset;
    line-clamp: unset;
  }

  /* Rétablit le comportement de l'accordéon sur mobile - NON, on veut tout voir */
  .cours-card-desc.expanded {
    max-height: none;
  }
}

@media (min-width: 1300px) {
  .cours-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1800px) {
  .cours-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}


body {
  font-family: 'Poppins', sans-serif;
  color: #333;
  text-align: center;
  margin: 0;
  padding: 0;
  background: #fff2beff;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}


.site-footer {
  flex-shrink: 0;
}

.main-content-wrapper {
  flex-grow: 1;
}