/* =========================================
   SITE NAVBAR — INVEX HOST
   Design premium glassmorphism sticky
   ========================================= */

/* ---- BASE NAVBAR ---- */
.site-navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999999;
  height: 70px;
  display: flex;
  align-items: center;
  transition: background 0.4s ease, box-shadow 0.4s ease, backdrop-filter 0.4s ease;
  background: rgba(0, 7, 45, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(41, 110, 181, 0.15);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
}

/* Sur la home : fond sombre comme le reste */
.navbar-home {
  background: rgba(0, 7, 45, 0.95);
}

/* Sur les pages internes : fond semi-opaque */
.navbar-inner {
  background: rgba(0, 7, 45, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(41, 110, 181, 0.15);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

/* Scrolled state (ajouté via JS) */
.site-navbar.scrolled {
  background: rgba(0, 7, 45, 0.98);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid rgba(41, 110, 181, 0.2);
  box-shadow: 0 4px 32px rgba(0, 0, 0, 0.25);
}

/* ---- CONTAINER ---- */
.site-navbar .container {
  display: flex;
  align-items: center;
  gap: 0;
  height: 100%;
}

/* ---- LOGO ---- */
.navbar-logo {
  display: flex;
  align-items: center;
  text-decoration: none !important;
  flex-shrink: 0;
  margin-right: auto;
}

.navbar-logo-img {
  height: 36px;
  width: auto;
  object-fit: contain;
}

.navbar-logo-text {
  font-size: 1.3rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.5px;
  font-family: "Ubuntu", sans-serif;
}

.navbar-logo-text .logo-accent {
  color: #D7CF06;
}

/* ---- NAV LINKS (desktop) ---- */
.navbar-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin: 0 auto;
}

.nav-link-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.5rem 0.9rem;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 600;
  color: rgba(196, 218, 220, 0.75) !important;
  text-decoration: none !important;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.25s ease;
  white-space: nowrap;
  position: relative;
}

.nav-link-item i {
  font-size: 0.9rem;
}

.nav-link-item:hover {
  color: #fff !important;
  background: rgba(255, 255, 255, 0.06);
}

.nav-link-item.active {
  color: #D7CF06 !important;
  background: rgba(215, 207, 6, 0.08);
}

.nav-link-item.active::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 18px;
  height: 2px;
  border-radius: 1px;
  background: #D7CF06;
}

/* ---- NAV DROPDOWN ---- */
.nav-dropdown {
  position: relative;
}

.nav-dropdown-toggle {
  cursor: pointer;
}

.nav-chevron {
  font-size: 0.65rem !important;
  transition: transform 0.25s ease;
}

.nav-dropdown:hover .nav-chevron,
.nav-dropdown.open .nav-chevron {
  transform: rotate(180deg);
}

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: rgba(0, 7, 45, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(41, 110, 181, 0.2);
  border-radius: 16px;
  padding: 0.5rem;
  min-width: 200px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(41, 110, 181, 0.1);
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 100;
}

.nav-dropdown-menu::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 12px;
  height: 12px;
  background: rgba(0, 7, 45, 0.95);
  border-left: 1px solid rgba(41, 110, 181, 0.2);
  border-top: 1px solid rgba(41, 110, 181, 0.2);
  clip-path: polygon(0 0, 100% 100%, 0 100%);
  rotate: 45deg;
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown.open .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.nav-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0.65rem 1rem;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 500;
  color: rgba(196, 218, 220, 0.75) !important;
  text-decoration: none !important;
  transition: all 0.2s ease;
}

.nav-dropdown-item i {
  font-size: 0.9rem;
  color: #296EB5;
  width: 16px;
  text-align: center;
}

.nav-dropdown-item:hover {
  color: #fff !important;
  background: rgba(255, 255, 255, 0.06);
}

.nav-dropdown-item:hover i {
  color: #D7CF06;
}

/* ---- AUTH BUTTON ---- */
.navbar-auth {
  flex-shrink: 0;
  margin-left: 1rem;
}

.btn-nav-auth {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0.55rem 1.25rem;
  background: linear-gradient(135deg, #D7CF06, #c4b800);
  color: #00072d !important;
  border-radius: 10px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-decoration: none !important;
  transition: all 0.3s ease;
  box-shadow: 0 4px 16px rgba(215, 207, 6, 0.25);
  white-space: nowrap;
}

.btn-nav-auth i {
  font-size: 0.9rem;
}

.btn-nav-auth:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(215, 207, 6, 0.4);
  filter: brightness(1.05);
}

/* ---- USER MENU ---- */
.nav-user-menu {
  position: relative;
}

.nav-user-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0.4rem;
  background: rgba(41, 110, 181, 0.12);
  border: 1px solid rgba(41, 110, 181, 0.25);
  border-radius: 40px;
  cursor: pointer;
  color: rgba(196, 218, 220, 0.85);
  font-size: 0.8rem;
  font-weight: 600;
  transition: all 0.25s ease;
  outline: none;
  white-space: nowrap;
}

