/* ===== Navigation Architecture v2 — Plan 2 =====
   Top nav bar — sits directly below the appbar (~53px).
   All screen sizes: same bar, tabs scale at 768px+.
   All transitions: transform/opacity only.
   Extends design-system.css tokens. */

/* ─── Top Nav Bar ────────────────────────────────────────────────────────── */

.nav-bar {
  position: fixed;
  top: 53px;   /* flush below the appbar */
  left: 0;
  right: 0;
  bottom: auto;
  z-index: 25;  /* above content, below modals */
  display: flex;
  background: var(--bg, #0a0c10);
  border-bottom: 1px solid var(--border);
}

.nav-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 10px 2px 12px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-ui, "Orbitron", sans-serif);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  cursor: pointer;
  position: relative;
  transition: color var(--dur-fast, 200ms) var(--ease-enter, ease-out);
  -webkit-tap-highlight-color: transparent;
}

.nav-tab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -3px;
  border-radius: 4px;
}

/* Tab icon wrapper — 22×22 hit area */
.nav-tab-icon {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
  /* When a sw-icon is used inside, it inherits the color via background-color */
}

.nav-tab-label {
  font-size: 8px;
  letter-spacing: 0.10em;
}

/* Active indicator: glowing underline at the bottom of the tab */
.nav-tab::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 20%;
  right: 20%;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent), 0 0 16px color-mix(in srgb, var(--accent) 40%, transparent);
  transform: scaleX(0);
  opacity: 0;
  transition:
    transform var(--dur-fast, 200ms) var(--ease-enter, ease-out),
    opacity   var(--dur-fast, 200ms) var(--ease-enter, ease-out);
}

.nav-tab.active {
  color: var(--accent);
}

.nav-tab.active::after {
  transform: scaleX(1);
  opacity: 1;
}

/* sw-icon inside active nav-tab inherits accent color */
.nav-tab.active .sw-icon {
  background-color: var(--accent);
}

/* ─── Hide old .views strip — replaced by .nav-bar ──────────────────────── */

.views {
  display: none !important;
}

/* ─── Push hero + content below the top nav bar ─────────────────────────── */

.hero {
  margin-top: 48px;   /* nav bar height (~48px) */
}

/* ─── Character view — inline stacked sections ───────────────────────────── */

/* Each legacy sub-section within the character pane gets a subtle divider */
.char-section-divider {
  height: 1px;
  background: var(--border);
  margin: 8px 0;
  opacity: 0.4;
}

/* Preserve the 2-column grid for the stats section (abilities + saves side by side) */
.char-stats-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 24px;
}

@media (max-width: 600px) {
  .char-stats-grid {
    grid-template-columns: 1fr;
  }
}

/* ─── Placeholder pane — coach / spells / journal (Plan 2 shells) ────────── */

.view-pane-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 240px;
  gap: 12px;
  color: var(--text-muted);
}

.view-pane-placeholder-label {
  font-family: var(--font-ui, "Orbitron", sans-serif);
  font-size: var(--text-sm, 13px);
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  opacity: 0.5;
}

.view-pane-placeholder-sub {
  font-family: var(--font-body, system-ui, sans-serif);
  font-size: var(--text-sm, 13px);
  color: var(--text-muted);
  opacity: 0.4;
}

/* ─── Desktop: Bottom nav scales up (≥768px) ────────────────────────────── */

@media (min-width: 768px) {
  /* Tabs get more room — label + icon breathe on wider screens */
  .nav-tab {
    padding: 12px 8px 14px;
    font-size: 9px;
    letter-spacing: 0.12em;
    gap: 4px;
  }

  .nav-tab-icon {
    width: 24px;
    height: 24px;
    font-size: 20px;
  }

  .nav-tab-label {
    font-size: 9px;
    letter-spacing: 0.12em;
  }

  /* Slightly taller bar at tablet+ */
  .nav-bar {
    padding-bottom: env(safe-area-inset-bottom, 4px);
  }
}
