/* ---------- Route Map page (Pages/RouteMap.cshtml + js/route-map.js) ---------- */

/* Category picker */
.wad-route-picker { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-bottom: 1.5rem; }
.wad-route-pick {
  display: flex; align-items: center; gap: 0.75rem; text-align: left;
  background: var(--wad-white); border: 2px solid var(--wad-gray); border-radius: var(--wad-radius);
  padding: 0.75rem 1rem; cursor: pointer; color: var(--wad-charcoal);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.wad-route-pick:hover { transform: translateY(-1px); box-shadow: var(--wad-shadow); }
.wad-route-pick:focus-visible { outline: 3px solid var(--wad-green); outline-offset: 2px; }
.wad-route-pick .dot { flex: 0 0 14px; height: 14px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 3px #fff, 0 0 0 4px var(--c); }
.wad-route-pick strong { display: block; font-size: 1.05rem; font-weight: 800; line-height: 1.2; }
.wad-route-pick small { display: block; font-size: 0.78rem; color: #6b6867; line-height: 1.3; }
.wad-route-pick.is-active { border-color: var(--c); box-shadow: 0 0 0 1px var(--c), var(--wad-shadow); }

/* Map + side panel */
.wad-route-layout { display: grid; gap: 1.25rem; grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
.wad-route-mapwrap { position: relative; border-radius: var(--wad-radius); overflow: hidden; box-shadow: var(--wad-shadow); background: #e8e6e5; }
.wad-route-map { height: min(72vh, 680px); min-height: 420px; width: 100%; }
.wad-route-maphint {
  position: absolute; left: 50%; bottom: 0.75rem; transform: translateX(-50%); z-index: 500; margin: 0;
  background: rgba(34, 31, 31, 0.78); color: #fff; font-size: 0.8rem; padding: 0.3rem 0.75rem; border-radius: 999px; pointer-events: none;
}
.wad-route-mapwrap:fullscreen, .wad-route-mapwrap.is-fullscreen { border-radius: 0; }
.wad-route-mapwrap:fullscreen .wad-route-map, .wad-route-mapwrap.is-fullscreen .wad-route-map { height: 100%; min-height: 0; }
.wad-route-mapwrap.is-fullscreen { position: fixed; inset: 0; z-index: 2000; }
html.wad-route-noscroll, html.wad-route-noscroll body { overflow: hidden; }

.wad-route-side { display: grid; gap: 1.25rem; }
.wad-route-info .wad-badge { background: color-mix(in srgb, var(--c, var(--wad-green)) 14%, transparent); color: var(--c, var(--wad-green-dark)); }
.wad-route-info h2 { font-size: 1.35rem; font-weight: 800; margin: 0.5rem 0 1rem; }
.wad-route-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem 1rem; margin: 0 0 1rem; }
.wad-route-stats dt { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: #6b6867; }
.wad-route-stats dd { margin: 0.1rem 0 0; font-weight: 700; font-size: 0.95rem; }
.wad-route-stats div:first-child dd { font-size: 1.5rem; font-weight: 800; }
.wad-route-info p { margin-bottom: 0.6rem; }
.wad-route-status { font-size: 0.82rem; color: #6b6867; margin: 0; }

/* Legend */
.wad-route-legend h3 { font-size: 1.1rem; font-weight: 800; margin-bottom: 0.25rem; }
.wad-route-legend h4 { font-size: 0.8rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: #6b6867; margin: 1rem 0 0.5rem; }
.wad-route-legend-note { font-size: 0.8rem; color: #6b6867; margin-bottom: 0.6rem; }
.wad-route-legend-list, .wad-route-colours { list-style: none; margin: 0; padding: 0; }
.wad-route-legend-list li { display: flex; align-items: center; gap: 0.5rem; padding: 0.2rem 0; font-size: 0.9rem; }
.wad-route-legend-list label { display: flex; align-items: center; gap: 0.6rem; cursor: pointer; margin: 0; }
.wad-route-legend-list input { accent-color: var(--wad-green); width: 1.05rem; height: 1.05rem; }
.wad-legend-sym { display: inline-flex; justify-content: center; min-width: 30px; }
.wad-legend-sym .wad-pin { font-size: 0.6rem; padding: 0.15rem 0.4rem; }
.wad-route-colours li { display: flex; align-items: center; gap: 0.6rem; font-size: 0.88rem; padding: 0.15rem 0; }
.wad-route-colours .swatch { width: 28px; height: 6px; border-radius: 3px; background: var(--c); box-shadow: 0 0 0 2px #fff, 0 0 0 3px rgba(0,0,0,0.12); }

/* Details below the map */
.wad-route-details { display: grid; gap: 1.25rem; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); margin-top: 1.5rem; }
.wad-route-details h3 { font-size: 1.1rem; font-weight: 800; }
.wad-route-details h3 + p { margin-bottom: 1.25rem; }
.wad-route-details .wad-card:hover { transform: none; }
.wad-route-turns, .wad-route-stations { list-style: none; margin: 0; padding: 0; max-height: 460px; overflow-y: auto; }
.wad-route-turns { counter-reset: turn; }
.wad-route-listbtn {
  display: flex; align-items: center; gap: 0.65rem; width: 100%; text-align: left;
  background: none; border: 0; border-bottom: 1px solid #efedec; padding: 0.5rem 0.25rem; color: inherit; font-size: 0.92rem; cursor: pointer;
}
.wad-route-turns .wad-route-listbtn::before {
  counter-increment: turn; content: counter(turn);
  flex: 0 0 1.6rem; height: 1.6rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.72rem; font-weight: 800; background: #f1efee; color: #52504f;
}
.wad-route-listbtn:hover, .wad-route-listbtn:focus-visible { background: rgba(0, 166, 79, 0.07); outline: none; }
.wad-route-listbtn .t { flex: 1; }
.wad-route-listbtn .km { font-variant-numeric: tabular-nums; font-weight: 700; color: #52504f; white-space: nowrap; }

/* Map symbols (shared by markers and legend) */
.wad-divicon { background: none; border: 0; }
.wad-sym {
  display: inline-flex; align-items: center; justify-content: center; border-radius: 50%;
  width: 24px; height: 24px; font-weight: 800; font-size: 0.8rem; line-height: 1; color: #fff;
  box-shadow: 0 0 0 2px #fff, 0 2px 6px rgba(0, 0, 0, 0.3);
}
.wad-sym svg { width: 15px; height: 15px; fill: currentColor; }
.wad-sym-water { background: #1e88e5; }
.wad-sym-medical { background: var(--wad-red); }
.wad-sym-emergency { background: #f59e0b; color: #221f1f; width: 22px; height: 22px; border-radius: 6px; }
.wad-sym-km { background: #fff; color: var(--wad-charcoal); border: 2.5px solid var(--c, var(--wad-charcoal)); width: 24px; height: 24px; font-size: 0.72rem; box-shadow: 0 1px 4px rgba(0,0,0,0.3); }
.wad-sym-turn { width: 12px; height: 12px; background: #fff; border: 3px solid var(--wad-charcoal); box-shadow: 0 1px 3px rgba(0,0,0,0.35); }
.wad-sym-landmark { background: #5b5654; width: 24px; height: 24px; }
.wad-sym-landmark svg { width: 14px; height: 14px; }
.wad-sym-arrow { width: 18px; height: 18px; background: var(--wad-charcoal); }
.wad-sym-arrow svg { width: 12px; height: 12px; fill: none; stroke: #fff; stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; }
.wad-pin {
  display: inline-block; font-size: 0.68rem; font-weight: 800; letter-spacing: 0.06em; color: #fff;
  padding: 0.3rem 0.55rem; border-radius: 6px; box-shadow: 0 0 0 2px #fff, 0 2px 8px rgba(0,0,0,0.35); white-space: nowrap;
}
.wad-pin-start { background: var(--wad-green); }
.wad-pin-finish { background: var(--wad-charcoal); background-image: repeating-conic-gradient(rgba(255,255,255,0.18) 0 25%, transparent 0 50%); background-size: 8px 8px; }

/* Direction arrows along the line */
.wad-divicon-arrow { pointer-events: none; }
.wad-route-arrow {
  display: flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%;
  background: var(--c); box-shadow: 0 0 0 2px #fff, 0 1px 4px rgba(0, 0, 0, 0.35); transform: rotate(var(--h));
}
.wad-route-arrow svg { width: 12px; height: 12px; fill: none; stroke: #fff; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }

/* Leaflet controls and popups */
.wad-route-controls .wad-route-ctl { display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; color: var(--wad-charcoal); }
.wad-route-controls svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.wad-route-popup { font-family: var(--wad-font-body); min-width: 160px; }
.wad-route-popup strong { display: block; font-size: 0.95rem; margin-bottom: 0.2rem; }
.wad-route-popup p { margin: 0 0 0.35rem !important; color: #52504f; }
.wad-route-popup-km { display: inline-block; font-size: 0.78rem; font-weight: 700; color: var(--wad-green-dark); background: rgba(0, 166, 79, 0.1); padding: 0.1rem 0.5rem; border-radius: 999px; }
.leaflet-container { font-family: var(--wad-font-body); }

/* Tablet and mobile */
@media (max-width: 991.98px) {
  .wad-route-layout { grid-template-columns: 1fr; }
  .wad-route-side { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 767.98px) {
  .wad-route-picker { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; }
  .wad-route-pick { padding: 0.6rem 0.75rem; }
  .wad-route-pick small { display: none; }
  .wad-route-map { height: 62vh; min-height: 360px; }
  .wad-route-side, .wad-route-details { grid-template-columns: 1fr; }
  .wad-route-turns, .wad-route-stations { max-height: none; }
}

/* Dark mode (site toggle) */
body.wad-dark .wad-route-pick { background: #2c2929; border-color: #3a3636; color: var(--wad-white); }
body.wad-dark .wad-route-pick.is-active { border-color: var(--c); }
body.wad-dark .wad-route-pick small,
body.wad-dark .wad-route-stats dt,
body.wad-dark .wad-route-status,
body.wad-dark .wad-route-legend-note,
body.wad-dark .wad-route-legend h4,
body.wad-dark .wad-route-listbtn .km { color: #c9c6c5; }
body.wad-dark .wad-route-listbtn { border-bottom-color: #3a3636; }
body.wad-dark .wad-route-turns .wad-route-listbtn::before { background: #3a3636; color: #c9c6c5; }