.nav-user-btn:hover {
  background: rgba(41, 110, 181, 0.2);
  border-color: rgba(41, 110, 181, 0.4);
  color: #fff;
}

.nav-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #296EB5, #1C3B72);
  border: 2px solid rgba(215, 207, 6, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.nav-user-avatar.lg {
  width: 44px;
  height: 44px;
  font-size: 1rem;
}

.nav-user-name {
  font-size: 0.78rem;
}

.nav-user-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: rgba(0, 7, 45, 0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(41, 110, 181, 0.2);
  border-radius: 16px;
  padding: 0.5rem;
  min-width: 230px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(41, 110, 181, 0.1);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 100;
}

.nav-user-dropdown.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-user-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0.75rem 0.75rem 0.5rem;
}

.nav-user-fullname {
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
}

.nav-user-role {
  font-size: 0.7rem;
  color: rgba(196, 218, 220, 0.4);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.nav-user-divider {
  height: 1px;
  background: rgba(41, 110, 181, 0.12);
  margin: 0.25rem 0;
}

.nav-user-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 500;
  color: rgba(196, 218, 220, 0.75) !important;
  text-decoration: none !important;
  transition: all 0.25s ease;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.nav-user-item i {
  font-size: 0.9rem;
  color: #296EB5;
  width: 16px;
  text-align: center;
}

.nav-user-item:hover {
  color: #fff !important;
  background: rgba(255, 255, 255, 0.06);
}

.nav-user-item:hover i {
  color: #D7CF06;
}

.nav-user-item.danger {
  color: rgba(204, 51, 44, 0.75) !important;
}

.nav-user-item.danger i {
  color: #CC332C;
}

.nav-user-item.danger:hover {
  color: #CC332C !important;
  background: rgba(204, 51, 44, 0.08);
}

.nav-user-item.danger:hover i {
  color: #CC332C;
}

/* ---- HAMBURGER (mobile) ---- */
.navbar-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 8px;
  background: rgba(41, 110, 181, 0.1);
  border: 1px solid rgba(41, 110, 181, 0.2);
  border-radius: 10px;
  cursor: pointer;
  margin-left: 0.75rem;
  flex-shrink: 0;
  outline: none;
}

.navbar-burger span {
  display: block;
  height: 2px;
  background: rgba(196, 218, 220, 0.8);
  border-radius: 2px;
  transition: all 0.3s ease;
  transform-origin: center;
}

.navbar-burger.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.navbar-burger.open span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.navbar-burger.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ---- MOBILE OVERLAY ---- */
.navbar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 7, 45, 0.6);
  backdrop-filter: blur(4px);
  z-index: 9999997;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.navbar-overlay.open {
  opacity: 1;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 991px) {
  .site-navbar {
    height: 64px;
  }

  .navbar-burger {
    display: flex;
  }

  /* Panneau mobile sliding */
  .navbar-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: min(320px, 85vw);
    height: 100vh;
    background: rgba(0, 7, 45, 0.98);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-left: 1px solid rgba(41, 110, 181, 0.2);
    flex-direction: column;
    align-items: flex-start;
    padding: 5rem 1.5rem 2rem;
    gap: 0.25rem;
    z-index: 9999998;
    transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    margin: 0;
  }

  .navbar-links.mobile-open {
    right: 0;
  }

  .nav-link-item {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    border-radius: 12px;
  }

  .nav-link-item.active::after {
    display: none;
  }

  /* Dropdown en mobile : inline */
  .nav-dropdown {
    width: 100%;
  }

  .nav-dropdown-toggle {
    width: 100%;
  }

  .nav-dropdown-menu {
    position: static;
    transform: none;
    opacity: 1;
    visibility: visible;
    background: rgba(41, 110, 181, 0.06);
    border: 1px solid rgba(41, 110, 181, 0.12);
    border-radius: 12px;
    box-shadow: none;
    margin: 0.25rem 0 0 0.75rem;
    padding: 0.25rem;
    display: none;
    width: calc(100% - 0.75rem);
  }

  .nav-dropdown-menu::before {
    display: none;
  }

  .nav-dropdown.open .nav-dropdown-menu {
    display: block;
  }

  /* Auth dans la navbar mobile */
  .navbar-auth {
    display: none;
  }

  .navbar-overlay {
    display: block;
  }

  /* Ajouter le bouton auth en bas du panneau mobile */
  .navbar-links::after {
    content: '';
    flex: 1;
  }
}

@media (max-width: 575px) {
  .navbar-logo-text {
    font-size: 1.1rem;
  }
}

/* ---- BODY PADDING TOP ---- */
body {
  padding-top: 70px;
}

@media (max-width: 991px) {
  body {
    padding-top: 64px;
  }
}