/* =========================================
   NAVBAR
   See docs/style-guide.html#navbar for canonical reference.
   ========================================= */

.navbar {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0 2rem;
  height: var(--navbar-height);
  background: linear-gradient(180deg, #ffffff 0%, var(--surface-2) 100%);
  border-bottom: 1px solid var(--line);
}

/* Logo */
.nav-brand {
  display: flex;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.gradient-gold {
  background: linear-gradient(to right, var(--gold-dark), var(--gold-light));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: inline-block;
}
.gradient-dark {
  background: linear-gradient(to right, var(--ink-2), var(--ink-3));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: inline-block;
}

/* -----------------------------------------------------------
   Context card — unified org / league / season selector.
   Each .ctx-slot is a hover-revealed dropdown trigger.
   ----------------------------------------------------------- */
.ctx-card {
  display: flex;
  align-items: stretch;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  /* No overflow:hidden — dropdowns escape downward. */
}

.ctx-slot {
  position: relative;
  display: flex; flex-direction: column; justify-content: center;
  padding: 6px 16px; min-width: 130px;
  cursor: pointer;
  transition: background-color 0.15s;
}
.ctx-slot + .ctx-slot { border-left: 1px solid var(--line-2); }
.ctx-slot:first-child { border-top-left-radius: var(--r-lg); border-bottom-left-radius: var(--r-lg); }
.ctx-slot:last-child  { border-top-right-radius: var(--r-lg); border-bottom-right-radius: var(--r-lg); }
.ctx-slot:hover { background: var(--bg-2); }
.ctx-slot.is-disabled { cursor: not-allowed; opacity: 0.5; }
.ctx-slot.is-disabled:hover { background: transparent; }

.ctx-label {
  font-size: 0.65rem; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-3);
}

.ctx-value {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.95rem; font-weight: 700; color: var(--ink);
  margin-top: 2px;
  white-space: nowrap;
}

.ctx-slot.is-empty .ctx-value {
  color: var(--ink-3); font-style: italic; font-weight: 600;
}

.arrow-down {
  width: 0; height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--ink-3);
}

/* Right side — nav links + avatar */
.nav-links {
  margin-left: auto;
  display: flex; align-items: center; gap: 1.5rem;
}
.nav-link {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink-2);
  padding: 4px 2px;
  border-bottom: 2px solid transparent;
  text-decoration: none;
  transition: color 0.15s, border-color 0.15s;
}
.nav-link:hover { color: var(--ink); }
.nav-link.is-active { color: var(--ink); border-bottom-color: var(--gold); }

.user-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--bg-2);
  border: 1px solid var(--gold);
  color: var(--ink-2);
  font-size: 0.85rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  position: relative;
}

/* -----------------------------------------------------------
   Dropdown — shared by .ctx-slot, .user-avatar, autocomplete,
   in-cell pickers. Hover-to-reveal on the parent.
   ----------------------------------------------------------- */
.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%; left: -1px;
  background: var(--surface);
  min-width: 220px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  padding: 6px 0;
  z-index: 50;
  /* Bridge the gap between trigger and menu so the cursor can travel
     down without crossing dead space (which would close the menu).
     The visible offset is restored via margin-top instead of `top`. */
  margin-top: 6px;
}
.dropdown-menu::before {
  content: "";
  position: absolute;
  top: -6px; left: 0; right: 0;
  height: 6px;
}
.dropdown-menu--right { left: auto; right: 0; }

.ctx-slot:hover    > .dropdown-menu,
.user-avatar:hover > .dropdown-menu,
.status-dropdown:hover        > .dropdown-menu,
.status-dropdown:focus-within > .dropdown-menu {
  display: block;
}

.status-dropdown {
  position: relative;
  display: inline-block;
}
.status-dropdown__trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.status-dropdown .dropdown-item .status-pill {
  font-size: 0.7rem;
  padding: 2px 8px;
}

.dropdown-item {
  display: block;
  padding: 8px 14px;
  font-size: 0.95rem;
  color: var(--ink);
  font-weight: 500;
  background: none;
  border: 0;
  width: 100%;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.dropdown-item:hover { background: var(--bg-2); }
.dropdown-item.is-active { background: var(--gold-pale); font-weight: 700; }

.dropdown-item--with-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.dropdown-item--with-pill .status-pill {
  font-size: 0.65rem;
  padding: 2px 8px;
}

.dropdown-divider {
  height: 1px;
  background: var(--line-2);
  margin: 6px 0;
}

.dropdown-section-label {
  padding: 6px 14px 2px;
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 700;
}

/* button_to renders an inline form; ensure its button fills the dropdown row. */
.dropdown-menu form { margin: 0; }
.dropdown-menu form .dropdown-item { display: block; width: 100%; }
