/* ========================================
   🧭 HEADER SNAPZONE
   Namespace: .site-*
======================================== */

/* Appliquer Gabarito au header */
.site-header,
.site-header .nav-item,
.site-header .nav-item span {
  font-family: var(--font-family-base);
}

/* ========= Header principal ========= */

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: linear-gradient(180deg, var(--color-header-gradient-start) 0%, var(--color-header-gradient-end) 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.25rem;
  box-shadow: var(--shadow-card), 0 1px 0 rgba(255, 255, 255, 0.05) inset;
  border-bottom: 1px solid var(--glass-border);
}

/* Status de connexion */
.header-connection-status {
  display: none;
  flex: 1;
  justify-content: center;
  color: var(--color-success);
  font-weight: 700;
  font-size: var(--font-size-sm);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}

.header-connection-status.is-visible {
  display: flex;
  align-items: center;
  justify-content: center;
}

.header-connection-status.is-disconnected {
  color: var(--color-text-muted, #888);
  font-weight: 500;
}

/* Logo */
.site-logo img {
  height: 40px;
  width: auto;
  display: block;
}

/* 📱 Logo mobile - ajuster la valeur pour réduire/agrandir */
@media (max-width: 768px) {
  .site-logo img {
    height: 32px; /* ← Modifier cette valeur (ex: 28px pour plus petit, 36px pour plus grand) */
  }
}

/* ========= Burger menu ========= */

.site-burger {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: var(--glass-bg);
  cursor: pointer;
}

.site-burger span {
  display: block;
  height: 2px;
  width: 22px;
  background: var(--color-white);
  margin: 0 auto;
  transition: transform 0.25s ease, opacity 0.2s ease, width 0.2s ease;
}

.site-burger:focus-visible {
  outline: 2px solid var(--color-success);
  outline-offset: 2px;
}

/* ========= Navigation menu ========= */

.site-nav[hidden] {
  display: none !important;
}

.site-nav {
  position: absolute;
  top: calc(100% + 8px);
  right: 10px;
  background: var(--color-nav-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-elevated);
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  min-width: 200px;
}

.site-nav a {
  color: var(--color-white);
  text-decoration: none;
  padding: var(--space-sm) var(--space-md);
  min-height: 44px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: var(--font-size-base);
  display: flex;
  align-items: center;
}

.site-nav a:hover {
  background: rgba(255, 255, 255, 0.08);
}

/* ========= Desktop: menu inline ========= */

@media (min-width: 769px) {
  .site-burger {
    display: none;
  }

  .site-nav {
    position: static;
    display: flex !important;
    flex-direction: row;
    gap: 0.25rem;
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 0;
    min-width: 0;
  }

  .site-nav[hidden] {
    display: flex !important;
  }

  .site-nav a:hover {
    background: rgba(255, 255, 255, 0.12);
  }
}

/* Empêcher le scroll quand menu ouvert sur mobile */
body.no-scroll {
  overflow: hidden;
}

/* ========= Icônes du header ========= */

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  color: var(--color-white);
  text-decoration: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.nav-item:hover {
  opacity: 0.85;
  transform: translateY(-1px);
}

.nav-item i {
  display: inline-block;
  width: 18px;
  height: 18px;
  background-color: var(--color-white);
  mask-size: cover;
  mask-repeat: no-repeat;
  mask-position: center;
}

/* Icône Accueil */
.icon-home {
  mask-image: url("../assets/icons/maison.svg");
}

/* Icône Succès */
.icon-trophy {
  mask-image: url("../assets/icons/trophee-etoile.svg");
}

/* Icône Profil */
.icon-user {
  mask-image: url("../assets/icons/user.svg");
}

/* Icône Guide */
.icon-guide {
  mask-image: url("../assets/icons/guide.svg");
}
