@import url('https://fonts.googleapis.com/css2?family=Sora:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;700&display=swap');

:root {
  --navy-950: #070a12;
  --navy-900: #0c1220;
  --navy-800: #121a2b;
  --navy-700: #1a2438;
  --navy-600: #243250;
  --line: #2a3650;
  --ink-1: #eef2fb;
  --ink-2: #9fb0cf;
  --ink-3: #5b6b8c;
  --amber: #ffb340;
  --cyan: #4fd6e8;
  --green: #5ee3a8;
  --red: #ff5d6c;
  --font-display: 'Sora', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--navy-950);
  color: var(--ink-1);
  font-family: var(--font-display);
  background-image:
    radial-gradient(circle at 15% 0%, rgba(79,214,232,0.06), transparent 40%),
    radial-gradient(circle at 85% 100%, rgba(255,179,64,0.05), transparent 45%);
  min-height: 100vh;
}

a { color: inherit; }

/* ---------- Top bar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, var(--navy-900), rgba(12,18,32,0.6));
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(8px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
  font-size: 17px;
}

.brand .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 10px var(--amber); }
.brand small { display:block; font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-3); font-weight: 500; letter-spacing: 1.5px; }

.nav-links { display: flex; gap: 4px; }
.nav-links a {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 1px;
  text-decoration: none;
  color: var(--ink-2);
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid transparent;
}
.nav-links a.active, .nav-links a:hover {
  color: var(--ink-1);
  border-color: var(--line);
  background: var(--navy-800);
}

/* ---------- Layout ---------- */
.shell { display: grid; grid-template-columns: 320px 1fr; min-height: calc(100vh - 65px); }
.sidebar {
  border-right: 1px solid var(--line);
  background: rgba(12,18,32,0.5);
  padding: 22px;
  overflow-y: auto;
}
.main { padding: 22px; overflow: auto; }

.panel {
  background: var(--navy-800);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 16px;
}
.panel h3 {
  margin: 0 0 12px;
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--ink-3);
  font-family: var(--font-mono);
}

label { display:block; font-size: 12px; color: var(--ink-2); margin: 10px 0 5px; font-family: var(--font-mono); letter-spacing: 0.3px; }
input[type=text], input[type=file], select {
  width: 100%;
  background: var(--navy-900);
  border: 1px solid var(--line);
  color: var(--ink-1);
  padding: 10px 12px;
  border-radius: 9px;
  font-family: var(--font-display);
  font-size: 13.5px;
}
input:focus, select:focus { outline: none; border-color: var(--cyan); }

