/* ==========================================
   2. EN-TÊTE ET NAVIGATION (Desktop & Mobile)
   ========================================== */
.header {
  position: sticky;
  top: 0;
  width: 100%;
  height: 70px; /* Hauteur fixe pour un centrage vertical parfait */
  z-index: 1000;
  background: linear-gradient(90deg, #1e3c72, #2a5298);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center; /* Alignement vertical propre */
  width: 100%;
  max-width: 1200px;
  height: 100%; /* S'assure de prendre toute la hauteur de l'en-tête */
  margin: 0 auto;
  padding: 0 20px;
  box-sizing: border-box;
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-weight: 800;
  font-size: 18px;
  text-decoration: none;
  line-height: 1;
  margin-right: auto; /* Pousse fermement le logo vers l'extrême gauche */
}

.logo-link img {
  height: 40px;
  width: auto;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.logo-link:hover img {
  transform: scale(1.1) rotate(-5deg);
}

#menu {
  list-style: none;
  display: flex;
  align-items: center; /* Centre les liens sur la même ligne */
  gap: 6px; /* Espacement réduit pour éviter les débordements */
  margin: 0;
  padding: 0;
  height: 100%;
}

#menu li {
  display: flex;
  align-items: center;
  height: 100%;
}

#menu li a {
  color: #fff;
  font-weight: 600;
  font-size: 13px; /* Taille de police adaptée au nombre élevé de liens */
  padding: 6px 10px;
  border-radius: 6px;
  text-decoration: none;
  white-space: nowrap; /* Empêche le texte du lien de se couper */
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
}

#menu li a:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffcc00;
}

.menu-toggle, .menu-close-btn {
  display: none;
}

/* Overlay sombre (Correction) */
.menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;  /* Préférable à width: 100vw */
  bottom: 0; /* Préférable à height: 100vh */
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 998;
}
.menu-overlay.show {
  opacity: 1;
  visibility: visible;
}

/* Navigation Responsive Mobile & Tablettes */
@media (max-width: 1080px) {
  .menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    font-size: 24px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    cursor: pointer;
    color: #fff;
  }

  #menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 300px;
    height: 100vh;
    background: rgba(15, 23, 42, 0.98);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    flex-direction: column;
    align-items: flex-start;
    padding: 60px 18px 30px 18px;
    gap: 10px;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
    transition: right 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 999;
    overflow-y: auto; /* Permet de scroller verticalement si le menu est plus long que l'écran */
  }

  #menu.show {
    right: 0;
  }

  .menu-close-btn {
    display: block;
    align-self: flex-end;
    font-size: 28px;
    color: #94a3b8;
    cursor: pointer;
    padding: 0 10px;
    margin-bottom: 10px;
  }

  #menu li {
    width: 100%;
    height: auto;
  }

  #menu li a {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 12px 14px;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
  }

  /* Correction de l'URL du bouton S'inscrire */
  #menu li a[href*="inscription"] {
    background: linear-gradient(135deg, #ffcc00, #ff9900);
    color: #0f172a;
    font-weight: 700;
  }
}
/* Style du sous-menu déroulant */
.dropdown-details {
  position: relative;
  width: 100%;
}

.dropdown-trigger {
  cursor: pointer;
  list-style: none;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
}

/* Flèche pour indiquer le sous-menu */
.dropdown-trigger::after {
  content: " ▾";
  font-size: 12px;
  margin-left: 6px;
  transition: transform 0.2s ease;
}

.dropdown-details[open] .dropdown-trigger::after {
  transform: rotate(180deg);
}

/* Liste du sous-menu */
.dropdown-menu {
  list-style: none;
  padding-left: 15px;
  margin: 5px 0;
}

.dropdown-menu li a {
  padding: 6px 12px;
  display: block;
  font-size: 0.95em;
  opacity: 0.9;
}

/* Style spécifique Desktop (si le menu s'affiche à plat sur grand écran) */
@media (min-width: 1081px) {
  .has-dropdown {
    position: relative;
  }
  
  .dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: #17212c; /* Ajuster à la couleur de votre header */
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-radius: 8px;
    padding: 8px 0;
    min-width: 200px;
    z-index: 1000;
  }

  .dropdown-menu li a {
    padding: 8px 16px;
    white-space: nowrap;
  }
}