header.bg-dark {
    background: rgba(10, 20, 45, 0.98) !important;
    box-shadow: 0 2px 18px 0 rgba(127,216,255,0.10), 0 0 24px #7fd8ff33;
}

/* Header flottant : plus de fond, plus de logo, seul le menu ruche est
   visible, posé au-dessus du contenu de la page (comme un bouton flottant). */
header.portal-header-floating {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100%;
    background: transparent !important;
    box-shadow: none !important;
    /* Le header ne doit intercepter aucun clic/scroll sur la page en dessous,
       sauf sur ses propres éléments interactifs (menu, bouton burger). */
    pointer-events: none;
}

.portal-header-floating .navbar-toggler,
.portal-header-floating .hex-menu {
    pointer-events: auto;
}

/* Header normal sur desktop, fixe seulement sur mobile */
.portal-header {
    position: relative;
    width: 100%;
    z-index: 1050;
    margin: 0;
}

.navbar {
    background: transparent !important;
}

/* Pas de padding sur desktop par défaut */
@media (min-width: 768px) {
    body {
        padding-top: 0 !important;
    }
    
    .portal-header {
        position: relative !important;
    }
}

/* Header fixe + padding sur mobile UNIQUEMENT */
@media (max-width: 767px) {
    .portal-header {
        position: fixed !important;
        top: 0 !important;
    }
    
    body:not(.no-header-padding) {
        padding-top: 70px !important;
    }
}

.navbar-brand span {
    color: #b2eaff;
    text-shadow: 0 0 8px #7fd8ff, 0 0 5px #0a223a;
    letter-spacing: 1px;
}

.navbar-brand img {
    width:30%;
    height: auto;
}

.navbar-nav {
    gap: 0 !important;
}

.navbar-nav .nav-item {
  margin: 0 !important;
  padding: 0 !important;
  /* Réduit l'espace entre les boutons */
}

.navbar-nav .nav-item:last-child {
    margin-right: 0 !important;
}

.navbar-nav .nav-link {
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding: 0 !important;
    color: #b2eaff !important;
    font-weight: 500;
    font-family: 'EB Garamond', serif;
    font-size: 1.08em;
    transition: color 0.2s, text-shadow 0.2s;
    text-shadow: 0 0 6px #7fd8ff22;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    color: #fffbe7 !important;
    text-shadow: 0 0 12px #7fd8ff, 0 0 8px #0a223a;
}

.navbar-nav .nav-item {
    margin: 0 !important;
    padding: 0 !important;
}

.navbar-nav .nav-link img {
  height: 106px !important;
  width: auto !important;
  display: block;
  margin: 0;
  padding: 0;
  border-radius: 0;
  box-shadow: none;
  border: none;
  transition: filter 0.12s, transform 0.12s;
  cursor: pointer;
}

