/* ═══════════════════════════════════════════════════════════════════════════
   PHYSICSFORUM.ORG — NAVBAR STYLES (v4 — Stable, no flicker)
   ═══════════════════════════════════════════════════════════════════════════ */

.pf-navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: 68px;
  display: flex;
  align-items: center;
  padding: 0 var(--space-6);
  /* Solid, never transparent — prevents flicker over hero */
  background: linear-gradient(180deg, #1B3A6B 0%, #1E4480 100%);
  box-shadow: 0 2px 12px rgba(10, 22, 40, 0.18);
  /* NO transform transition — that was the source of "blinking" */
  transition: box-shadow 0.2s ease;
}
.pf-navbar.scrolled {
  box-shadow: 0 4px 18px rgba(10, 22, 40, 0.28);
}

/* Spacer body so content does not hide under fixed navbar */
body { padding-top: 68px; }

.navbar-inner {
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  gap: var(--space-5);
}

/* Logo */
.navbar-logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
  transition: opacity 0.2s ease;
}
.navbar-logo:hover { opacity: 0.92; text-decoration: none; }
.navbar-logo svg { width: 34px; height: 34px; flex-shrink: 0; }
.navbar-logo .wordmark {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
  white-space: nowrap;
}
.navbar-logo .wordmark .highlight { color: var(--color-quantum-gold); }

/* Nav links */
.navbar-links {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
}
.navbar-link {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-sm);
  letter-spacing: 0.02em;
  color: rgba(255,255,255,0.85);
  padding: 8px 14px;
  border-radius: 6px;
  position: relative;
  /* SHORT, simple transition only on color/bg — no transform */
  transition: background-color 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}
.navbar-link:hover {
  color: #fff;
  background: rgba(255,255,255,0.08);
  text-decoration: none;
}
.navbar-link.active {
  color: #fff;
  background: rgba(255,255,255,0.12);
}

/* Search */
.navbar-search {
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: center;
}
.navbar-search input {
  width: 240px;
  padding: 8px 16px 8px 38px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 999px;
  color: #fff;
  font-size: var(--text-sm);
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.navbar-search input::placeholder { color: rgba(255,255,255,0.55); }
.navbar-search input:focus {
  outline: none;
  border-color: var(--color-quantum-gold);
  background: rgba(255,255,255,0.18);
}
.navbar-search .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255,255,255,0.7);
  pointer-events: none;
}

/* Right actions */
.navbar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

.btn-ghost-light {
  color: rgba(255,255,255,0.92);
  background: transparent;
  border: 1px solid rgba(255,255,255,0.18);
  padding: 7px 14px;
  border-radius: 6px;
  font-size: var(--text-sm);
  font-weight: 600;
  transition: background-color 0.15s ease;
}
.btn-ghost-light:hover { background: rgba(255,255,255,0.12); color: #fff; text-decoration: none; }

/* User dropdown (visible on large screens when logged in) */
.user-dropdown { position: relative; display: inline-flex; }
.user-menu-btn {
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
  color: #fff !important;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.20);
  padding: 4px 12px 4px 4px;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 0.15s ease;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-sm);
  line-height: 1;
}
.user-menu-btn:hover { background: rgba(255,255,255,0.20); color:#fff; }
.user-menu-btn img, .user-menu-btn .avatar { border-radius: 50%; width: 28px; height: 28px; }
.user-menu-btn svg { color: rgba(255,255,255,0.7); }
.user-name-text { font-size: var(--text-sm); font-weight: 600; color: #fff; }

.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(10,22,40,0.18);
  padding: 6px;
  display: none;
  z-index: 1100;
}
.user-dropdown.open .dropdown-menu { display: block; }
.dropdown-item {
  display: block;
  padding: 8px 12px;
  font-size: var(--text-sm);
  color: var(--color-dark-grey);
  border-radius: 6px;
  text-decoration: none;
}
.dropdown-item:hover { background: var(--color-ice-blue); color: var(--color-electric); text-decoration: none; }
.dropdown-divider { height: 1px; background: rgba(148,163,184,0.18); margin: 6px 0; }

/* Mobile menu */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  width: 32px;
  height: 32px;
  cursor: pointer;
  gap: 5px;
  background: transparent;
  border: 0;
  padding: 0;
}
.mobile-menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.mobile-menu-toggle.open span:nth-child(1) { transform: rotate(45deg) translate(5px,5px); }
.mobile-menu-toggle.open span:nth-child(2) { opacity: 0; }
.mobile-menu-toggle.open span:nth-child(3) { transform: rotate(-45deg) translate(5px,-5px); }

.mobile-menu {
  position: fixed;
  top: 68px;
  right: 0;
  width: 320px;
  max-width: 100vw;
  height: calc(100vh - 68px);
  background: #1B3A6B;
  z-index: 999;
  padding: var(--space-6);
  transform: translateX(110%);
  transition: transform 0.25s ease;
  overflow-y: auto;
  box-shadow: -8px 0 24px rgba(0,0,0,0.18);
}
.mobile-menu.open { transform: translateX(0); }
.mobile-menu .mobile-search input {
  width: 100%;
  padding: 10px 14px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  color: #fff;
  font-size: var(--text-sm);
  margin-bottom: var(--space-4);
}
.mobile-menu .mobile-nav-link {
  display: block;
  padding: 10px 14px;
  font-size: var(--text-base);
  font-weight: 600;
  color: #fff;
  border-radius: 8px;
}
.mobile-menu .mobile-nav-link:hover { background: rgba(255,255,255,0.08); text-decoration: none; }
.mobile-menu .mobile-footer { margin-top: var(--space-6); display: flex; flex-direction: column; gap: 10px; }
.btn-block { display: block; width: 100%; text-align: center; }

/* ── Responsive ── */
@media (max-width: 1023px) {
  .navbar-links { display: none; }
  .navbar-search { display: none; }
  .navbar-actions .btn-ghost-light, .navbar-actions .btn-gold { display: none; }
  .user-name-text { display: none; }
  .user-dropdown { display: none; }   /* hide on small — mobile menu shows the links instead */
  .mobile-menu-toggle { display: flex; }
}

@media (max-width: 639px) {
  .pf-navbar { padding: 0 var(--space-3); }
  .navbar-logo .wordmark { font-size: var(--text-base); }
}

/* v4.7 — theme toggle buttons */
.pfc-nav-action.theme-toggle { position: relative; font-size: 16px; }
.theme-toggle svg { display: inline-block; vertical-align: -3px; }
.theme-toggle-caption { font-size: inherit; }
.theme-toggle-mobile { margin-bottom: 10px; display: flex; align-items: center; justify-content: center; gap: 8px; }
