/* ─────────────────────────────────────────────────────────────────────────────
   PokéStock Live — Shared navbar styles
   Used by every page. Single source of truth for navbar appearance.
   Depends on: :root CSS variables (--bg, --surf, --line, --ink, --mut, --gold,
               --live, --cool) declared inline on each page.
   ───────────────────────────────────────────────────────────────────────────── */

/* Top bar container */
.bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 0 24px;
  height: 56px;
  background: var(--surf);
  border-bottom: 1px solid var(--line);
}

/* Animated foil-gradient logo */
.logo {
  font-family: "Anton", sans-serif;
  font-size: 22px;
  letter-spacing: 1px;
  line-height: 1;
  background: linear-gradient(100deg, #ffd76b, #38bdf8, #ff7ac6, #ffd76b);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: foil 8s linear infinite;
}
.logo small {
  display: block;
  font-family: "Figtree", sans-serif;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 3px;
  color: var(--mut);
  -webkit-text-fill-color: var(--mut);
  margin-top: 3px;
}
@keyframes foil { to { background-position: 300% 0; } }

/* Pushes nav items to the right of the bar */
.spacer { flex: 1; }

/* @username pill (becomes the dropdown header on mobile) */
.user-badge {
  font-size: 13px;
  font-weight: bold;
  color: var(--cool);
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

/* Verified checkmark badge */
.vbadge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  background: #1d9bf0;
  border-radius: 50%;
  margin-left: 3px;
  vertical-align: middle;
  flex: none;
}
.vbadge svg { width: 9px; height: 9px; fill: #fff; }

/* Buttons (navbar buttons override font-size/padding via inline style) */
.btn {
  border: none;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
  padding: 9px 14px;
  font-size: 14px;
  transition: transform .07s, filter .15s;
}
.btn:active { transform: translateY(1px); }
.btn-gold  { background: var(--gold); color: #1a1304; }
.btn-cool  { background: var(--cool); color: #04212e; }
.btn-ghost { background: var(--surf2); color: var(--ink); border: 1px solid var(--line); }
.btn-ghost:hover { border-color: var(--cool); }

/* Generic hidden utility — used by pre-paint bootstrap */
.hidden { display: none !important; }

/* Nav items wrapper: flex row on desktop, dropdown on mobile */
.nav-items {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Hamburger button — hidden on desktop, shown on mobile via media query */
.hamburger-btn {
  display: none;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  cursor: pointer;
  padding: 7px 10px;
  line-height: 1;
  transition: border-color .15s, color .15s;
  flex-shrink: 0;
}
.hamburger-btn:hover { border-color: var(--cool); color: var(--cool); }

/* ─── Bell notification button + dropdown ─────────────────────────────────── */
.bell-wrap {
  position: relative;
  flex-shrink: 0;
}

.bell-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--surf2);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  cursor: pointer;
  padding: 0;
  transition: border-color .15s, color .15s;
}
.bell-btn:hover { border-color: var(--cool); color: var(--cool); }
.bell-btn svg { width: 16px; height: 16px; }

/* Red badge with count */
.bell-dot {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  background: var(--live);
  border-radius: 8px;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  pointer-events: none;
  border: 1.5px solid var(--surf);
  box-sizing: content-box;
}

/* Dropdown panel */
.bell-drop {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 320px;
  max-height: 400px;
  overflow-y: auto;
  background: var(--surf);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0,0,0,.55);
  z-index: 950;
  display: none;
}
.bell-drop.open { display: block; }

.bell-drop-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px 8px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: var(--mut);
}
.bell-drop-header button {
  background: none;
  border: none;
  color: var(--cool);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  padding: 0;
}

.bell-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background .1s;
}
.bell-item:last-child { border-bottom: none; }
.bell-item:hover { background: var(--surf2); }
.bell-item.unread { background: rgba(56,189,248,.06); }
.bell-item.unread:hover { background: rgba(56,189,248,.10); }
.bell-item-icon {
  font-size: 18px;
  flex-shrink: 0;
  margin-top: 1px;
  line-height: 1;
}
.bell-item-body { flex: 1; min-width: 0; }
.bell-item-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
  margin-bottom: 2px;
}
.bell-item-sub {
  font-size: 11px;
  color: var(--mut);
}
.bell-empty {
  padding: 28px 14px;
  text-align: center;
  color: var(--mut);
  font-size: 13px;
}

/* ─── Mobile: ≤ 640px ─────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .bar {
    height: 48px;
    min-height: 48px;
    padding: 0 14px;
    flex-wrap: nowrap;
    gap: 8px;
  }
  .logo { font-size: 18px; }
  .logo small { display: none; }
  .hamburger-btn { display: flex; }

  /* Nav items become a slide-down dropdown */
  .nav-items {
    display: none;
    position: fixed;
    top: 48px;
    left: 0;
    right: 0;
    z-index: 900;
    background: var(--surf);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .55);
    padding: 12px 16px 16px;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }
  .nav-items.open { display: flex; }

  /* Username badge at top of dropdown */
  .nav-items .user-badge {
    font-size: 14px !important;
    color: var(--cool) !important;
    margin-right: 0 !important;
    padding: 6px 0 12px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 2px;
  }
  /* All buttons inside the dropdown: full width */
  .nav-items .btn {
    font-size: 13px !important;
    padding: 10px 16px !important;
    width: 100% !important;
    border-radius: 10px !important;
    text-align: center !important;
    margin-right: 0 !important;
  }

  /* Bell stays in the bar (not in the dropdown) — full-width drop below */
  .bell-drop {
    position: fixed;
    top: 56px;
    left: 8px;
    right: 8px;
    width: auto;
    max-height: 50vh;
    z-index: 9998;
  }

  /* Settings overlay: dropdown must sit above the overlay (z-index: 200) */
  #settingsPage .nav-items { z-index: 9999; }
}
