/* Header membre NoyzHub
   -------------------------------------------------- */
:root{
  --nh-main-width: 1200px; /* largeur officielle de la colonne principale */
}
html { overflow-y: scroll; }

.nh-header-top{
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(245,247,251,.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(148,163,184,.25);
}

/* Conteneur centré sur la colonne principale (pas la sidebar) */
.nh-header-inner{
  max-width: var(--nh-main-width);
  margin: 0 auto;
  padding: 10px 24px;
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(260px,520px) minmax(0,1fr);
  align-items: center;
  column-gap: 16px;
}

/* Colonne gauche : titre de la page */
.nh-header-title{
  justify-self: flex-start;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: #6b7280;
  white-space: nowrap;
}

/* Colonne centre : barre de recherche, toujours centrée */
.nh-header-search{
  justify-self: center;
  width: 100%;
  max-width: 520px;
  display: flex;
  align-items: stretch;
  background: #ffffff;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 8px 20px rgba(15,23,42,.06);
  overflow: hidden;
}

.nh-header-search input{
  flex: 1;
  border: none;
  padding: 8px 14px 8px 16px;
  font-size: 14px;
  color: #0f172a;
  background: transparent;
}

.nh-header-search input::placeholder{
  color: #9ca3af;
}

.nh-header-search button{
  border: none;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 999px;
  margin: 3px;
  background: #020617;
  color: #f9fafb;
  cursor: pointer;
  white-space: nowrap;
}

.nh-header-search button:hover{
  background: #020617;
  opacity: .92;
}

/* Colonne droite : user */
.nh-header-user{
  justify-self: flex-end;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 260px;
}

.nh-header-avatar{
  width: 32px;
  height: 32px;
  border-radius: 999px;
  object-fit: cover;
  border: 2px solid rgba(148,163,184,.45);
  background: #e5e7eb;
  flex-shrink: 0;
}

/* Fallback si pas d’avatar */
.nh-header-avatar.is-fallback{
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  color: #111827;
}

.nh-header-user-meta{
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.nh-header-user-name{
  font-size: 13px;
  font-weight: 600;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nh-header-user-email{
  font-size: 11px;
  color: #6b7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Responsif : sous ~900px on passe en 2 lignes mais propre */
@media (max-width: 980px){
  .nh-header-inner{
    grid-template-columns: minmax(0,1fr) minmax(0,1fr);
    grid-template-areas:
      "title user"
      "search search";
    row-gap: 8px;
  }
  .nh-header-title{ grid-area: title; }
  .nh-header-search{ grid-area: search; }
  .nh-header-user{ grid-area: user; }
}

@media (max-width: 640px){
  .nh-header-inner{
    grid-template-areas:
      "title user"
      "search search";
  }

  .nh-header-title{ grid-area: title; }
  .nh-header-search{ grid-area: search; }
  .nh-header-user{ 
    grid-area: user;
    justify-self: flex-end !important;
  }
}


/* ===== Suggestions de recherche ===== */
.nh-header-search-wrap{
  position: relative;
  width: 100%;
  max-width: 520px;
}

.nh-search-suggestions{
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  background: #ffffff;
  border-radius: 18px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 18px 40px rgba(15,23,42,.18);
  padding: 4px 0;
  z-index: 40;
  max-height: 360px;
  overflow-y: auto;
}
.nh-search-suggestions[hidden]{ display:none !important; }

.nh-search-item{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  padding:6px 12px;
  cursor:pointer;
  font-size:13px;
}
.nh-search-item-main{
  display:flex;
  flex-direction:column;
  min-width:0;
}
.nh-search-item-label{
  font-weight:500;
  color:#111827;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.nh-search-item-sub{
  font-size:11px;
  color:#6b7280;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.nh-search-item-type{
  font-size:11px;
  text-transform:uppercase;
  letter-spacing:.12em;
  color:#9ca3af;
  flex-shrink:0;
  margin-left:6px;
}
.nh-search-item:hover{
  background:#f3f4ff;
}
/* --- Dropdown recherche riche --- */

.nh-search-item{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:8px 12px;
  gap:12px;
}

.nh-search-item-left{
  display:flex;
  align-items:center;
  gap:10px;
  min-width:0;
}

/* Carré logo + wallpaper (même esprit que explore) */
.nh-search-item-logo{
  width:36px;
  height:36px;
  border-radius:12px;
  position:relative;
  overflow:hidden;
  flex-shrink:0;

  background:linear-gradient(135deg,#e5edff,#f5f7ff);
  border:1px solid #e5e7eb;

  display:flex;
  align-items:center;
  justify-content:center;
}

/* Couche wallpaper optionnelle */
.nh-search-item-logo-bg{
  position:absolute;
  inset:0;
  background-size:cover;
  background-position:center;
  opacity:.9;
}

/* Logo centré par-dessus */
.nh-search-item-logo img{
  position:relative;
  z-index:1;
  display:block;
  width:80%;
  height:80%;
  object-fit:contain;
}

/* Variante pour les avatars utilisateurs : remplissent toute la case */
.nh-search-item-logo.nh-search-item-logo-user img{
  width:100%;
  height:100%;
  object-fit:cover;
}

.nh-search-item-text{
  display:flex;
  flex-direction:column;
  gap:2px;
  min-width:0;
}

.nh-search-item-label{
  font-size:14px;
  font-weight:500;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

/* Ligne meta : flag + ville + style */
.nh-search-item-meta{
  display:flex;
  align-items:center;
  gap:4px;
  font-size:12px;
  color:#6b7280;            /* gris neutre */
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

/* Flag un poil discret */
.nh-search-item-flag{
  width:14px;
  height:10px;
  border-radius:2px;
  object-fit:cover;
  box-shadow:0 0 0 1px rgba(15,23,42,.15);
  flex-shrink:0;
}

/* Ville */
.nh-search-location{
  font-weight:500;          /* un chouïa plus forte que le style */
  max-width:120px;
  overflow:hidden;
  text-overflow:ellipsis;
}

/* Style = texte simple avec point séparateur */
.nh-search-style-pill{
  padding:0;
  margin:0;
  border:none;
  background:none;
  font-size:12px;
  color:#6b7280;
  max-width:260px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

/* Petit séparateur " · " avant le style */
.nh-search-style-pill::before{
  content:"·";
  margin:0 4px;
}


.nh-search-item-type{
  flex-shrink:0;
}

.nh-search-item-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:11px;
  padding:2px 8px;
  border-radius:999px;
  border:1px solid transparent;
  text-transform:uppercase;
  letter-spacing:.08em;
}

/* Couleurs déjà définies côté projet
   (tu peux les déplacer ici si besoin) */
.badge-artist   { background:#e0ecff; border-color:#bfdbfe; color:#1e40af; }
.badge-festival { background:#f5e8ff; border-color:#e9d5ff; color:#6b21a8; }
.badge-label    { background:#e7fbe9; border-color:#bbf7d0; color:#166534; }
.badge-orga     { background:#fff4e6; border-color:#fed7aa; color:#9a3412; }
.badge-venue    { background:#e6f7ff; border-color:#bae6fd; color:#0c4a6e; }
.badge-media    { background:#fee2e2; border-color:#fecaca; color:#991b1b; }
.badge-default  { background:#eef2f7; border-color:#e5e7eb; color:#334155; }

.nh-search-item-style-row{
  margin-top: 2px;
}

/* Noizers (utilisateurs) */
.badge-user{
  background:#fdf2ff;
  border-color:#f5d0fe;
  color:#a21caf;
}

.nh-header-user{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:12px;
}

/* Bouton cloche */
.nh-header-notify{
  position:relative;
  width:34px;
  height:34px;
  border-radius:999px;
  border:none;
  padding:0;
  background:rgba(148,163,184,0.06);
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  transition:background 0.15s ease, transform 0.1s ease;
}

.nh-header-notify:hover{
  background:rgba(148,163,184,0.16);
  transform:translateY(-1px);
}

.nh-header-notify:active{
  transform:translateY(0);
}

.nh-header-notify-icon{
  width:18px;
  height:18px;
  fill:#64748b; /* gris bleuté */
}

/* Pastille rouge */
.nh-header-notify-badge{
  position:absolute;
  top:2px;
  right:3px;
  min-width:16px;
  height:16px;
  padding:0 4px;
  border-radius:999px;
  background:#ef4444;
  color:#fff;
  font-size:10px;
  font-weight:600;
  display:flex;
  align-items:center;
  justify-content:center;
  box-shadow:0 0 0 2px #f5f7fb; /* petit contour clair pour bien détacher */
}

/* -------- Notifications pop-in header -------- */

.nh-header-notify-wrap{
  position: relative;
  margin-right: 10px; /* petit espace avant l’avatar */
}

.nh-header-notify-panel{
  position: absolute;
  top: 115%;
  right: 0;
  width: 340px;
  max-height: 420px;
  overflow-y: auto;
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid rgba(148,163,184,.25);
  box-shadow: 0 18px 45px rgba(15,23,42,.18), 0 10px 25px rgba(15,23,42,.12);
  z-index: 50;
}

/* Mobile : panneau de notifications en plein écran (ou presque) */
@media (max-width: 640px){
  .nh-header-notify-panel{
    position: fixed;
    top: 72px;          /* ajuste si tu veux plus haut/bas */
    left: 12px;
    right: 12px;
    width: auto;
    max-width: none;
    max-height: calc(100vh - 90px);  /* scroll interne si long */
  }
}


.nh-notify-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:10px 14px;
  border-bottom:1px solid rgba(148,163,184,.25);
  font-size:13px;
  font-weight:600;
  color:#0f172a;
}

.nh-notify-close{
  border:none;
  background:transparent;
  cursor:pointer;
  font-size:16px;
  line-height:1;
  color:#9ca3af;
}

.nh-notify-list{
  padding:8px 6px 8px 6px;
}

.nh-notify-empty{
  padding:12px 14px;
  font-size:13px;
  color:#9ca3af;
}

/* Une notif */
.nh-notify-item{
  display:flex;
  align-items:flex-start;
  gap:10px;
  padding:8px 10px;
  border-radius:12px;
  cursor:pointer;
}

.nh-notify-item:hover{
  background:rgba(248,250,252,1);
}

.nh-notify-avatar{
  flex:0 0 auto;
  width:32px;
  height:32px;
  border-radius:999px;
  overflow:hidden;
  background:#e5e7eb;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:14px;
  font-weight:600;
  color:#4b5563;
}

.nh-notify-avatar img{
  width:100%;
  height:100%;
  object-fit:cover;
}

.nh-notify-main{
  min-width:0;
  flex:1 1 auto;
}

.nh-notify-title{
  font-size:13px;
  font-weight:600;
  margin-bottom:2px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.nh-notify-text{
  font-size:13px;
  color:#6b7280;
}

.nh-notify-meta{
  font-size:11px;
  color:#9ca3af;
  margin-top:2px;
}

/* Mobile : on garde juste l'avatar dans le header */
@media (max-width: 640px){
  .nh-header-user-meta{
    display: none;
  }
}
/* Mobile : aligner cloche + avatar complètement à droite */
@media (max-width: 640px){
  .nh-header-user{
    justify-self: flex-end !important;
  }
}

/* ============================================
   Fix mobile : header user + notifs
   ============================================ */
@media (max-width: 768px) {
  /* Le header en 3 colonnes : titre / notif / avatar */
  .nh-header-inner{
    max-width: 100%;
    grid-template-columns: minmax(0,1fr) auto auto;
    column-gap: 8px;
  }

  /* On masque le nom pour gagner de la place */
  .nh-header-user-name{
    display: none;
  }

  /* Regrouper cloche + avatar à droite */
  .nh-header-user,
  .nh-header-notify-wrap{
    justify-self: flex-end;
  }

  /* On évite les débordements horizontaux */
  .nh-header-top{
    overflow-x: hidden;
  }
}
