/* ============================================================
   BUMBLETALE — DYNAMIC NAV STYLES
   Handles logged-in vs logged-out states + mobile hamburger
   ============================================================ */

/* ── NAV BASE ── */
nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 1000;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 48px;
  background: rgba(255,253,245,0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1.5px solid var(--parchment-2);
  transition: box-shadow 0.2s;
}

nav.scrolled { box-shadow: 0 2px 20px rgba(30,58,47,0.08); }

/* ── LOGO ── */
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.logo-bee {
  width: 38px; height: 38px; background: var(--honey); border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 20px;
  box-shadow: 0 3px 0 var(--honey-deep); animation: beeBob 2.5s ease-in-out infinite;
  flex-shrink: 0;
}
.logo-text { font-family: 'Playfair Display', serif; font-size: 22px; font-weight: 900; color: var(--ink); }
.logo-text span { color: var(--honey); font-style: italic; }

/* ── DESKTOP NAV RIGHT ── */
.nav-right { display: flex; align-items: center; gap: 12px; }

/* ── LOGGED OUT STATE ── */
.nav-guest { display: flex; align-items: center; gap: 10px; }

/* ── LOGGED IN STATE ── */
.nav-user { display: flex; align-items: center; gap: 12px; }

.nav-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--honey); border: 2px solid var(--honey-deep);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; cursor: pointer; flex-shrink: 0;
  position: relative;
}

.nav-username {
  font-size: 14px; font-weight: 700; color: var(--ink);
  max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Dropdown */
.nav-dropdown {
  position: absolute; top: calc(100% + 10px); right: 0;
  background: white; border: 1.5px solid var(--parchment-2);
  border-radius: 16px; padding: 8px;
  box-shadow: 0 8px 32px rgba(30,58,47,0.12);
  min-width: 180px; display: none; z-index: 100;
}

.nav-avatar:focus .nav-dropdown,
.nav-dropdown-wrap:focus-within .nav-dropdown,
.nav-dropdown-wrap.open .nav-dropdown { display: block; }

.nav-dropdown-wrap { position: relative; }

.dd-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 10px;
  font-size: 14px; font-weight: 600; color: var(--ink-soft);
  text-decoration: none; cursor: pointer; border: none;
  background: transparent; width: 100%; text-align: left;
  transition: background 0.15s;
}
.dd-item:hover { background: var(--honey-pale); color: var(--ink); }
.dd-item.danger { color: var(--coral-deep); }
.dd-item.danger:hover { background: #FDEEE9; }
.dd-divider { height: 1px; background: var(--parchment-2); margin: 6px 0; }

/* Streak badge in nav */
.nav-streak {
  display: flex; align-items: center; gap: 4px;
  background: var(--honey-light); border: 1px solid var(--honey);
  border-radius: 100px; padding: 4px 10px;
  font-size: 12px; font-weight: 700; color: var(--honey-deep);
}

/* ── HAMBURGER (mobile) ── */
.nav-hamburger {
  display: none;
  flex-direction: column; gap: 5px;
  background: transparent; border: none; cursor: pointer;
  padding: 6px; border-radius: 8px;
}
.nav-hamburger span {
  display: block; width: 24px; height: 2px;
  background: var(--ink); border-radius: 2px;
  transition: all 0.25s;
}
.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── MOBILE MENU ── */
.nav-mobile-menu {
  display: none;
  position: fixed; top: 65px; left: 0; right: 0;
  background: white; border-bottom: 1.5px solid var(--parchment-2);
  padding: 16px; z-index: 999;
  box-shadow: 0 8px 32px rgba(30,58,47,0.1);
  flex-direction: column; gap: 8px;
}
.nav-mobile-menu.open { display: flex; }

.mobile-menu-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-radius: 12px;
  font-size: 15px; font-weight: 700; color: var(--ink);
  text-decoration: none; border: none; background: transparent;
  cursor: pointer; width: 100%; text-align: left;
  transition: background 0.15s;
}
.mobile-menu-item:hover { background: var(--honey-pale); }
.mobile-menu-item.primary { background: var(--honey); color: var(--ink); box-shadow: 0 3px 0 var(--honey-deep); }
.mobile-menu-item.primary:hover { background: var(--honey); }
.mobile-menu-item.danger { color: var(--coral-deep); }
.mobile-menu-item.danger:hover { background: #FDEEE9; }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  nav { padding: 12px 16px; }
  .nav-right { display: none; }           /* hide desktop nav */
  .nav-hamburger { display: flex; }       /* show hamburger */
  .logo-text { font-size: 19px; }
  .logo-bee { width: 32px; height: 32px; font-size: 17px; }
}
