/* ===== TRACK & TRACE PAGE ================================================ */

.track-hero { position: relative; overflow: hidden; padding: 76px 0 0; }
.track-hero-bg { position: absolute; inset: 0; z-index: 0; }
.track-hero-bg img { width: 100%; height: 100%; object-fit: cover; animation: heroDriftSlow 28s ease-in-out infinite alternate; }
.track-hero::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(8,18,32,0.92) 0%, rgba(14,27,46,0.95) 60%, rgba(14,27,46,0.98) 100%);
}
.track-hero-content { position: relative; z-index: 1; padding: 88px 0 96px; max-width: 640px; }
.track-hero-content h1 { font-size: clamp(32px, 4.6vw, 50px); margin-top: 16px; }
.track-hero-sub { margin-top: 18px; font-size: 16.5px; }

.track-search {
  display: flex;
  gap: 12px;
  margin-top: 32px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(245,242,234,0.18);
  border-radius: var(--radius-pill);
  padding: 7px 7px 7px 22px;
  flex-wrap: wrap;
}
.track-search input {
  flex: 1;
  min-width: 200px;
  background: transparent;
  border: none;
  color: var(--bone);
  font-size: 15px;
  font-family: var(--font-mono);
  padding: 12px 0;
}
.track-search input::placeholder { color: var(--bone-mute); font-family: var(--font-body); }
.track-search input:focus { outline: none; }
.track-search .btn { flex-shrink: 0; }

.track-hint { margin-top: 18px; font-size: 13px; color: var(--bone-mute); }
.hint-link {
  background: none; border: none; color: var(--gold-pale);
  font-size: 13px; font-weight: 600; text-decoration: underline;
  text-decoration-color: rgba(244,214,151,0.4);
  padding: 0;
}
.hint-link:hover { color: var(--gold); }

/* Empty state */
.empty-wrap { text-align: center; max-width: 480px; margin: 0 auto; padding: 30px 0; }
.empty-icon { font-size: 44px; margin-bottom: 18px; }
.empty-wrap h2 { font-size: 24px; color: var(--text-dark); }
.empty-wrap p { color: var(--text-mute); margin-top: 12px; font-size: 15px; }

/* Result summary card */
.result-summary {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 36px;
  margin-bottom: 28px;
}
.rs-top { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 16px; }
.rs-top h2 { font-size: 26px; margin-top: 6px; color: var(--text-dark); font-family: var(--font-mono); font-weight: 600; }

.rs-route-line {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 20px;
  margin-top: 32px;
}
@media (max-width: 720px) { .rs-route-line { grid-template-columns: 1fr; } }
.rs-pt strong { display: block; font-size: 15px; color: var(--text-dark); }
.rs-pt span { font-size: 12px; color: var(--text-mute); }
.rs-progress-wrap { width: 100%; }
.rs-progress-svg { width: 100%; height: 32px; display: block; }
@media (max-width: 720px) { .rs-progress-wrap { display: none; } }

.rs-meta-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--line-light);
}
@media (max-width: 720px) { .rs-meta-grid { grid-template-columns: 1fr 1fr; } }
.rs-meta-grid label { display: block; font-family: var(--font-mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-mute); margin-bottom: 5px; }
.rs-meta-grid span { font-size: 14.5px; font-weight: 600; color: var(--text-dark); }

/* Two column layout: timeline + map */
.result-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 920px) { .result-cols { grid-template-columns: 1fr; } }

.timeline-card, .map-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 32px;
}
.timeline-card h3, .map-card h3 { font-size: 18px; color: var(--text-dark); margin-bottom: 22px; }

.mile-list { list-style: none; margin: 0; padding: 0; }
.mile-item {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 16px;
  padding-bottom: 26px;
  position: relative;
}
.mile-item:last-child { padding-bottom: 0; }
.mile-dot-col { position: relative; display: flex; justify-content: center; }
.mile-dot {
  width: 13px; height: 13px;
  border-radius: 50%;
  background: var(--paper-2);
  border: 2px solid var(--line-light);
  z-index: 1;
  margin-top: 3px;
}
.mile-item.done .mile-dot { background: var(--green); border-color: var(--green); }
.mile-item.current .mile-dot { background: var(--gold); border-color: var(--gold); box-shadow: 0 0 0 4px var(--gold-soft); }
.mile-connector {
  position: absolute;
  top: 18px; bottom: -8px;
  left: 50%;
  width: 2px;
  background: var(--line-light);
  transform: translateX(-50%);
}
.mile-item.done .mile-connector { background: var(--green); opacity: 0.4; }
.mile-item:last-child .mile-connector { display: none; }
.mile-body strong { display: block; font-size: 14.5px; color: var(--text-dark); }
.mile-body span { display: block; font-size: 12.5px; color: var(--text-mute); margin-top: 3px; font-family: var(--font-mono); }
.mile-item.current .mile-body strong { color: var(--gold-deep); }

