/* components/navigation_screen_opener/navigation_screen.css */

/* ── Layout ───────────────────────────────────────────── */
#page-layout {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  min-height: calc(100dvh - var(--header-height));
}

/* ── Sidebar ──────────────────────────────────────────── */
.nav-sidebar {
  position: sticky;
  top: var(--header-height);
  height: calc(100dvh - var(--header-height));
  align-self: flex-start;
  display: flex;
  flex-direction: row;
  flex-shrink: 0;
  width: 0 !important;
  overflow: hidden;
  opacity: 0;
  transition: width 0.26s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease;
}

.nav-sidebar.open {
  width: 19% !important;
  overflow: visible;
  opacity: 1;
}

.nav-sidebar-inner {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
  height: 100%;
  background: #ffffff;
  border-right: 1px solid #e2e8f0;
}

/* ── Header ───────────────────────────────────────────── */
.nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  height: var(--screen-header-h, 65px);
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
  user-select: none;
  box-sizing: border-box;
}

.nav-title {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #3a3d42;
}

.nav-close-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: #94a3b8;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.nav-close-btn:hover {
  background: #f1f5f9;
  color: #334155;
}

/* ── Sections ─────────────────────────────────────────── */
.nav-sections {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0 24px;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

.nav-sections::-webkit-scrollbar       { width: 3px; }
.nav-sections::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }

.nav-section-label {
  margin: 0;
  padding: 10px 16px 4px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #3a3d42;
  user-select: none;
}

/* ── Tree ─────────────────────────────────────────────── */
.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-row {
  display: flex;
  align-items: center;
}

.nav-link {
  flex: 1;
  display: block;
  padding: 6px 16px;
  font-size: 0.865rem;
  color: #334155;
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: background 0.12s, color 0.12s;
  user-select: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-link:hover  { background: #f1f5f9; color: #0f172a; }
.nav-link.active { background: #eff6ff; color: #1d4ed8; border-left-color: #2563eb; font-weight: 600; }

.nav-toggle {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  margin-right: 8px;
  background: none;
  border: none;
  cursor: pointer;
  color: #94a3b8;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background 0.12s, transform 0.2s;
}

.nav-toggle:hover         { background: #f1f5f9; }
.nav-item.open .nav-toggle { transform: rotate(90deg); }

.nav-list[data-depth="1"] .nav-link { padding-left: 28px; font-size: 0.82rem; color: #475569; }
.nav-list[data-depth="2"] .nav-link { padding-left: 40px; font-size: 0.78rem; }

.nav-empty { padding: 8px 16px; font-size: 0.82rem; color: #94a3b8; font-style: italic; }


/* ── Hamburger → X ────────────────────────────────────── */
.menu-button .bar                    { background: #3a3d42; transition: transform 0.22s ease, opacity 0.15s ease; }
.menu-button.active .bar:nth-child(1){ transform: translateY(6px) rotate(45deg); }
.menu-button.active .bar:nth-child(2){ opacity: 0; transform: scaleX(0); }
.menu-button.active .bar:nth-child(3){ transform: translateY(-6px) rotate(-45deg); }

/* ── Mobile overlay ───────────────────────────────────── */
@media (max-width: 768px) {
  .nav-sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    z-index: 50;
    height: calc(100dvh - var(--header-height));
  }

  .nav-sidebar.open {
    width: min(280px, 82vw) !important;
    box-shadow: 6px 0 32px rgba(0, 0, 0, 0.18);
  }
}

/* Theme overrides live in theme_controller.css */