/* NX_HEADER_UNIFIED_V4: align with index.php (home page) header.
   Uses header.nx-site-header prefix for max specificity (0.2.1)
   to beat premium_style.css .brand .brand-icon (0.2.0) and similar.
   ======================================== */

/* ── Outer wrapper (match index.php L198-200 + L690) ── */
header.nx-site-header {
  width: 100%;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 8000;
  overflow: visible;
  background: rgba(11,11,24,.78);
  border-bottom: 1px solid rgba(217,74,111,.14);
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  isolation: isolate;
  padding-top: 0 !important;
}

/* Rose edge divider (match index.php L81-82) */
header.nx-site-header::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(217,74,111,.45), transparent);
  pointer-events: none;
  z-index: 0;
  display: block !important;
}

/* ── Topbar (match index.php L203-204) ── */
header.nx-site-header .topbar {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 14px 18px !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  position: relative;
  z-index: 1;
}

/* ── Brand (match index.php L207-211 + L690) ── */
header.nx-site-header .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  text-decoration: none;
  color: var(--ink, #e4e4f0);
}

/* ── Brand icon (match index.php L213-221 then L693-703) ── */
header.nx-site-header .brand-icon {
  width: 34px !important;
  height: 34px !important;
  min-width: 34px !important;
  flex: 0 0 34px !important;
  aspect-ratio: 1 / 1 !important;
  display: grid !important;
  place-items: center !important;
  line-height: 1 !important;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--rose, #d94a6f), var(--rose-light, #f09aaf));
  font-family: var(--font-heading, Poppins, system-ui, sans-serif);
  font-size: 14px !important;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(217,74,111,.22);
  flex: none;
}

