﻿/* ============================================================
   NAVIGATION.CSS — Athenia Academy
   Rôle : navigation desktop, sous-menus horizontaux, mobile nav,
   sticky nav, barre de progression.
   À charger APRÈS components.css pour stabiliser/override l'existant.
   ============================================================ */

/* Barre de progression scroll */
#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 2px;
  background: #00A86B;
  z-index: 9999;
  pointer-events: none;
  transition: width 0.08s linear;
}

/* Navigation principale */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.82);
  border-bottom: 1px solid rgba(29, 29, 31, 0.08);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

.nav-top,
.nav-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding-left: 2rem;
  padding-right: 2rem;
}

.nav-top {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(29, 29, 31, 0.08);
}

.nav-inner {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Logo */
.logo,
.footer-logo {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.logo {
  color: #1D1D1F;
  font-size: 1.05rem;
}

.logo span {
  color: #00A86B;
}

.logo-img {
  display: block;
  width: 58px;
  height: 60px;
  background: url('../logos/logo-athenia-academy.png') no-repeat center/contain;
  flex-shrink: 0;
}

/* Liens desktop */
.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  min-height: 34px;
  padding: 0 0.75rem;
  border-radius: 999px;
  color: #6E6E73;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  text-transform: none;
  transition: background 0.16s ease, color 0.16s ease, opacity 0.16s ease;
}

.nav-links a:hover,
.nav-links a.nav-active {
  color: #1D1D1F;
  background: rgba(29, 29, 31, 0.05);
  opacity: 1;
}

.nav-links a.nav-active {
  font-weight: 600;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Sous-menu horizontal premium */
.nav-item {
  position: relative;
}

/* Sous-menu horizontal premium */
.nav-links > .nav-item {
  position: relative !important;
  display: flex;
  align-items: center;
}

/* Pont invisible pour éviter la disparition au hover */
.nav-links > .nav-item::after {
  content: "";
  position: absolute;
  left: -48px;
  right: -48px;
  top: 100%;
  height: 28px;
  display: none;
  pointer-events: auto;
}

.nav-links > .nav-item:hover::after,
.nav-links > .nav-item:focus-within::after,
.nav-links > .nav-item.open::after {
  display: block;
}

.nav-chevron {
  width: 10px;
  height: 10px;
  position: relative;
  opacity: 0.45;
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.nav-chevron::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 1px;
  width: 5px;
  height: 5px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
}

.nav-links > .nav-item:hover .nav-chevron,
.nav-links > .nav-item:focus-within .nav-chevron,
.nav-links > .nav-item.open .nav-chevron {
  transform: rotate(180deg);
  opacity: 1;
}

/* Le sous-menu est positionné en coordonnées viewport par app.js */
.nav-links > .nav-item > .nav-dropdown {
  position: fixed !important;
  top: var(--dropdown-top, 96px) !important;
  left: var(--dropdown-left, 24px) !important;
  right: auto !important;

  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 4px;

  width: max-content;
  max-width: min(1180px, calc(100vw - 48px));
  padding: 9px 14px;
  margin: 0;

  list-style: none;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;

  background: rgba(245, 245, 247, 0.94);
  border: 1px solid rgba(29, 29, 31, 0.08);
  border-radius: 999px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.10);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);

  z-index: 3000;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;

  transform: translate3d(0, -2px, 0) !important;
  transition: opacity 0.16s ease, visibility 0.16s ease, transform 0.16s ease;
}

.nav-links > .nav-item > .nav-dropdown::-webkit-scrollbar {
  display: none;
}

.nav-links > .nav-item:hover > .nav-dropdown,
.nav-links > .nav-item:focus-within > .nav-dropdown,
.nav-links > .nav-item.open > .nav-dropdown {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate3d(0, 0, 0) !important;
}

.nav-links > .nav-item > .nav-dropdown li {
  flex: 0 0 auto;
}

.nav-links > .nav-item > .nav-dropdown a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 14px;
  border-radius: 999px;
  color: #1D1D1F;
  background: transparent;
  font-size: 0.76rem;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
}

.nav-links > .nav-item > .nav-dropdown a:hover,
.nav-links > .nav-item > .nav-dropdown a:focus {
  color: #00A86B;
  background: rgba(255, 255, 255, 0.78);
  outline: none;
  opacity: 1;
}

.nav-links > .nav-item > .nav-dropdown .submenu-cta {
  color: #00A86B;
  font-weight: 700;
}
/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 8px;
}

.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: #1D1D1F;
  border-radius: 999px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

/* Navigation mobile */
.mobile-nav {
  display: none;
  position: fixed;
  top: 96px;
  left: 0;
  right: 0;
  z-index: 999;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid rgba(29, 29, 31, 0.08);
  padding: 1rem;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.mobile-nav.open {
  display: block;
}

.mobile-nav a,
.mobile-nav-direct,
.mobile-parent-btn {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 48px;
  padding: 0.8rem 1rem;
  border-radius: 14px;
  color: #1D1D1F;
  background: #FFFFFF;
  border: 1px solid rgba(29, 29, 31, 0.08);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-transform: none;
  text-align: left;
}

.mobile-nav a + a,
.mobile-nav-item + .mobile-nav-item {
  margin-top: 0.5rem;
}

.mobile-nav a:hover,
.mobile-nav-direct:hover,
.mobile-parent-btn:hover {
  color: #00A86B;
  background: #F5F5F7;
  opacity: 1;
}

.mobile-nav-direct.cta-mobile,
.mobile-nav .mob-nav-btn-cta {
  background: #00A86B !important;
  color: #FFFFFF !important;
  border-color: #00A86B !important;
  justify-content: center;
}

.mobile-parent {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.mobile-toggle-icon {
  color: #86868B;
  transition: transform 0.2s ease, color 0.2s ease;
}

.mobile-nav-item.open .mobile-toggle-icon {
  transform: rotate(180deg);
  color: #00A86B;
}

.mobile-sub {
  display: none;
  padding: 0.5rem 0 0 1rem;
  margin: 0;
  list-style: none;
}

.mobile-sub.open {
  display: block;
}

.mobile-sub a {
  min-height: 42px;
  font-size: 0.86rem;
  color: #6E6E73;
}

/* Responsive navigation */
@media (max-width: 768px) {
  nav {
    background: rgba(255, 255, 255, 0.92);
  }

  .nav-top {
    display: none;
  }

  .nav-inner {
    min-height: 64px;
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }

  .nav-links,
  .nav-actions {
    display: none;
  }

  .hamburger {
    display: flex;
  }

  .mobile-nav {
    top: 64px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nav-dropdown,
  .nav-chevron,
  .hamburger span {
    transition: none !important;
  }
}
