/* css/mc-nav.css
   Marine Citizen — universal navigation layer.
   Ships a command palette (⌘/Ctrl+K), one subtle launcher pill, and a
   mobile-only bottom tab bar. Designed to add navigation WITHOUT cluttering
   pages with extra buttons: the palette is invisible until invoked, the
   launcher is a single small element, and the tab bar only shows on phones.
   All colours are self-scoped so host-page themes don't bleed in. */

:root {
  --mcnav-z: 2147480000; /* below the guided-tour tooltip (99200 is lower, but
                             the palette is a modal the user opened, so it wins) */
}

/* ─────────────────────────  Launcher pill  ───────────────────────── */
#mcnav-launcher {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 2147481000;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(15, 23, 42, 0.82);
  color: #e2e8f0;
  font: 500 13px/1 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0.2px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, opacity 0.18s ease;
}
#mcnav-launcher:hover {
  transform: translateY(-1px);
  background: rgba(30, 41, 59, 0.92);
  border-color: rgba(56, 189, 248, 0.5);
}
#mcnav-launcher:active { transform: translateY(0); }
#mcnav-launcher .mcnav-launcher__icon { font-size: 15px; line-height: 1; }
#mcnav-launcher .mcnav-launcher__kbd {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(148, 163, 184, 0.16);
  border: 1px solid rgba(148, 163, 184, 0.22);
  font-size: 11px;
  color: #cbd5e1;
}
/* On phones the bottom tab bar replaces the launcher. */
@media (max-width: 720px) {
  #mcnav-launcher { display: none; }
}
@media print { #mcnav-launcher, #mcnav-tabbar, #mcnav-overlay { display: none !important; } }

/* ─────────────────────────  Command palette  ───────────────────────── */
#mcnav-overlay {
  position: fixed;
  inset: 0;
  z-index: 2147482000;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 12vh 16px 16px;
  background: rgba(2, 6, 23, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: mcnav-fade 0.14s ease;
}
#mcnav-overlay.mcnav-open { display: flex; }

@keyframes mcnav-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes mcnav-pop { from { opacity: 0; transform: translateY(-8px) scale(0.985); } to { opacity: 1; transform: none; } }

.mcnav-panel {
  width: 100%;
  max-width: 560px;
  max-height: 66vh;
  display: flex;
  flex-direction: column;
  background: #0f172a;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 16px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  animation: mcnav-pop 0.16s ease;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.mcnav-searchbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}
.mcnav-searchbar__icon { font-size: 16px; color: #64748b; }
#mcnav-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: #f1f5f9;
  font-size: 16px;
  font-family: inherit;
}
#mcnav-input::placeholder { color: #64748b; }
.mcnav-searchbar__esc {
  font-size: 11px;
  color: #64748b;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 6px;
  padding: 2px 6px;
}

.mcnav-results {
  list-style: none;
  margin: 0;
  padding: 8px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.mcnav-group-label {
  padding: 10px 12px 4px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #475569;
}
.mcnav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  color: #cbd5e1;
  transition: background 0.12s ease, color 0.12s ease;
}
.mcnav-item[aria-selected="true"],
.mcnav-item:hover {
  background: rgba(56, 189, 248, 0.14);
  color: #f8fafc;
}
.mcnav-item__icon {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  border-radius: 9px;
  background: rgba(148, 163, 184, 0.1);
  border: 1px solid rgba(148, 163, 184, 0.14);
}
.mcnav-item__text { flex: 1; min-width: 0; }
.mcnav-item__label { font-size: 14px; font-weight: 600; }
.mcnav-item__desc {
  font-size: 11.5px;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mcnav-item__hint {
  font-size: 11px;
  color: #475569;
  flex-shrink: 0;
}
.mcnav-empty {
  padding: 26px 16px;
  text-align: center;
  color: #64748b;
  font-size: 13px;
}
.mcnav-footer {
  display: flex;
  gap: 16px;
  padding: 9px 16px;
  border-top: 1px solid rgba(148, 163, 184, 0.14);
  font-size: 11px;
  color: #475569;
}
.mcnav-footer kbd {
  font-family: inherit;
  background: rgba(148, 163, 184, 0.12);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 5px;
  padding: 1px 5px;
  margin-right: 4px;
  color: #94a3b8;
}

/* ─────────────────────────  Mobile bottom tab bar  ───────────────────────── */
#mcnav-tabbar {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2147481000;
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
  background: rgba(15, 23, 42, 0.94);
  border-top: 1px solid rgba(148, 163, 184, 0.18);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.3);
}
@media (max-width: 720px) {
  #mcnav-tabbar { display: flex; justify-content: space-around; align-items: stretch; }
}
.mcnav-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 2px;
  background: none;
  border: none;
  color: #94a3b8;
  font: 500 10px/1.1 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-decoration: none;
  cursor: pointer;
  border-radius: 10px;
  transition: color 0.15s ease, background 0.15s ease;
}
.mcnav-tab__icon { font-size: 19px; line-height: 1; }
.mcnav-tab:active { background: rgba(56, 189, 248, 0.12); }
.mcnav-tab.mcnav-tab--active { color: #38bdf8; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  #mcnav-overlay, .mcnav-panel, #mcnav-launcher, .mcnav-tab { animation: none !important; transition: none !important; }
}