/* ── Brand title h1 (match index.php L227-232) ── */
header.nx-site-header .brand-title,
header.nx-site-header .brand h1 {
  margin: 0;
  font-family: var(--font-heading, Poppins, system-ui, sans-serif);
  font-size: 18px !important;
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -.01em;
  background: linear-gradient(135deg, var(--rose-light, #f09aaf) 0%, var(--rose, #d94a6f) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Brand subtitle (match index.php L234-236 + L710) ── */
header.nx-site-header .brand-subtitle {
  font-family: var(--font-heading, Poppins, system-ui, sans-serif);
  color: #aeb8c7 !important;
  font-size: 13px !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Navigation (right side) ── */
header.nx-site-header .nav {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: nowrap;
  margin-left: auto;
  flex: 0 1 auto;
  position: relative;
  z-index: 80;
}

/* ── Back link (keep lightweight, don't add height) ── */
header.nx-site-header .ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 8px;
  font-family: var(--font-heading, Poppins, system-ui, sans-serif);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  text-decoration: none;
  color: rgba(255,255,255,.45);
  line-height: 1;
  min-height: 0;
  height: auto;
  border-radius: 999px;
  transition: color .2s ease;
}
header.nx-site-header .ghost:hover {
  color: var(--rose-light, #f09aaf);
}

/* ── Account pill: structural only (border/background/shadow delegated to auth_style.css per account type) ── */
header.nx-site-header .account {
  position: relative;
  z-index: 90;
}

header.nx-site-header .account-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 4px 11px 4px 5px !important;
  min-height: 42px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-family: var(--font-ui, "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);
  font-size: 14px;
  font-weight: 650;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  color: var(--ink, #e4e4f0) !important;
  cursor: pointer;
  transition:
    background .2s ease,
    border-color .2s ease,
    box-shadow .2s ease,
    filter .2s ease,
    transform .18s ease,
    color .2s ease;
}


header.nx-site-header .premium-account .account-pill:hover {
  background: rgba(251, 191, 36, 0.16) !important;
  border-color: rgba(251, 191, 36, 0.78) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.10),
    0 0 0 1px rgba(251,191,36,.18),
    0 10px 26px rgba(251,191,36,.10) !important;
  filter: brightness(1.06);
  transform: translateY(-1px);
}

header.nx-site-header .normal-account .account-pill:hover {
  background: rgba(148, 163, 184, 0.18) !important;
  border-color: rgba(226, 232, 240, 0.58) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.10),
    0 0 0 1px rgba(226,232,240,.14),
    0 10px 26px rgba(15,23,42,.16) !important;
  filter: brightness(1.06);
  transform: translateY(-1px);
}

header.nx-site-header .account-pill:hover .account-name {
  color: #ffffff !important;
}
header.nx-site-header .account-name {
  font-family: var(--font-ui, "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);
  font-size: 14px;
  font-weight: 650;
  line-height: 1;
  color: inherit;
  letter-spacing: normal;
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

header.nx-site-header .account-caret {
  position: relative;
  display: inline-block;
  width: 14px;
  height: 14px;
  color: #aeb8c7;
  flex: 0 0 14px;
  transition: color .2s ease, transform .2s ease;
}

header.nx-site-header .account-caret::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 5px 0 currentColor, 0 5px currentColor, 5px 5px currentColor;
}

header.nx-site-header .account[open] .account-caret {
  color: #fff;
  transform: rotate(45deg);
}


/* ── Guest pills (match index.php L240-250) ── */
header.nx-site-header .nav .pill:not(.account-pill) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid rgba(217,74,111,.16) !important;
  background: rgba(255,255,255,.05) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04) !important;
  font-family: var(--font-ui, "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);
  font-size: 14px;
  font-weight: 650;
  white-space: nowrap;
  text-decoration: none;
  color: var(--ink, #e4e4f0) !important;
  transition: background .2s, border-color .2s, transform .18s ease;
}
header.nx-site-header .nav .pill:not(.account-pill):not(.primary):hover,
header.nx-site-header .nav a.pill:not(.account-pill):not(.primary):hover {
  color: #fff1f2 !important;
  background: rgba(244, 63, 94, 0.16) !important;
  border-color: rgba(251, 113, 133, 0.48) !important;
  transform: translateY(-1px);
}

header.nx-site-header .nav .pill:not(.account-pill).primary {
  background: linear-gradient(135deg, var(--rose, #d94a6f), #b03a5b) !important;
  border-color: transparent !important;
  color: #fff !important;
  box-shadow: 0 4px 16px rgba(217,74,111,.28) !important;
}
header.nx-site-header .nav .pill:not(.account-pill).primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(217,74,111,.36) !important;
}

/* ── Mobile: ≤760px (match index.php L484-498 + L760) ── */
@media (max-width: 760px) {
  header.nx-site-header .topbar {
    padding: 10px 14px 12px !important;
    align-items: center !important;
    gap: 10px !important;
  }

  header.nx-site-header .brand {
    gap: 9px !important;
    flex: 1 1 auto;
  }

  header.nx-site-header .brand-icon {
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    flex-basis: 34px !important;
  }

  header.nx-site-header .brand-title {
    font-size: 18px !important;
    line-height: 1.08 !important;
    white-space: nowrap !important;
  }

  header.nx-site-header .brand-subtitle {
    display: none !important;
  }

  header.nx-site-header .nav {
    gap: 8px !important;
  }

  header.nx-site-header .ghost {
    padding: 4px 6px;
    font-size: 11px;
  }

  header.nx-site-header .nav .pill:not(.account-pill),
  header.nx-site-header .account-pill {
    min-height: 36px !important;
    padding: 0 13px !important;
    font-size: 13px !important;
  }

  header.nx-site-header .account-pill {
    padding: 4px 11px 4px 5px !important;
  }

  header.nx-site-header .account-name {
    max-width: 92px;
  }


}

/* ── Mobile narrow: ≤480px ── */
@media (max-width: 480px) {
  header.nx-site-header .topbar {
    gap: 8px !important;
  }

  header.nx-site-header .brand-icon {
    width: 34px !important;
    height: 34px !important;
    flex-basis: 34px !important;
  }

  header.nx-site-header .brand-title {
    font-size: 16px !important;
  }

  header.nx-site-header .ghost {
    font-size: 10px;
    padding: 2px 4px;
  }

  header.nx-site-header .account-pill {
    max-width: 150px;
  }

  header.nx-site-header .account-name {
    max-width: 56px;
  }
}
