/* ==========================================================================
   Navigation - Style Moderne Sombre
   ========================================================================== */

:root {
  --nav-bg: rgba(18, 18, 18, 0.98);
  --nav-scrolled-bg: rgba(12, 12, 12, 0.98);
  --nav-border: rgba(255, 255, 255, 0.05);
  --nav-text: #ffffff;
  --nav-text-hover: #7C89FF;
  --nav-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  --nav-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --nav-height: 80px;
  --nav-height-scrolled: 70px;
  --primary-color: #7C89FF;
  --text-light: rgba(255, 255, 255, 0.7);
  --body-font: 'Lato', sans-serif;
  --heading-font: 'Rubik', sans-serif;
}

/* En-tête principal */
.modern-header {
  position: fixed;
  top: 0.5rem;
  left: 0;
  right: 0;
  margin: 0 auto;
  width: 90%;
  max-width: 1800px; /* Augmentation de la largeur max pour grands écrans */
  padding: 0.8rem 1rem;
  z-index: 1000;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
              background 0.3s ease, 
              box-shadow 0.3s ease,
              opacity 0.4s ease,
              width 0.3s ease;
  background: rgba(255, 255, 255, 0.98);
  border-radius: 12px;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  will-change: transform, opacity;
}

/* Animation de disparition lors du défilement */
.modern-header.navbar-hidden {
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
}

/* Conteneur de l'en-tête */
.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin: 0 auto;
}

/* En-tête avec défilement */
.modern-header.scrolled {
  height: var(--nav-height-scrolled);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* Conteneur de la barre de navigation */
.navbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-grow: 1;
  margin-left: 2rem;
  transition: margin-left 0.3s ease;
}

