/* Reset et style de base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Poppins', sans-serif;
}

body {
  background-image: url("../assets/avi.jpg");
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
  color: #333;
}

/* Navigation */
nav {
  background: rgba(255, 255, 255, 0.2);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
  width: 100%;
  /* Changé de 100% à 100vw */
  position: sticky;
  top: 0;
  z-index: 1000;
  margin: 0; /* Ajout de margin 0 */
  padding: 0; /* Ajout de padding 0 */
  left: 0; /* Ajout de left 0 */
}

.nav__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  width: 100%; /* Ajout de width 100% */
  margin: 0 auto; /* Centrage horizontal */
}

.nav__header {
  display: flex;
  align-items: center;
}

/* Logo */
.logo {
  font-weight: bold;
  font-size: 1.7rem;
  color: #fff;
  display: flex;
  align-items: center;
}

.logo div {
  font-size: 1.8rem;
  color: #ffde59;
  margin-right: 0.5rem;
  font-family: 'Montserrat', sans-serif;
}

.logo span {
  font-size: 0.85rem;
  line-height: 1.1;
  color: #012475;
}

/* Menu Bouton (mobile) */
.nav__menu__btn {
  display: none;
  font-size: 1.8rem;
  color: #fff;
  cursor: pointer;
}

/* Liens de Navigation */
.nav__links {
  list-style: none;
  display: flex;
  gap: 2rem;
  align-items: center;
  justify-content: flex-end;
  margin-top: 12.5px;
  margin-left: auto; /* Pushes the links to the right */
}

.nav__links a {
  color: #012475;
  font-size: 1rem;
  font-weight: bold;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  padding: 0.5rem;
  transition: color 0.3s ease, transform 0.3s ease;
}

.nav__links a:hover {
  color: #ffde59;
}

.nav__links a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -5px;
  width: 0;
  height: 3px;
  background-color: #ffde59;
  transition: width 0.3s ease;
}

.nav__links a:hover::after {
  width: 100%;
}

/* Align navbar elements to the right */
.nav__links--right {
  margin-left: auto; /* Permet de pousser les éléments vers la droite */
  display: flex;
  justify-content: flex-end;
  gap: 2rem; /* Espacement entre les liens */
}

/* Remove or comment out this class as it's adding unnecessary padding */
/* .nav__with__padding {
  padding-right: 70px;
} */

/* Dropdown Menu */
.nav__item {
  position: relative;
  padding-left: 15px;
}

.dropdown__menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.8);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 10;
  list-style: none;
  margin-top: 13px;
  padding-bottom: 5px;
  padding-top: 5px; /* Adjust the value as needed */
}

/* Important: display block est maintenant géré par JS */
.dropdown__menu.show {
  display: block;
}

.dropdown__menu li {
  width: 260px; /* Adaptation à la largeur du contenu parent */
  box-sizing: border-box; /* Évite que le padding dépasse les limites */
  display: block; /* Assure que les éléments s'affichent en bloc */
  padding: 0.3rem 0.5rem; /* Plus d'espace pour un confort visuel */
  text-align: left;
}

.dropdown__menu a {
  color: #012475;
  text-decoration: none;
  display: block;
  padding: 1rem 1rem;
  font-weight: 400;
}

.dropdown__menu a:hover {
  background-color: #ffde59;
  color: #333;
  border-radius: 8px;
}

.nav__item:hover .dropdown__menu {
  display: block;
}

/* Ensure dropdown menu stays visible on hover */
.nav__item:hover .dropdown__menu,
.nav__item .dropdown__menu:hover {
  display: block;
  transition-delay: 10.5s; /* Increase delay before hiding */
}

/* le background de celui de connexion */

/* Mobile */
@media (max-width: 768px) {
  .nav__menu__btn {
    display: block;
  }

  .nav__links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #6a11cb;
    flex-direction: column;
    align-items: center;
    padding: 1rem 0;
    display: none;
  }

  .nav__links li {
    margin: 0.5rem 0;
  }

  .nav__links.show {
    display: flex;
  }

  .nav__item:hover .dropdown__menu {
    display: none;
  }

  .nav__item.active .dropdown__menu {
    display: block;
  }
}

/* Burger Menu Styles */
.burger {
  display: none;
  flex-direction: column;
  justify-content: space-around;
  width: 30px;
  height: 25px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 1001;
}

.burger span {
  width: 30px;
  height: 3px;
  background: #012475; /* Couleur bleue comme les liens */
  border-radius: 10px;
  transition: all 0.3s linear;
  position: relative;
  transform-origin: 1px;
}

/* Animation du burger */
.burger.toggle span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.burger.toggle span:nth-child(2) {
  opacity: 0;
}

.burger.toggle span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

@media (max-width: 768px) {
  .burger {
    display: flex;
    position: absolute;
    right: 2rem;
    top: 1.5rem;
    z-index: 1002;
  }

  /* Style unifié pour nav__links */
  .nav__links {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    margin: 0; /* Ajout de margin 0 */
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 80px 1rem 20px; /* Ajusté de 90px à 80px */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: 1001;
    gap: 0.5rem;
    scrollbar-width: thin;
    scrollbar-color: #012475 #ffffff;
  }

  .nav__links.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    min-height: -webkit-fill-available;
    margin-top: 0; /* Ajout de margin-top 0 */
    top: 0; /* Assure que le menu commence tout en haut */
  }

  /* Style unifié pour nav__item */
  .nav__item {
    width: 100%;
    margin: 0;
    position: relative;
    min-height: fit-content;
    transform: none;
    text-align: center;
  }

  .nav__item > a {
    display: block;
    width: 100%;
    text-align: center;
    padding: 1rem;
    color: #012475;
    font-size: 1.2rem;
  }

  /* Style unifié pour dropdown__menu */
  .dropdown__menu {
    position: static;
    width: 100%;
    background: rgba(255, 255, 255, 0.8);
    box-shadow: none;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-in-out;
    opacity: 1;
    visibility: visible;
    padding: 0;
  }

  .nav__item.active .dropdown__menu {
    max-height: fit-content;
    padding: 0.5rem 0;
  }

  .dropdown__menu li {
    width: 100%;
    padding: 0;
    opacity: 1;
    transform: none;
  }

  .dropdown__menu a {
    padding: 0.8rem 2rem;
    text-align: center;
  }

  /* Ajustements spécifiques pour premier et dernier éléments */
  .nav__links > li:first-of-type {
    margin-top: -40px;
    margin-bottom: 10px;
  }

  .nav__links > li:last-child {
    margin-bottom: 40px;
  }

  /* Styles scrollbar */
  .nav__links::-webkit-scrollbar {
    width: 8px;
  }

  .nav__links::-webkit-scrollbar-track {
    background: #ffffff;
  }

  .nav__links::-webkit-scrollbar-thumb {
    background-color: #012475;
    border-radius: 4px;
  }
}

/* Garder le hover uniquement sur desktop */
@media (min-width: 769px) {
  .nav__item:hover .dropdown__menu {
    display: block;
  }
}

