/* ==========================================================================
   JackWasHere — shared site navbar
   One floating glass bar: brand + auth on the left, links (with a sliding
   "spotlight" highlight) on the right, collapsing into a glass dropdown
   panel on mobile. Shared across all top-level pages via <link>/<script>.
   ========================================================================== */

.jwh-navbar {
  position: fixed;
  top: 16px;
  left: 50%;
  width: min(1180px, calc(100% - 32px));
  transform: translate(-50%, 0);
  z-index: 1000;
  border-radius: 18px;
  border: 1px solid rgba(125, 249, 255, 0.28);
  background: rgba(6, 14, 22, 0.55);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35), inset 0 0 0 1px rgba(0, 255, 255, 0.04);
  transition: background 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  animation: jwhNavIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
  font-family: 'Orbitron', sans-serif;
}

@keyframes jwhNavIn {
  from { opacity: 0; transform: translate(-50%, -14px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

.jwh-navbar.is-scrolled {
  background: rgba(4, 10, 16, 0.8);
  border-color: rgba(125, 249, 255, 0.42);
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.5), 0 0 22px rgba(0, 255, 255, 0.12);
}

.jwh-navbar__inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 12px;
  padding: 0.55rem 0.9rem;
}

/* ---------- Left cluster: brand + auth ---------- */
.jwh-navbar__left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.jwh-navbar__brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: #eaffff;
  flex: 0 0 auto;
}

.jwh-navbar__brand-icon {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  box-shadow: 0 0 10px rgba(0, 255, 255, 0.45);
  display: block;
}

.jwh-navbar__brand-text {
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  text-shadow: 0 0 10px rgba(0, 255, 255, 0.25);
  transition: color 0.25s ease, text-shadow 0.25s ease;
}

.jwh-navbar__brand:hover .jwh-navbar__brand-text,
.jwh-navbar__brand:focus-visible .jwh-navbar__brand-text {
  color: #7df9ff;
  text-shadow: 0 0 14px rgba(125, 249, 255, 0.55);
}

.jwh-navbar__divider {
  width: 1px;
  height: 22px;
  flex: 0 0 auto;
  background: linear-gradient(180deg, transparent, rgba(125, 249, 255, 0.4), transparent);
}

.jwh-navbar__auth {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.jwh-navbar__auth .auth-hello {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.85rem;
}

.jwh-navbar__auth .auth-pill {
  padding: 0.45rem 0.9rem;
  font-size: 0.8rem;
  border-radius: 8px;
}

/* ---------- Right cluster: nav links ---------- */
.jwh-navbar__links {
  position: relative;
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 0 0 auto;
}

.jwh-navbar__glow {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 0;
  width: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(0, 255, 255, 0.22), rgba(255, 0, 255, 0.14));
  box-shadow: 0 0 16px rgba(0, 255, 255, 0.35), inset 0 0 0 1px rgba(0, 255, 255, 0.25);
  opacity: 0;
  transform: translateX(0);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
              width 0.35s cubic-bezier(0.22, 1, 0.36, 1),
              opacity 0.2s ease;
  pointer-events: none;
  z-index: 0;
}

.jwh-navbar__link {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 0.85rem;
  border-radius: 10px;
  color: #bdf3f7;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.25s ease;
}

.jwh-navbar__link:hover,
.jwh-navbar__link:focus-visible {
  color: #fff;
}

.jwh-navbar__link:focus-visible {
  outline: 2px solid #7df9ff;
  outline-offset: 2px;
}

.jwh-navbar__link.is-active {
  color: #061014;
  background: linear-gradient(135deg, #7df9ff, #0ff);
  box-shadow: 0 0 16px rgba(0, 255, 255, 0.5);
}

/* ---------- Mobile toggle (hamburger -> X) ---------- */
.jwh-navbar__toggle {
  display: none;
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 1px solid rgba(125, 249, 255, 0.35);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  flex: 0 0 auto;
}

.jwh-navbar__toggle:hover {
  border-color: rgba(125, 249, 255, 0.6);
  box-shadow: 0 0 12px rgba(0, 255, 255, 0.25);
}

.jwh-navbar__toggle-bar {
  position: absolute;
  left: 8px;
  right: 8px;
  height: 2px;
  background: #7df9ff;
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.2s ease, top 0.3s ease;
}
.jwh-navbar__toggle-bar:nth-child(1) { top: 11px; }
.jwh-navbar__toggle-bar:nth-child(2) { top: 16px; }
.jwh-navbar__toggle-bar:nth-child(3) { top: 21px; }

.jwh-navbar.is-open .jwh-navbar__toggle-bar:nth-child(1) { top: 16px; transform: rotate(45deg); }
.jwh-navbar.is-open .jwh-navbar__toggle-bar:nth-child(2) { opacity: 0; }
.jwh-navbar.is-open .jwh-navbar__toggle-bar:nth-child(3) { top: 16px; transform: rotate(-45deg); }

/* ---------- Mobile layout ---------- */
@media (max-width: 720px) {
  .jwh-navbar {
    top: 12px;
    width: calc(100% - 24px);
    border-radius: 16px;
  }

  .jwh-navbar__brand-text { display: none; }
  .jwh-navbar__glow { display: none; }
  .jwh-navbar__toggle { display: inline-flex; align-items: center; justify-content: center; }

  .jwh-navbar__auth .auth-hello { max-width: 84px; }
  .jwh-navbar__auth .auth-pill { padding: 0.4rem 0.7rem; font-size: 0.75rem; }

  .jwh-navbar__links {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding: 10px;
    border-radius: 16px;
    background: rgba(4, 10, 16, 0.92);
    border: 1px solid rgba(125, 249, 255, 0.3);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5), 0 0 24px rgba(0, 255, 255, 0.15);
    backdrop-filter: blur(14px);
    opacity: 0;
    transform: translateY(-8px);
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
  }

  .jwh-navbar.is-open .jwh-navbar__links {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
    pointer-events: auto;
  }

  .jwh-navbar__link {
    width: 100%;
    padding: 0.7rem 0.85rem;
  }

  .jwh-navbar__link.is-active {
    box-shadow: 0 0 12px rgba(0, 255, 255, 0.4);
  }
}

@media (max-width: 360px) {
  .jwh-navbar__brand-icon { width: 22px; height: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  .jwh-navbar,
  .jwh-navbar__glow,
  .jwh-navbar__links,
  .jwh-navbar__toggle-bar {
    animation: none !important;
    transition: none !important;
  }
}