.map-visual {
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--paper);
}
.map-visual svg { width: 100%; height: auto; display: block; }
.map-note { font-size: 12px; color: var(--text-mute); margin-top: 14px; }

/* Background matches the themed ocean so there's no pale flash before tiles land. */
.leaflet-map { width: 100%; height: 320px; background: #0A1727; border-radius: var(--radius-md); overflow: hidden; }
/* MapLibre GL attribution — keep the required OpenFreeMap/OSM credit, styled subtle. */
.maplibregl-ctrl-attribution {
  font-size: 9.5px !important;
  background: rgba(10, 23, 39, 0.6) !important;
  color: var(--bone-mute) !important;
}
.maplibregl-ctrl-attribution a { color: var(--bone-mute) !important; }
.maplibregl-ctrl-attribution a { color: var(--text-mute); }
.maplibregl-popup-content { font-family: var(--font-body); font-size: 12.5px; border-radius: 8px; padding: 8px 12px; }
.maplibregl-popup-content strong { color: var(--text-dark); }
.map-fallback {
  height: 320px;
  display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 24px;
  color: var(--text-mute); font-size: 13.5px;
}

.map-ship-icon-inner {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  background: var(--white);
  border: 2.5px solid var(--gold);
  border-radius: 50%;
  font-size: 14px;
  box-shadow: var(--shadow-soft);
}
.map-port-icon-inner {
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 2px solid var(--white);
  box-shadow: 0 1px 4px rgba(14,27,46,0.3);
}
/* Both port pins must read against the dark themed basemap — a navy origin dot
   would disappear into the ocean. */
.map-port-icon-inner.origin { background: var(--bone); }
.map-port-icon-inner.dest { background: #7E93B4; }

/* A vessel bobs on swell; a truck on a motorway does not. */
.map-ship-icon-inner.mode-ship { animation: ship-bob 2.4s ease-in-out infinite; }
.map-ship-icon-inner.mode-plane { animation: ship-bob 3.4s ease-in-out infinite; }
.map-ship-icon-inner.mode-truck { animation: none; }
@keyframes ship-bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-3px); }
}

/* Pulsing "live position" beacon under the ship marker */
.map-beacon { position: relative; }
.map-beacon-dot,
.map-beacon-ring {
  position: absolute;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}
.map-beacon-dot {
  width: 10px; height: 10px;
  background: var(--gold);
  border: 2px solid var(--white);
  box-shadow: 0 1px 4px rgba(224,165,61,0.6);
}
.map-beacon-ring {
  width: 10px; height: 10px;
  background: rgba(224,165,61,0.45);
  animation: beacon-pulse 1.9s ease-out infinite;
}
@keyframes beacon-pulse {
  0%   { width: 10px; height: 10px; opacity: 0.8; }
  100% { width: 46px; height: 46px; opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .map-ship-icon-inner,
  .map-beacon-ring { animation: none; }
}

/* "LIVE" badge on the Route card heading */
.map-card h3 { display: flex; align-items: center; gap: 10px; }
.live-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono, monospace);
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.08em;
  color: #B8791E;
  background: rgba(224,165,61,0.12);
  border: 1px solid rgba(224,165,61,0.35);
  padding: 3px 9px; border-radius: 999px;
  text-transform: uppercase;
}
.live-badge::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: var(--gold);
  animation: live-blink 1.4s ease-in-out infinite;
}
@keyframes live-blink {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.25; }
}
@media (prefers-reduced-motion: reduce) {
  .live-badge::before { animation: none; }
}

.result-actions { display: flex; gap: 14px; justify-content: center; margin-top: 36px; flex-wrap: wrap; }
