/* nav.css — shared site navigation bar + drawer for all tool pages */
:root { --snav-h: 52px; }

/* Push page content below the fixed bar */
body { padding-top: var(--snav-h) !important; }

/* ── Top bar ─────────────────────────────────────────────────── */
#snav-bar {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--snav-h);
  background: #1e1e3a;
  border-bottom: 1px solid #44406b;
  box-shadow: 0 2px 10px rgba(0,0,0,0.45);
  display: flex; align-items: stretch;
  z-index: 9999;
}
#snav-bar[data-theme="light"] {
  background: #fff;
  border-bottom-color: #d1d5db;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

/* Icon buttons — 52 px tap target */
.snav-btn {
  display: flex; align-items: center; justify-content: center;
  min-width: var(--snav-h); height: 100%;
  background: none; border: none; cursor: pointer;
  color: #e0e0f0; padding: 0 14px;
  transition: background 0.15s;
  flex-shrink: 0; text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
#snav-bar[data-theme="light"] .snav-btn { color: #1e293b; }
.snav-btn:hover, .snav-btn:active { background: rgba(255,255,255,0.1); }
#snav-bar[data-theme="light"] .snav-btn:hover,
#snav-bar[data-theme="light"] .snav-btn:active { background: rgba(0,0,0,0.06); }
.snav-btn svg { width: 22px; height: 22px; fill: currentColor; pointer-events: none; }

.snav-div {
  width: 1px; background: #44406b;
  margin: 10px 0; flex-shrink: 0;
}
#snav-bar[data-theme="light"] .snav-div { background: #d1d5db; }

/* Breadcrumb */
.snav-crumb {
  flex: 1; min-width: 0;
  display: flex; align-items: center; gap: 0.3rem;
  font-family: ui-sans-serif, system-ui, -apple-system, sans-serif;
  font-size: 0.875rem;
  overflow: hidden; padding: 0 0.5rem;
}
.snav-crumb-sec {
  color: #9090b8; text-decoration: none;
  white-space: nowrap; flex-shrink: 1;
  min-width: 0; overflow: hidden; text-overflow: ellipsis;
  transition: color 0.15s; padding: 4px 0;
}
#snav-bar[data-theme="light"] .snav-crumb-sec { color: #64748b; }
.snav-crumb-sec:hover { color: #00A6E3; }
#snav-bar[data-theme="light"] .snav-crumb-sec:hover { color: #2563eb; }
.snav-sep { color: #9090b8; flex-shrink: 0; user-select: none; font-size: 0.8rem; }
#snav-bar[data-theme="light"] .snav-sep { color: #94a3b8; }
.snav-crumb-tool {
  color: #e0e0f0; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  min-width: 0; flex-shrink: 1;
}
#snav-bar[data-theme="light"] .snav-crumb-tool { color: #1e293b; }

/* On very small screens, hide section name and keep just tool name */
@media (max-width: 480px) {
  .snav-crumb-sec, .snav-sep { display: none; }
}

/* ── Overlay ─────────────────────────────────────────────────── */
#snav-ov {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 10000;
}
#snav-ov.snav-open { display: block; }

/* ── Drawer ──────────────────────────────────────────────────── */
#snav-drawer {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: 300px;
  background: #14142a;
  z-index: 10001;
  display: flex; flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.25s cubic-bezier(0.4,0,0.2,1);
  border-right: 1px solid #44406b;
}
#snav-drawer[data-theme="light"] {
  background: #f8fafc;
  border-right-color: #d1d5db;
}
#snav-drawer.snav-open { transform: translateX(0); }

.snav-dhead {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 0.5rem 0 1.25rem;
  height: var(--snav-h);
  background: #1e1e3a;
  border-bottom: 1px solid #44406b;
  flex-shrink: 0;
}
#snav-drawer[data-theme="light"] .snav-dhead {
  background: #fff; border-bottom-color: #d1d5db;
}
.snav-dtitle {
  font-family: ui-monospace, 'Cascadia Code', 'SF Mono', monospace;
  font-size: 0.88rem; font-weight: 700;
  color: #00A6E3; letter-spacing: 0.03em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
#snav-drawer[data-theme="light"] .snav-dtitle { color: #2563eb; }

.snav-dclose {
  display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; flex-shrink: 0;
  background: none; border: none; cursor: pointer;
  color: #9090b8; border-radius: 6px;
  transition: background 0.15s, color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.snav-dclose:hover, .snav-dclose:active {
  background: rgba(255,255,255,0.08); color: #e0e0f0;
}
#snav-drawer[data-theme="light"] .snav-dclose:hover { background: rgba(0,0,0,0.06); color: #1e293b; }
.snav-dclose svg { width: 20px; height: 20px; fill: currentColor; }

.snav-dhome {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.85rem 1.25rem;
  min-height: 48px;
  color: #9090b8;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 0.875rem; text-decoration: none;
  border-bottom: 1px solid #44406b;
  transition: background 0.15s, color 0.15s; flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
#snav-drawer[data-theme="light"] .snav-dhome {
  color: #64748b; border-bottom-color: #e2e8f0;
}
.snav-dhome:hover, .snav-dhome:active {
  background: rgba(255,255,255,0.05); color: #e0e0f0;
}
#snav-drawer[data-theme="light"] .snav-dhome:hover { background: rgba(0,0,0,0.04); color: #1e293b; }
.snav-dhome svg { width: 18px; height: 18px; fill: currentColor; flex-shrink: 0; }

.snav-dlabel {
  padding: 0.9rem 1.25rem 0.4rem;
  font-family: ui-monospace, monospace;
  font-size: 0.68rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: #9090b8; flex-shrink: 0;
}
#snav-drawer[data-theme="light"] .snav-dlabel { color: #94a3b8; }

.snav-dlist {
  flex: 1; overflow-y: auto;
  padding: 0.2rem 0 1rem;
  -webkit-overflow-scrolling: touch;
}
.snav-dlist::-webkit-scrollbar { width: 3px; }
.snav-dlist::-webkit-scrollbar-thumb { background: #44406b; border-radius: 2px; }

.snav-ditem {
  display: flex; align-items: center;
  padding: 0.7rem 1.25rem; min-height: 48px;
  color: #9090b8;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 0.875rem; line-height: 1.35; text-decoration: none;
  border-left: 3px solid transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
#snav-drawer[data-theme="light"] .snav-ditem { color: #64748b; }
.snav-ditem:hover, .snav-ditem:active {
  background: rgba(255,255,255,0.06); color: #e0e0f0;
}
#snav-drawer[data-theme="light"] .snav-ditem:hover { background: rgba(0,0,0,0.04); color: #1e293b; }
.snav-ditem.snav-active {
  background: rgba(0,166,227,0.12);
  color: #00A6E3;
  border-left-color: #00A6E3;
  font-weight: 600;
}
#snav-drawer[data-theme="light"] .snav-ditem.snav-active {
  background: rgba(37,99,235,0.08); color: #2563eb; border-left-color: #2563eb;
}
