/**
 * Navigation Component
 * ====================
 * Navbar sticky avec liens vers sections
 */

/* Container principal */
.navbar {
  position: fixed;
  top: 0px; /*60px si Sous la bannière demo */
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
  z-index: 9999;
  transition: all 0.3s ease;
    height: 60px !important;
  min-height: 60px !important;
  max-height: 60px !important;
  overflow: hidden !important;
}

body.has-demo-banner .navbar {
  top: 0px;
}

/* Compense la hauteur navbar + bannière */
body.has-demo-banner.has-navbar {
  padding-top: 120px; /* 60px bannière + 60px navbar */
}

/* Navbar scrollée (plus compacte) */
.navbar--scrolled {
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.15);
}

/* Container */
.navbar__container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px !important;
}

/* Logo/Branding */
.navbar__brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: #1a5f7a;
  font-weight: 700;
  font-size: 1.1rem;
  transition: color 0.3s ease;
}

.navbar__brand:hover {
  color: #3182ce;
}

.navbar__logo {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

/* Menu de navigation */
.navbar__menu {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.navbar__item {
  margin: 0;
}

.navbar__link {
  display: block;
  padding: 0.5rem 1rem;
  color: #2d3748;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  border-radius: 8px;
  transition: all 0.3s ease;
  position: relative;
}

.navbar__link:hover {
  color: #1a5f7a;
  background: rgba(26, 95, 122, 0.08);
}

.navbar__link.active {
  color: #1a5f7a;
  background: rgba(26, 95, 122, 0.12);
}

.navbar__link.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 2px;
  background: #1a5f7a;
  border-radius: 2px;
}

/* Bouton menu mobile */
.navbar__toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  color: #1a5f7a;
}

.navbar__toggle-icon {
  display: block;
  width: 24px;
  height: 2px;
  background: currentColor;
  position: relative;
  transition: all 0.3s ease;
}

.navbar__toggle-icon::before,
.navbar__toggle-icon::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 2px;
  background: currentColor;
  left: 0;
  transition: all 0.3s ease;
}

.navbar__toggle-icon::before {
  top: -8px;
}

.navbar__toggle-icon::after {
  bottom: -8px;
}

/* État menu ouvert */
.navbar__toggle.is-active .navbar__toggle-icon {
  background: transparent;
}

.navbar__toggle.is-active .navbar__toggle-icon::before {
  top: 0;
  transform: rotate(45deg);
}

.navbar__toggle.is-active .navbar__toggle-icon::after {
  bottom: 0;
  transform: rotate(-45deg);
}

/* Responsive */
@media (max-width: 1024px) {
  .navbar__menu {
    gap: 0.25rem;
  }

  .navbar__link {
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
  }
}

@media (max-width: 768px) {
  body.has-demo-banner.has-navbar {
    padding-top: 110px; /* 50px bannière + 60px navbar mobile */
  }

  .navbar__container {
    padding: 0 1rem;
  }

  .navbar__brand {
    font-size: 1rem;
  }

  .navbar__logo {
    width: 28px;
    height: 28px;
  }

  .navbar__toggle {
    display: block;
  }

  .navbar__menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    flex-direction: column;
    gap: 0;
    padding: 1rem;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
  }

  .navbar__menu.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .navbar__item {
    width: 100%;
  }

  .navbar__link {
    width: 100%;
    padding: 0.75rem 1rem;
    text-align: left;
  }

  .navbar__link.active::after {
    left: 1rem;
    transform: translateX(0);
    bottom: 50%;
    transform: translateY(50%);
    width: 3px;
    height: 20px;
  }
}

/* Animation smooth scroll */
html {
  scroll-behavior: smooth;
}

/* Ajuste le scroll pour compenser la navbar */
.section {
  scroll-margin-top: 130px; /* 60px bannière + 60px navbar + 10px marge */
}

@media (max-width: 768px) {
  .section {
    scroll-margin-top: 120px;
  }
}