/* Style du bouton hamburger */
.navbar-toggler.vefa-toggler {
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 10px;
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 70px;
    display: none;
  }
  
  .navbar-toggler.vefa-toggler:focus {
    outline: none;
    box-shadow: none;
  }
  
  .vefa-toggler-icon {
    display: block;
    position: relative;
    width: 30px;
    height: 20px;
  }
  
  .vefa-toggler-icon::before,
  .vefa-toggler-icon::after,
  .vefa-toggler-icon span {
    content: '';
    display: block;
    width: 100%;
    height: 2px;
    background-color: var(--navbar-text-color, #000);
    position: absolute;
    left: 0;
    transition: all 0.3s ease;
  }
  
  .vefa-toggler-icon::before {
    top: 0;
  }
  
  .vefa-toggler-icon span {
    top: 50%;
    transform: translateY(-50%);
  }
  
  .vefa-toggler-icon::after {
    bottom: 0;
  }

  .brand-vefa {
    color: var(--vefa-brand-vefa);
}


.brand-connect {
    color: var(--vefa-accent);
}

  
  .navbar-toggler.vefa-toggler[aria-expanded="true"] .vefa-toggler-icon::before {
    transform: translateY(9px) rotate(45deg);
  }
  
  .navbar-toggler.vefa-toggler[aria-expanded="true"] .vefa-toggler-icon span {
    opacity: 0;
  }
  
  .navbar-toggler.vefa-toggler[aria-expanded="true"] .vefa-toggler-icon::after {
    transform: translateY(-9px) rotate(-45deg);
  }
  
  /* Media query pour s'assurer que ces styles s'appliquent uniquement sur mobile */
  @media (max-width: 767.98px) {
    .navbar-toggler.vefa-toggler {
      display: block;
    }
  }

  .nav-link .fas, .nav-link .fa-brands, .nav-link .fa-regular, .navbar-brand .fas, .fa-brands,.fas .fa-building  {
    color: var(--icon-color);
  }
  
  
  .nav-link:hover, .nav-link:hover i{
    color: var(--icon-hover-color);
  }
  
  /* Utilisation des variables pour les autres styles, exemple pour le texte */
  .text-white {
    color: var(--text-on-dark-bg) !important;
  }
  
  .navbar-custom {
    background-color: var(--background-color);
    box-shadow: 0 2px 4px rgba(0,0,0,.05);
  }
  
  .navbar-custom .navbar-nav .nav-link:hover,
  .navbar-custom .navbar-nav .nav-link:focus {
    color: var(--navbar-link-hover-color);
  }
  .navbar-custom .dropdown-menu {
    border: none;
    box-shadow: 0 0.5rem 1rem rgba(0,0,0,.1);
    background-color: var(--background-color);
  }
  .navbar-custom .dropdown-item:hover,
  .navbar-custom .dropdown-item:focus {
    background-color: var(--navbar-link-hover-color);
    color: white;
  }
  
  /* Show desktop view only on larger screens */
  @media (min-width: 768px) {
    .custom-navbar .desktop-view {
        display: flex; 
        align-items: center;
        width: 100%;
        height: 60px;
        gap: 2rem;
    }
  }
  
  .desktop-logo {
    /* Style desktop logo link */
    display: flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
  }
  .desktop-logo .logo-img {
    height: 40px; /* Adjust logo size */
    width: auto;
    margin-right: 0.5rem;
  }
  .desktop-logo .brand-text {
    /* Style brand text */
    font-weight: 600;
  }

  .desktop-nav-links {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 1.5rem; /* Adjust spacing between links */
    flex: 1; /* take available space */
    align-items: center;
  }

  /* push the last nav item to the extreme right */
  .desktop-nav-links .nav-link-right {
    margin-left: auto;
  }

  .desktop-nav-links li a {
    /* Style desktop links */
    text-decoration: none;
    color: #333; /* Default link color */
    position: relative; /* Needed for the pseudo-element */
    padding-bottom: 5px; /* Add some space for the underline */
    transition: color 0.3s ease; /* Smooth color transition */
  }
  /* Add hover/active styles */
  .desktop-nav-links li a:hover {
      color: var(--vefa-accent); /* Orange hover color */
  }

  /* Underline effect (animation 0→100% au hover) */
  .desktop-nav-links li a::after {
      content: '';
      position: absolute;
      width: 0;
      height: 2px;
      display: block;
      margin-top: 5px;
      right: 0;
      background: var(--vefa-accent);
      transition: width var(--vefa-duration-base) var(--vefa-ease-out);
  }

  .desktop-nav-links li a:hover::after {
      width: 100%;
      left: 0;
  }

  /* Make icon orange on hover too */
  .desktop-nav-links li a:hover i {
      color: var(--vefa-accent); 
  }

  .desktop-user-menu {
      /* Ensure user menu doesn't shrink */
      flex-shrink: 0;
      /* Push user menu to the far right */
      margin-left: auto;
      display: flex;
      align-items: center;
      gap: 12px;
      flex-wrap: nowrap;
  }

  /* Notifications bell and dropdown */
  .notifications-wrapper {
      position: relative;
      display: inline-block;
      margin-right: 0;
      flex: 0 0 auto;
  }
  .notifications-bell {
      position: relative;
      background: none;
      border: none;
      cursor: pointer;
      padding: 6px;
      color: #444;
      flex: 0 0 auto;
  }
  .notifications-bell .fa-bell {
      font-size: 20px;
      transition: color 0.2s ease;
  }
  .notifications-bell:hover .fa-bell {
      color: var(--vefa-accent);
  }
  .notifications-badge {
      position: absolute;
      top: 0px;
      right: 0px;
      transform: translate(40%, -40%);
      background: var(--vefa-accent);
      color: #fff;
      border-radius: 999px;
      font-size: 10px;
      line-height: 14px;
      min-width: 18px;
      height: 18px;
      padding: 0 4px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      font-weight: 700;
      box-shadow: 0 2px 4px rgba(255,64,0,0.25);
  }
  .notifications-dropdown {
      display: none;
      position: absolute;
      top: 120%;
      right: 0;
      width: 360px;
      max-height: 70vh;
      overflow: auto;
      background: #fff;
      border-radius: 10px;
      box-shadow: 0 8px 24px rgba(0,0,0,0.12);
      z-index: 1002;
  }
  .notifications-dropdown.show-dropdown {
      display: block;
      animation: fadeIn 0.2s ease-in-out;
  }
  .notifications-header {
      padding: 10px 12px;
      font-weight: 600;
      border-bottom: 1px solid rgba(0,0,0,0.06);
  }
  .notifications-list {
      list-style: none;
      margin: 0;
      padding: 0;
  }
  .notifications-item {
      padding: 10px 12px;
      border-bottom: 1px solid rgba(0,0,0,0.05);
  }
  .notifications-item:last-child {
      border-bottom: none;
  }
  .notifications-item--unread {
      background: var(--vefa-accent-soft);
  }
  .notifications-item--link {
      padding: 0;
      transition: background-color 0.15s ease;
  }
  .notifications-item--link:hover {
      background: rgba(0,0,0,0.04);
  }
  .notifications-item--link.notifications-item--unread:hover {
      background: var(--vefa-accent-soft);
  }
  .notifications-item-link {
      display: block;
      padding: 10px 12px;
      color: inherit;
      text-decoration: none;
  }
  .notifications-item-link:hover {
      color: inherit;
      text-decoration: none;
  }
  .notifications-item-title {
      font-weight: 600;
      color: #333;
      margin-bottom: 2px;
  }
  .notifications-item-message {
      color: #555;
      font-size: 0.92rem;
      margin-bottom: 4px;
  }
  .notifications-item-meta {
      color: #888;
      font-size: 0.85rem;
  }
  .notifications-empty {
      padding: 14px 12px;
      color: #666;
  }
  .notifications-footer {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      padding: 10px 12px;
      border-top: 1px solid rgba(0,0,0,0.06);
      position: sticky;
      bottom: 0;
      background: #fff;
  }
  .notifications-mark-all {
      border: none;
      background: transparent;
      color: var(--vefa-accent);
      font-weight: 600;
      cursor: pointer;
      padding: 6px 8px;
  }
  .notifications-mark-all:hover {
      text-decoration: underline;
  }
  .notifications-preferences {
      color: #555;
      text-decoration: none;
      font-weight: 500;
  }
  .notifications-preferences:hover {
      color: var(--vefa-accent);
  }

  /* Responsive: Mobile adjustments */
  @media (max-width: 767px) {
      .mobile-actions {
          display: inline-flex;
          align-items: center;
          gap: 10px;
      }
      .mobile-notifications .notifications-dropdown {
          position: fixed;
          top: 60px;
          right: 8px;
          left: 8px;
          width: auto;
          max-width: none;
          max-height: calc(100vh - 80px);
          border-radius: 12px;
      }
      .mobile-notifications .notifications-header {
          padding: 12px 14px;
          font-size: 1rem;
          position: sticky;
          top: 0;
          background: #fff;
          z-index: 1;
          border-radius: 12px 12px 0 0;
      }
      .mobile-notifications .notifications-item {
          padding: 12px 14px;
      }
      .mobile-notifications .notifications-item-message {
          font-size: 0.88rem;
          line-height: 1.4;
      }
      .mobile-notifications .notifications-item-title {
          font-size: 0.93rem;
          margin-bottom: 4px;
      }
      .mobile-notifications .notifications-item-meta {
          font-size: 0.8rem;
      }
      .mobile-notifications .notifications-footer {
          padding: 10px 14px;
          flex-wrap: wrap;
          gap: 6px;
      }
      .mobile-notifications .notifications-mark-all,
      .mobile-notifications .notifications-preferences {
          font-size: 0.9rem;
      }
      .notifications-bell .fa-bell {
          font-size: 18px;
      }
      .notifications-badge {
          transform: translate(35%, -35%);
          font-size: 9px;
          min-width: 16px;
          height: 16px;
      }
  }
  .desktop-user-menu .user-avatar-button {
    background: none;
    border: none;
    padding: 0;
      display: inline-flex;
    align-items: center;
    cursor: pointer;
      min-width: 0; /* allow content to shrink */
  }
  .desktop-user-menu .user-avatar {
      width: 36px;
      height: 36px;
      border-radius: 50%;
      margin-right: 0.5rem;
      flex: 0 0 auto;
  }
  .desktop-user-menu .username {
      /* Style username */
      font-weight: 500;
      margin-right: 0.25rem;
      max-width: 140px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
  }
  .desktop-user-menu .dropdown-caret {
      font-size: 0.8em;
      color: #777; /* Couleur plus subtile pour la flèche */
      transition: transform 0.2s ease, color 0.2s ease; /* Transition pour l'animation */
      margin-left: 3px; /* Petit espacement */
  }
  
  .desktop-user-menu .user-dropdown {
       position: relative; /* Needed for absolute positioning of menu */
       flex: 0 0 auto;
  }

  /* Animation de la flèche lorsque le menu est ouvert */
  .desktop-user-menu .user-dropdown-menu.show-dropdown + .user-avatar-button .dropdown-caret,
  .user-avatar-button:hover .dropdown-caret {
      transform: rotate(180deg); /* Rotation de la flèche */
      color: var(--vefa-accent); /* Couleur accent orange au survol */
  }

  .desktop-user-menu .user-dropdown-menu {
      display: none; /* Hide dropdown by default */
      position: absolute;
      top: 100%; /* Position below button */
      right: 0;
      background-color: white;
      border: none; /* Supprimer la bordure */
      border-radius: 8px; /* Coins plus arrondis */
      padding: 0.75rem 0;
      list-style: none;
      margin: 8px 0 0 0; /* Augmenter marge */
      min-width: 220px;
      z-index: 1001;
      box-shadow: 0 6px 16px rgba(0,0,0,0.08); /* Ombre plus douce et plus large */
  }

  .desktop-user-menu .user-dropdown-menu.show-dropdown {
      display: block; /* Show dropdown when class is added */
      animation: fadeIn 0.2s ease-in-out; /* Animation d'apparition */
  }

  @keyframes fadeIn {
      from { opacity: 0; transform: translateY(-5px); }
      to { opacity: 1; transform: translateY(0); }
  }

  /* Style des éléments du menu déroulant */
  .desktop-user-menu .user-dropdown-menu li a,
  .desktop-user-menu .user-dropdown-menu li button {
      display: flex;
      align-items: center;
      padding: 0.6rem 1rem;
      color: #444;
      text-decoration: none;
      transition: background-color 0.2s, color 0.2s;
      background: none;
      border: none;
      width: 100%;
      text-align: left;
      font-size: 0.95rem;
      cursor: pointer;
  }

  .desktop-user-menu .user-dropdown-menu li a:hover,
  .desktop-user-menu .user-dropdown-menu li button:hover {
      background-color: var(--vefa-accent-soft); /* Fond orange très léger au survol */
      color: var(--vefa-accent); /* Orange au survol */
  }

  .desktop-user-menu .user-dropdown-menu li a:hover i,
  .desktop-user-menu .user-dropdown-menu li button:hover i {
      color: var(--vefa-accent); /* Icône orange au survol */
  }

  .desktop-user-menu .user-dropdown-menu li hr {
      margin: 0.5rem 0;
      border: none;
      height: 1px;
      background: linear-gradient(to right, transparent, rgba(0, 0, 0, 0.08), transparent);
  }

  .desktop-login-btn {
     display: inline-flex;
     align-items: center;
     justify-content: center;
     padding: 0.5rem 1.2rem;
     background-color: var(--vefa-accent);
     color: white;
     font-weight: 500;
     border-radius: 8px;
     text-decoration: none;
     transition: all 0.3s ease;
     box-shadow: 0 2px 6px rgba(255, 64, 0, 0.2);
     font-size: 0.95rem;
  }

  .desktop-login-btn:hover {
     background-color: #e63a00;
     transform: translateY(-2px);
     box-shadow: 0 4px 8px rgba(255, 64, 0, 0.3);
     color: white;
     text-decoration: none;
  }
  
  .desktop-login-btn:active {
     transform: translateY(0);
     box-shadow: 0 2px 4px rgba(255, 64, 0, 0.2);
  }

  .desktop-login-btn i {
     margin-right: 6px;
  }

  /* --- Mobile Promoter Link (non-authenticated users) --- */
  .mobile-promoter-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 6px 12px;
    height: 36px;
    border-radius: 8px;
    background-color: transparent;
    border: 1.5px solid var(--vefa-accent);
    color: var(--vefa-accent);
    text-decoration: none;
    transition: all 0.2s ease;
    font-weight: 600;
    font-size: 0.85rem;
  }

  .mobile-promoter-link:hover,
  .mobile-promoter-link:active {
    background-color: var(--vefa-accent);
    color: white;
    text-decoration: none;
  }

  .mobile-promoter-link i {
    font-size: 14px;
  }

  /* --- Ensure Mobile view is hidden on desktop --- */
  @media (min-width: 768px) {
      .custom-navbar .mobile-view {
          display: none;
      }
      .mobile-nav-links-container {
          display: none !important; /* Ensure mobile nav links are hidden */
      }
  }
  
  /* Mobile view styling */
  @media (max-width: 767px) {
      .custom-navbar .desktop-view {
          display: none;
      }
      .custom-navbar .mobile-view {
          display: flex;
          align-items: center;
          justify-content: space-between;
          width: 100%;
          height: 50px;
      }
      .mobile-nav-links-container.show-mobile-nav {
          display: block !important;
      }
  }
  
  /* Add padding to the main navbar container */
  .custom-navbar .custom-container {
    padding-left: 1rem; 
    padding-right: 1rem; 
    width: 100%; /* Ensure it takes full width */
    max-width: 100%; /* Force la largeur maximale */
    margin: 0; /* Assure qu'il n'y a pas de marge */
  }
  
  /* Main navbar container */
  .custom-navbar {
    /* Remplacer la bordure du bas par une ligne plus élégante */
    border-bottom: none; /* Suppression de la bordure existante */
    position: relative; /* Pour le positionnement de la pseudo-élément */
    padding-top: 0.3rem; /* Réduire le padding (était 0.5rem) */
    padding-bottom: 0.3rem; /* Réduire le padding (était 0.5rem) */
    background-color: var(--navbar-bg-color, #f8f9fad1); /* Utilise la couleur grise définie */
    width: 100%; /* Assure la couverture totale */
    margin: 0; /* Pas de marge */
    box-sizing: border-box; /* Include padding dans la largeur */
  }
  
  /* Ajout d'une ligne élégante en bas de la navbar */
  .custom-navbar::after {
    content: '';
    position: absolute;
    bottom: 3px; /* Remonté pour être plus proche des éléments */
    left: 50%;
    transform: translateX(-50%);
    width: 98%; /* Un peu plus large */
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(0, 0, 0, 0.08), transparent);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03); /* Léger effet de relief */
  }

  /* Style pour le lien Espace Promoteur - avec bordure sur grands écrans */
  @media (min-width: 1100px) {
    .desktop-nav-links li a.promoter-link {
      color: #333 !important;
      padding: 0.35rem 0.75rem !important;
      border: 2px solid var(--vefa-accent);
      border-radius: 6px;
      font-weight: 500;
      transition: all 0.25s ease;
      background: transparent;
      box-sizing: border-box;
      display: inline-flex;
      align-items: center;
      line-height: 1.2;
      text-align: center;
    }

    .desktop-nav-links li a.promoter-link:hover {
      background: var(--vefa-accent);
      color: white !important;
    }

    .desktop-nav-links li a.promoter-link i {
      color: inherit !important;
      transition: color 0.25s ease;
    }

    /* Désactiver l'underline par défaut sur ce lien */
    .desktop-nav-links li a.promoter-link::after {
      display: none !important;
      content: none !important;
    }
  }

  /* Style pour le lien Espace Promoteur - sans bordure sur écrans moyens (768px-1100px) */
  @media (min-width: 768px) and (max-width: 1099px) {
    .desktop-nav-links li a.promoter-link {
      color: #333 !important;
      font-weight: 500;
    }
  }
  
  