/* ======================== */
/*     BARRE DE NAVIGATION */
/* ======================== */

/* Safety reset: evite l'espace blanc au-dessus de la nav (marge navigateur par defaut). */
html,
body {
  margin: 0;
  padding: 0;
}

nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  background: #027b9a;
  min-height: 110px;
  box-shadow: inset 0px -1px 0px #c5c5c6;
  width: 100%;
  box-sizing: border-box;
  position: relative;
}

.nav-desktop-container {
  display: flex;
  gap: 15px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}

/* ======================== */
/*        NAV SEARCH       */
/* ======================== */

.nav-search {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 0 20px;
  flex: 1 1 360px;
  max-width: 560px;
}

.nav-search input[type="search"] {
  flex: 1 1 auto;
  height: 40px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.95);
  color: #2c3e50;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}

.nav-search input[type="search"]::placeholder {
  color: #7a8a99;
}

.nav-search input[type="search"]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(2, 123, 154, 0.35);
  border-color: #ffffff;
}

.nav-search button {
  height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, #035d70, #014a5c);
  color: #fff;
}

.nav-search button:hover {
  background: linear-gradient(135deg, #046c82, #014055);
}

/* LOGO + NOM DU SITE */
.nav-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-icon {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.nav-icon img {
  width: 40px;
  height: auto;
  transform: rotate(-17deg);
}

.nav-icon span {
  font-size: 20px;
  color: white;
  font-family: var(--font-main);
  font-weight: bold;
}

.main-nav-container {
  display: none;
}

/* ======================== */
/*         BURGER MENU     */
/* ======================== */

.hamburger {
  display: none;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  width: 70px;
  height: 70px;
  justify-content: center;
  align-items: center;
  background: none;
  border: none;
}

.hamburger span {
  width: 40px;
  height: 5px;
  background-color: white;
  transition: all 0.3s ease;
}

/* Animation croix */
.hamburger.open span:nth-child(1) {
  transform: translateY(10px) rotate(45deg);
}
.hamburger.open span:nth-child(2) {
  opacity: 0;
}
.hamburger.open span:nth-child(3) {
  transform: translateY(-10px) rotate(-45deg);
}

/* ======================== */
/*         LIENS NAV        */
/* ======================== */

.navlinks-container,
.dynamic-links {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  justify-content: center;
}

.navlinks-container a,
.dynamic-links a {
  color: white;
  text-decoration: none;
  font-weight: 500;
  font-family: var(--font-main);
  position: relative;
  line-height: 1;
}

.navlinks-container a::after,
.dynamic-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -3px;
  width: 100%;
  height: 2px;
  background: white;
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.navlinks-container a:hover::after,
.dynamic-links a:hover::after {
  transform: scaleX(1);
}

.navlinks-container a.nav-link-disabled,
.main-nav-container a.nav-link-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.navlinks-container a.nav-link-disabled::after,
.main-nav-container a.nav-link-disabled::after {
  display: none;
}

/* ======================== */
/*     ZONE LOGIN / AVATAR */
/* ======================== */

.nav-authentication {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 200px;
}

.Sign-btns {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.nav-welcome {
  font-size: 18px;
  color: white;
  font-family: var(--font-main);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-links {
  text-decoration: none;
  color: white;
  padding: 8px 12px;
  border: 1px solid white;
  border-radius: 5px;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.nav-links:hover {
  background: white;
  color: #027b9a;
}

/* ======================== */
/*        AVATAR           */
/* ======================== */

.avatar-link {
  margin-left: 10px;
}

.avatar-nav {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #ddd;
  transition: transform 0.2s ease;
}

.avatar-nav:hover {
  transform: scale(1.05);
  border-color: var(--color-primary);
}

/* ======================== */
/*         MOBILE NAV       */
/* ======================== */

@media (max-width: 1000px) {
  nav {
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 10px;
  }

  .hamburger {
    display: flex;
  }

  .main-nav-container {
    display: block;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: 100%;
    background-color: #027b9a;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    z-index: 100;
    transition: max-height 0.5s ease-out, opacity 0.3s ease;
  }

  .main-nav-container.active {
    max-height: 1100px;
    opacity: 1;
  }

  .main-nav-container a {
    display: block;
    padding: 18px 25px;
    font-size: 20px;
    font-weight: bold;
    color: white;
    text-align: center;
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    transition: background 0.3s ease, color 0.3s ease;
  }

  .main-nav-container a:hover {
    background-color: rgba(255, 255, 255, 0.2);
    color: #ffeb3b;
  }
}

@media (max-width: 1000px) {
  .nav-desktop-container {
    display: none !important;
  }

  .nav-search {
    order: 3;
    flex: 1 1 100%;
    max-width: none;
    width: 100%;
    margin: 10px 0 0 0;
  }

  .nav-search input[type="search"] {
    width: 100%;
  }

  .nav-left {
    order: 1;
    flex: 1 1 auto;
  }

  .nav-authentication {
    order: 2;
    margin-left: auto;
  }

  .nav-welcome {
    display: none;
  }
}