/* Effet bouton au clic souris */
.navbar-nav .nav-link img:active {
    filter: brightness(0.85) drop-shadow(0 0 8px #7fd8ff88);
    transform: scale(0.93);
}

.navbar-toggler {
    border-color: #7fd8ff;
    background: rgba(10,34,58,0.7);
}

.navbar-toggler-icon {
    background-image: linear-gradient(90deg, #7fd8ff 0%, #b2eaff 100%);
    border-radius: 2px;
}

header .rounded-circle {
    border: 2px solid #7fd8ff88;
    box-shadow: 0 0 8px #7fd8ff44;
    background: #0a223a;
}

header .text-light {
    color: #b2eaff !important;
    font-weight: 600;
    text-shadow: 0 0 6px #7fd8ff44;
}

.mode-switch {
    position: fixed;
    left: 20px;
    bottom: 20px;
    z-index: 3000;
    background: rgba(10,34,58,0.85);
    color: #b2eaff;
    border: 2px solid #7fd8ff;
    border-radius: 8px;
    padding: 8px 18px;
    font-family: 'EB Garamond', serif;
    font-size: 1.05em;
    box-shadow: 0 0 12px #7fd8ff44;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}
.mode-switch:hover {
    background: #7fd8ff;
    color: #0a223a;
    box-shadow: 0 0 18px #b2eaff88;
}

.hex-menu {
    position: relative;
    width: 100%;
    height: auto;
    margin: 0 auto;
    pointer-events: auto;
}

/* Position du menu ruche dans le header, contrôlée par $hexMenuPosition
   (voir header.php) : 'right' (défaut), 'left' ou 'center'. */
.hex-menu-pos-left .hex-menu {
    margin-left: 0;
    margin-right: auto;
}

.hex-menu-pos-center .hex-menu {
    margin-left: auto;
    margin-right: auto;
}

.hex-menu-pos-right .hex-menu {
    margin-left: auto;
    margin-right: 0;
}

.hex-menu .navbar-nav {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: auto;
    position: static;
    margin: 0;
    padding: 0;
    pointer-events: auto;
}

.hex-btn {
    position: static;
    margin: 0 4px !important; /* espace horizontal entre les boutons */
    padding: 0 !important;
    pointer-events: auto;
    position: relative;
}

/* Supprime les positionnements personnalisés */
/* .hex-btn-accueil, .hex-btn-personnages, etc. : à retirer ou laisser vide */

/* Taille réelle affichée des boutons */
.hex-btn img {
    width: auto !important;
    height: 80px !important;
    object-fit: contain;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent;
    box-shadow: none;
    border: none;
}

/* Import de la police personnalisée si besoin */
@font-face {
    font-family: 'Houstonville';
    src: url('/styles/font/Houstonville.otf') format('truetype');
    font-display: swap;
}

/* Conteneur pour le label */
.hex-btn {
    position: relative;
}

/* Label caché par défaut */
.hex-btn-label {
    display: none;
    position: absolute;
    top: -36px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(10,34,58,0.92);
    color: #b2eaff;
    padding: 4px 16px;
    border-radius: 8px;
    font-family: 'ImaginariumFont', 'EB Garamond', serif;
    font-size: 1.1em;
    white-space: nowrap;
    pointer-events: none;
    z-index: 10;
    box-shadow: 0 2px 8px #7fd8ff44;
    text-shadow: 0 0 6px #7fd8ff44;
    border: 1px solid #7fd8ff88;
}

/* Affiche le label au survol */
.hex-btn:hover .hex-btn-label,
.hex-btn:focus-within .hex-btn-label {
    display: block;
}

/* === RESPONSIVE - TABLETTES === */
@media (max-width: 991px) and (min-width: 768px) {
  .hex-menu .navbar-nav {
    flex-wrap: wrap;
    justify-content: center;
  }

  .hex-btn {
    margin: 0.3em 2px !important;
  }

  .hex-btn img {
    height: 60px !important;
  }

  .hex-btn-label {
    font-size: 0.9em;
  }
}

/* === RESPONSIVE - PETITS ÉCRANS === */
@media (max-width: 1200px) and (min-width: 992px) {
  .hex-btn {
    margin: 0 2px !important;
  }

  .hex-btn img {
    height: 70px !important;
  }
}

/* === PREMIUM NAV ICON === */
.hex-btn-premium {
  position: relative;
}

/* Afficher un icône de secours si l'image de messages privés n'est pas disponible */
.hex-btn-messages .nav-fallback-icon {
  display: none;
}

/* Marges négatives uniquement sur desktop pour l'effet visuel souhaité */
@media (min-width: 768px) {
  .navbar-nav .nav-item {
    margin-right: -18px !important;
  }
  .navbar-nav .nav-link img {
    margin-right: -18px !important;
  }
}

.hex-btn-premium .nav-link {
  display: flex;
  align-items: center;
  justify-content: center;
}

.premium-nav-icon {
  font-size: 1.8rem;
  color: #f59e0b;
  filter: drop-shadow(0 0 8px rgba(245, 158, 11, 0.6));
  transition: all 0.3s ease;
  animation: premium-pulse 2s infinite;
}

.hex-btn-premium:hover .premium-nav-icon {
  color: #fbbf24;
  filter: drop-shadow(0 0 12px rgba(245, 158, 11, 0.9));
  transform: scale(1.1);
}

@keyframes premium-pulse {
  0%, 100% {
    filter: drop-shadow(0 0 8px rgba(245, 158, 11, 0.5));
  }
  50% {
    filter: drop-shadow(0 0 15px rgba(245, 158, 11, 0.9));
  }
}

@media (max-width: 767px) {
  .premium-nav-icon {
    font-size: 1.5rem;
  }
}

/* Style pour la vignette de profil dans le header */
.hex-btn-profile .profile-nav-img {
  width: 44px !important;
  height: 44px !important;
  object-fit: cover !important;
  border-radius: 50% !important;
  border: 2px solid rgba(127,216,255,0.18) !important;
  box-shadow: 0 2px 8px rgba(127,216,255,0.12) !important;
}

@media (max-width: 767px) {
  .hex-btn-profile .profile-nav-img {
    width: 40px !important;
    height: 40px !important;
  }
}

/* Hexagon avatar */
.hex-btn-profile .profile-nav-hex {
  display: inline-block;
  position: relative;
}

/* Faire correspondre la hauteur de l'avatar à celle des boutons `.hex-btn img` */
.hex-btn-profile .profile-nav-hex img.profile-nav-img {
  width: auto !important;
  object-fit: cover !important;
  -webkit-clip-path: polygon(25% 6%, 75% 6%, 100% 50%, 75% 94%, 25% 94%, 0% 50%);
  clip-path: polygon(25% 6%, 75% 6%, 100% 50%, 75% 94%, 25% 94%, 0% 50%);
  border: 2px solid rgba(127,216,255,0.18);
  box-shadow: 0 2px 8px rgba(127,216,255,0.12);
  display: block;
}

/* Desktop (large) : utiliser la même hauteur que .navbar-nav .nav-link img (106px) */
@media (min-width: 1200px) {
  .hex-btn-profile .profile-nav-hex img.profile-nav-img {
    height: 106px !important;
  }
}

/* Large screens (992 - 1199px) : 70px */
@media (min-width: 992px) and (max-width: 1199px) {
  .hex-btn-profile .profile-nav-hex img.profile-nav-img {
    height: 70px !important;
  }
}

/* Tablet (768 - 991px) : 60px */
@media (min-width: 768px) and (max-width: 991px) {
  .hex-btn-profile .profile-nav-hex img.profile-nav-img {
    height: 60px !important;
  }
}

/* Mobile: utiliser la taille définie dans responsive.css (50px) ou 44px par défaut */
@media (max-width: 767px) {
  .hex-btn-profile .profile-nav-hex img.profile-nav-img {
    height: 50px !important;
  }
}

/* Forcer la largeur de l'enveloppe hexagonale à être égale à la hauteur */
@media (min-width: 1200px) {
  .hex-btn-profile .profile-nav-hex { width: 106px; height: 106px; }
}

@media (min-width: 992px) and (max-width: 1199px) {
  .hex-btn-profile .profile-nav-hex { width: 70px; height: 70px; }
}

@media (min-width: 768px) and (max-width: 991px) {
  .hex-btn-profile .profile-nav-hex { width: 60px; height: 60px; }
}

@media (max-width: 767px) {
  .hex-btn-profile .profile-nav-hex { width: 50px; height: 50px; }
}

/* Badge overlay position on the hexagon */
.hex-btn-profile .profile-notif-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: #ff6b6b;
  color: #fff;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 10px;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  z-index: 2000;
}

/* Badge pour le bouton Messages privés (petit marqueur au-dessus de l'enveloppe) */
.hex-btn-messages .pm-notif-badge,
.hex-btn-messages #pm-notif-badge {
  position: absolute;
  top: -8px;
  right: 6px;
  background: #ff6b6b;
  color: #fff;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: 10px;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  z-index: 2000;
}

/* Copier bordure et ombre des autres boutons du header */
.hex-btn-profile .profile-nav-hex {
  background: transparent;
  border: 1px solid rgba(127,216,255,0.3);
  box-shadow: 0 2px 8px rgba(127,216,255,0.12);
  transition: transform 0.18s ease, box-shadow 0.2s ease;
  border-radius: 8px; /* arrondi léger pour le conteneur hex */
}

/* Animation à l'arrivée d'une notification */
.profile-notif-anim {
  animation: profileNotifPulse 1.6s ease-in-out;
}

@keyframes profileNotifPulse {
  0% { transform: scale(1); box-shadow: 0 2px 8px rgba(127,216,255,0.12); }
  30% { transform: scale(1.08); box-shadow: 0 6px 20px rgba(127,216,255,0.28); }
  60% { transform: scale(0.98); box-shadow: 0 3px 10px rgba(127,216,255,0.16); }
  100% { transform: scale(1); box-shadow: 0 2px 8px rgba(127,216,255,0.12); }
}

@media (max-width: 767px) {
  .hex-btn-profile .profile-nav-hex { width: 44px; height: 50px; }
  .hex-btn-profile .profile-notif-badge { top: -5px; right: -5px; min-width:18px; height:18px; font-size:0.65rem; }
}