button {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--navy-700);
  color: var(--ink-1);
  padding: 10px 14px;
  cursor: pointer;
  transition: all 0.15s ease;
}
button:hover { border-color: var(--cyan); background: var(--navy-600); }
button.primary { background: var(--amber); color: #221502; border-color: var(--amber); }
button.primary:hover { filter: brightness(1.08); }
button.danger { background: transparent; border-color: var(--red); color: var(--red); }
button.ghost { background: transparent; }
button:disabled { opacity: 0.4; cursor: not-allowed; }
button.full { width: 100%; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Map canvas area ---------- */
.map-wrap {
  position: relative;
  background: var(--navy-900);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: auto;
  max-height: calc(100vh - 130px);
}
.map-stage { position: relative; display: inline-block; }
.map-stage img { display: block; max-width: none; }
.map-stage svg.overlay { position: absolute; top: 0; left: 0; }

.node-dot { cursor: pointer; transition: r 0.15s ease; }
.node-dot:hover { filter: brightness(1.3); }
.node-label {
  font-family: var(--font-mono);
  font-size: 11px;
  fill: var(--ink-1);
  paint-order: stroke;
  stroke: var(--navy-950);
  stroke-width: 3px;
  pointer-events: none;
}

.edge-line { stroke: var(--ink-3); stroke-width: 2.5; opacity: 0.55; }
.edge-line.route { stroke: var(--amber); stroke-width: 4.5; opacity: 1; filter: drop-shadow(0 0 5px rgba(255,179,64,0.7)); }

.you-are-here {
  fill: var(--cyan);
  filter: drop-shadow(0 0 8px var(--cyan));
}

/* Node type colors */
.t-gate    { fill: var(--amber); }
.t-entrance{ fill: var(--green); }
.t-security{ fill: var(--red); }
.t-restroom{ fill: var(--cyan); }
.t-food    { fill: #ffd166; }
.t-shop    { fill: #c792ea; }
.t-lounge  { fill: #7ee787; }
.t-baggage { fill: #f78166; }
.t-exit    { fill: #f85149; }
.t-junction{ fill: var(--ink-3); }
.t-poi     { fill: var(--ink-2); }

/* ---------- Steps panel ---------- */
.steps { list-style: none; margin: 0; padding: 0; }
.steps li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 13px;
}
.steps li:last-child { border-bottom: none; }
.step-idx {
  font-family: var(--font-mono);
  font-size: 11px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--navy-700);
  border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: var(--amber);
}
.step-dist { margin-left: auto; color: var(--ink-3); font-family: var(--font-mono); font-size: 11px; white-space: nowrap; }

.summary-card {
  display: flex;
  justify-content: space-between;
  background: var(--navy-700);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 14px;
}
.summary-card .big { font-family: var(--font-mono); font-size: 22px; color: var(--cyan); font-weight: 700; }
.summary-card .lbl { font-size: 10.5px; color: var(--ink-3); letter-spacing: 1px; text-transform: uppercase; }

.empty-state { color: var(--ink-3); font-size: 13px; padding: 30px 10px; text-align: center; line-height: 1.6; }

.tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--ink-2);
  letter-spacing: 0.5px;
}

.map-list-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 12px;
  border-radius: 9px;
  border: 1px solid transparent;
  cursor: pointer;
  margin-bottom: 4px;
  font-size: 13px;
}
.map-list-item:hover { background: var(--navy-700); }
.map-list-item.active { border-color: var(--cyan); background: var(--navy-700); }

.toolbar { display:flex; gap:8px; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar button.active { background: var(--cyan); color: #04222a; border-color: var(--cyan); }

.legend { display:flex; flex-wrap:wrap; gap: 8px 14px; font-size: 11px; color: var(--ink-2); font-family: var(--font-mono); }
.legend span { display:flex; align-items:center; gap:6px; }
.legend i { width: 9px; height: 9px; border-radius: 50%; display:inline-block; }

.status-msg { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-3); margin-top: 6px; min-height: 16px; }
.status-msg.ok { color: var(--green); }
.status-msg.err { color: var(--red); }

/* ---------- Turn-by-turn step list ---------- */
.steps li {
  display: flex;
  align-items: center;
  gap: 12px;
}
.steps li.step-active {
  background: var(--navy-700);
  border-radius: 10px;
  padding-left: 8px;
  margin-left: -8px;
  margin-right: -8px;
  padding-right: 8px;
  border-bottom-color: transparent;
}
.turn-icon {
  flex-shrink: 0;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--navy-700);
  border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  color: var(--amber);
  transition: transform 0.2s ease;
}
.turn-icon.arrive { color: var(--green); }
.step-text { display: flex; flex-direction: column; gap: 2px; }
.step-text .step-dist { font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); margin-left: 0; }

/* ---------- Live navigation banner (Maps-app style) ---------- */
.nav-banner {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 24px;
  background: linear-gradient(180deg, #0a3d2e, #0e2e26 80%);
  border-bottom: 1px solid #1c5440;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.nav-arrow-wrap {
  width: 56px; height: 56px;
  border-radius: 16px;
  background: rgba(255,255,255,0.08);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.nav-arrow {
  font-size: 30px;
  color: #fff;
  display: inline-block;
  transition: transform 0.3s ease;
}
.nav-arrow.arrive { font-size: 26px; }
.nav-text { flex: 1; min-width: 0; }
.nav-instruction {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  line-height: 1.25;
}
.nav-sub {
  display: flex;
  gap: 12px;
  align-items: baseline;
  font-family: var(--font-mono);
  font-size: 13px;
  color: rgba(255,255,255,0.7);
  margin-top: 4px;
}
.nav-sub .nav-next { color: rgba(255,255,255,0.45); font-size: 11.5px; }
.nav-close {
  flex-shrink: 0;
  background: rgba(255,255,255,0.08);
  border: none;
  color: #fff;
  width: 36px; height: 36px;
  border-radius: 50%;
  padding: 0;
  font-size: 15px;
}
.nav-close:hover { background: rgba(255,255,255,0.18); }

.nav-bottom {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 300;
  background: var(--navy-900);
  border-top: 1px solid var(--line);
  padding: 14px 24px 18px;
  box-shadow: 0 -8px 24px rgba(0,0,0,0.4);
}
.nav-progress {
  height: 4px;
  background: var(--navy-700);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 12px;
}
.nav-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--green);
  transition: width 0.3s ease;
}
.nav-bottom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-bottom-row span {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--ink-2);
}
