/* =========================================
   NAVBAR — dark top bar with scope selector, tabs, org/user controls.
   Visual reference: docs/epics/0004-redesign/mockups/navbar-mockup.html
   ========================================= */

.navbar {
  height: var(--navbar-height);
  background: var(--navbar-bg);
  border-bottom: 1px solid var(--navbar-border);
  display: flex;
  align-items: center;
  padding: 0 1.25rem;
  gap: 1.25rem;
  position: relative;
  z-index: 100;
}

/* ---- Logo ---- */
.navbar__logo {
  font-size: 1.143rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: var(--grad-light);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-decoration: none;
  flex-shrink: 0;
}

/* ---- Scope selector trigger ---- */
.navbar__scope {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: var(--r-sm);
  background: var(--white-a06);
  transition: background 0.15s;
  position: relative;
  flex-shrink: 0;
}
.navbar__scope:hover { background: var(--white-a12); }

.navbar__scope-text {
  font-size: 1rem;
  font-weight: 700;
  color: var(--white);
  white-space: nowrap;
}
.navbar__scope-chip {
  font-size: 0.643rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--navbar-chip-text);
  background: var(--navbar-chip-bg);
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
}
.navbar__scope-chevron {
  font-size: 0.7rem;
  color: var(--white-a40);
  margin-left: 2px;
}

/* ---- Tab navigation ---- */
.navbar__tabs {
  display: flex;
  gap: 0;
  height: 100%;
  overflow-x: auto;
  scrollbar-width: none;
  flex: 1;
  min-width: 0;
}
.navbar__tabs::-webkit-scrollbar { display: none; }

.navbar__tab {
  display: flex;
  align-items: center;
  padding: 0 0.85rem;
  color: var(--navbar-tab);
  text-decoration: none;
  font-size: 0.857rem;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  transition: color 0.15s;
  height: 100%;
}
.navbar__tab:hover { color: var(--navbar-tab-hover); }
.navbar__tab.is-active {
  color: var(--navbar-tab-active);
  font-weight: 700;
  border-bottom-color: var(--navbar-tab-active);
}

/* ---- Right zone: org + user ---- */
.navbar__right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
  flex-shrink: 0;
}

.navbar__org {
  font-size: 0.857rem;
  font-weight: 600;
  color: var(--white-a65);
  padding: 5px 10px;
  border-radius: var(--r-sm);
  border: 1px solid var(--white-a12);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  transition: background 0.15s;
  position: relative;
  background: none;
}
.navbar__org:hover { background: var(--navbar-border); }

.navbar__org:hover > .dropdown-menu,
.navbar__org:focus-within > .dropdown-menu {
  display: block;
}

.navbar__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--grad-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 0.857rem;
  font-weight: 700;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
}

.navbar__avatar:hover > .dropdown-menu,
.navbar__avatar:focus-within > .dropdown-menu {
  display: block;
}

/* ---- Scope dropdown ---- */
.scope-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  min-width: 520px;
  max-height: 480px;
  z-index: 200;
  flex-direction: column;
}
.scope-dropdown::before {
  content: "";
  position: absolute;
  top: -10px; left: 0; right: 0;
  height: 10px;
}

.navbar__scope:hover .scope-dropdown,
.navbar__scope:focus-within .scope-dropdown {
  display: flex;
}

.scope-dropdown__header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.scope-dropdown__search {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 6px 10px;
  font-size: 0.857rem;
  color: var(--ink);
  outline: none;
  background: var(--bg);
  font-family: inherit;
}
.scope-dropdown__search:focus {
  border-color: var(--accent);
  box-shadow: var(--focus-ring);
}
.scope-dropdown__search::placeholder { color: var(--ink-3); }

.scope-dropdown__toggle {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.786rem;
  font-weight: 600;
  color: var(--ink-3);
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
}
.scope-dropdown__toggle input { accent-color: var(--accent); }

.scope-dropdown__body {
  overflow-y: auto;
  flex: 1;
}

.scope-dropdown__league-group {
  display: grid;
  grid-template-columns: 160px 1fr;
  border-bottom: 1px solid var(--line);
}
.scope-dropdown__league-group:last-of-type { border-bottom: none; }

.scope-dropdown__league-name {
  padding: 10px 14px;
  border-right: 1px solid var(--line);
  display: flex;
  align-items: flex-start;
  font-size: 0.857rem;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  line-height: 1.6;
  cursor: pointer;
}
.scope-dropdown__league-name:hover { background: var(--bg); color: var(--accent); }
.scope-dropdown__league-name.is-active { color: var(--accent); }

.scope-dropdown__seasons { padding: 6px 0; }

.scope-dropdown__season-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 14px;
  text-decoration: none;
  transition: background 0.1s;
  gap: 0.75rem;
}
.scope-dropdown__season-link:hover { background: var(--bg); }
.scope-dropdown__season-link.is-active { background: var(--accent-light); }

.scope-dropdown__season-name {
  font-size: 0.857rem;
  font-weight: 500;
  color: var(--ink);
}
.scope-dropdown__season-link.is-active .scope-dropdown__season-name {
  font-weight: 700;
  color: var(--accent);
}

.scope-dropdown__create-link {
  display: block;
  padding: 5px 14px;
  font-size: 0.786rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}
.scope-dropdown__create-link:hover { text-decoration: underline; }

.scope-dropdown__footer {
  padding: 8px 14px;
  border-top: 1px solid var(--line);
  flex-shrink: 0;
}
.scope-dropdown__footer .scope-dropdown__create-link {
  padding: 4px 0;
  font-size: 0.857rem;
}

.scope-dropdown__empty-state {
  padding: 2rem 1.5rem;
  text-align: center;
  color: var(--ink-3);
}
.scope-dropdown__empty-state p {
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
}

/* Small status pill variant for inline use in the dropdown */
.status-pill--sm {
  font-size: 0.65rem;
  padding: 1px 6px;
}