/* Logo et tagline */
.logo-container {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.logo {
  height: 2.2rem;
  width: auto;
  transition: all 0.3s ease;
}

.logo:hover {
  transform: translateY(-2px);
  filter: drop-shadow(0 2px 4px rgba(124, 137, 255, 0.2));
}

.tagline {
  font-size: 0.9rem;
  color: #4a5568;
  font-weight: 500;
  margin: 0;
  padding-left: 1.5rem;
  border-left: 1px solid #e9e7ff;
  letter-spacing: 0.3px;
}

/* Conteneur des éléments de navigation */
.nav-links {
  display: flex;
  gap: 2.5rem;
  align-items: center;
  margin: 0 2rem 0 0;
  padding: 0;
  list-style: none;
}

/* Liens de navigation */
.nav-links {
  display: flex;
  list-style: none;
  gap: 2rem;
  margin: 0;
  padding: 0;
  transition: gap 0.3s ease;
}

.nav-link {
  color: #7B89FF;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  padding: 0.5rem 0.25rem;
  letter-spacing: 0.3px;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #7c89ff, #b1b8ff);
  border-radius: 2px;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

.nav-link:hover {
  color: #5a6bff !important;
  transform: translateY(-1px);
}

/* Forcer la couleur des liens de navigation */
.nav-links .nav-link,
.nav-links .nav-link:not(.active) {
  color: #7B89FF !important;
}

.nav-link.active {
  color: #7c89ff;
  font-weight: 600;
}

/* Conteneur des boutons de navigation */
.nav-buttons {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Bouton Se connecter */
.login-button {
  background: transparent;
  color: #7B89FF;
  border: 2px solid #7B89FF;
  padding: 0.6rem 1.5rem;
  margin-left: 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.login-button:hover {
  background: rgba(123, 137, 255, 0.1);
  transform: translateY(-1px);
}

.login-button:active {
  transform: translateY(0);
}

/* Boutons CTA */
.nav-cta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: 1rem;
}

.contact-button {
  background: linear-gradient(135deg, #7c89ff 0%, #5a6bff 100%);
  color: white;
  border: none;
  padding: 0.75rem 1.75rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 15px rgba(124, 137, 255, 0.2);
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.contact-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #6a7aff 0%, #4a5bef 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: -1;
}

.contact-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(124, 137, 255, 0.3);
}

.contact-button:hover::before {
  opacity: 1;
}

.contact-button:active {
  transform: translateY(0);
  box-shadow: 0 4px 15px rgba(124, 137, 255, 0.2);
}

/* Mobile menu toggle */
.mobile-menu-toggle {
  display: none; /* Caché par défaut sur desktop */
  background: none;
  border: 2px solid #7c89ff;
  cursor: pointer;
  padding: 0.75rem;
  z-index: 1001;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.9);
  transition: all 0.3s ease;
  -webkit-tap-highlight-color: transparent; /* Supprimer le highlight au toucher sur mobile */
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.mobile-menu-toggle:hover {
  background: rgba(233, 231, 255, 0.5);
}

.mobile-menu-toggle:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(124, 137, 255, 0.3);
}

.mobile-menu-toggle .hamburger {
  display: block;
  width: 24px;
  height: 2px;
  background-color: #4a5568;
  position: relative;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 2px;
}

.mobile-menu-toggle .hamburger::before,
.mobile-menu-toggle .hamburger::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  background-color: #4a5568;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  left: 0;
}

.mobile-menu-toggle .hamburger::before {
  transform: translateY(-8px);
}

.mobile-menu-toggle .hamburger::after {
  transform: translateY(8px);
}

.mobile-menu-toggle[aria-expanded="true"] .hamburger {
  background-color: transparent;
}

.mobile-menu-toggle[aria-expanded="true"] {
  background: #7c89ff;
  border-color: #7c89ff;
}

.mobile-menu-toggle[aria-expanded="true"] .hamburger::before {
  transform: rotate(45deg);
  background-color: white;
}

.mobile-menu-toggle[aria-expanded="true"] .hamburger::after {
  transform: rotate(-45deg);
  background-color: white;
}

/* Responsive styles */
/* Grands écrans */
@media (min-width: 1400px) {
  .modern-header {
    width: 92%;
  }
  
  .header-container {
    max-width: 1600px;
  }
  
  .navbar {
    margin-left: 3rem;
  }
  
  .nav-links {
    gap: 2.5rem;
  }
  
  .logo {
    height: 2.4rem;
  }
  
  .nav-buttons {
    gap: 0.75rem;
  }
}

/* Très grands écrans */
@media (min-width: 1800px) {
  .modern-header {
    width: 94%;
    max-width: 2200px;
  }
  
  .header-container {
    max-width: 2000px;
  }
  
  .navbar {
    margin-left: 4rem;
  }
  
  .nav-links {
    gap: 3rem;
  }
  
  .nav-link {
    font-size: 1rem;
  }
  
  .logo {
    height: 2.6rem;
  }
  
  .nav-buttons {
    gap: 1rem;
  }
  
  .login-button,
  .nav-ultra-button .button-text {
    font-size: 1rem;
  }
}

@media (max-width: 1024px) {
  /* Styles de base */
  .modern-header {
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    padding: 0.8rem 1.5rem;
    border-radius: 0;
    top: 0;
    height: 70px; /* Hauteur fixe pour éviter les sauts */
  }
  
  /* Afficher le bouton du menu mobile */
  .mobile-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .nav-overlay {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 11, 16, 0.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none; /* Par défaut, ne pas intercepter les clics */
  }

  .nav-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto; /* Intercepter les clics quand actif */
  }

  .navbar {
    position: fixed;
    top: 0;
    left: -100%;
    width: 85%;
    max-width: 360px;
    height: 100vh;
    background: white;
    flex-direction: column;
    justify-content: flex-start;
    padding: 5rem 2rem 2.5rem 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    box-shadow: 5px 0 30px rgba(0, 0, 0, 0.15);
    overflow-y: auto; /* Permettre le défilement si nécessaire */
    -webkit-overflow-scrolling: touch; /* Défilement fluide sur iOS */
    margin-left: 0;
    left: 0; /* Commencer exactement au bord gauche */
    transform: translateX(-100%); /* Cacher hors écran par défaut */
  }

  .navbar.active {
    transform: translateX(0); /* Afficher à l'écran */
  }

  .nav-link {
    width: 100%;
    padding: 1rem 0;
    font-size: 1.1rem;
    color: #2d3748;
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
    border-radius: 8px;
    margin-bottom: 0.25rem;
    font-weight: 500;
    text-align: left;
  }
  
  .nav-link::after {
    display: none;
  }
  
  .nav-link:hover,
  .nav-link:focus,
  .nav-link.active {
    background: rgba(124, 137, 255, 0.1);
    color: var(--primary-color);
    transform: translateX(0); /* Ne pas décaler les éléments au survol */
    outline: none;
    font-weight: 600;
  }
  
  .nav-buttons {
    flex-direction: column;
    width: 100%;
    gap: 0.75rem;
    margin: 0.5rem 0 1rem;
    padding: 1.5rem 0 0 2rem;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
  }
  
  .login-button,
  .nav-ultra-button {
    width: 100%;
    text-align: center;
    justify-content: center;
    padding: 0.85rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    margin-left: 0;
    border-radius: 12px;
  }
  
  /* Ajuster la navigation principale sur mobile */
  .nav-links {
    display: flex;
    flex-direction: column;
    width: 100%;
    margin: 0 0 2rem 0;
    padding: 0.5rem 0 0.5rem 2rem;
    align-items: flex-start;
    text-align: left;
  }
  
  /* Style pour les petits écrans */
  @media (max-width: 480px) {
    .nav-items {
      width: 100%;
      max-width: 100%;
      padding: 5.5rem 1.25rem 2rem;
    }
    
    .logo {
      font-size: 1.6rem;
    }
    
    .logo-tagline {
      font-size: 0.7rem;
    }
    
    .nav-link {
      padding: 0.7rem 1rem;
      font-size: 0.95rem;
    }
  }
}
