/* ============================================================
   Eventado — Live tracking page
   Tokens:
     --acai      #3D1F47  (deep açaí purple — text, primary dark)
     --berry     #E84591  (berry pink — primary accent / CTA)
     --cream     #FFF6ED  (base card surface)
     --mint      #6FD9A6  (fresh mint — "live" accent)
     --ink-soft  #6B4E74  (secondary text on cream)
   Type:
     Display / brand: 'Fredoka' (rounded, friendly, fruity)
     Body / UI:        'Nunito Sans'
   ============================================================ */

:root {
  --acai: #3D1F47;
  --berry: #E84591;
  --berry-dark: #C22E73;
  --cream: #FFF6ED;
  --mint: #6FD9A6;
  --ink-soft: #6B4E74;
  --shadow-lg: 0 12px 32px rgba(61, 31, 71, 0.18);
  --shadow-sm: 0 4px 12px rgba(61, 31, 71, 0.14);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  font-family: 'Nunito Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--acai);
  background: var(--cream);
  overscroll-behavior: none;
}

#map {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: #EAE3DD;
}

/* Keep Leaflet's own attribution readable over the floating UI */
.leaflet-control-attribution {
  font-size: 10px;
  border-radius: 6px 0 0 0;
}

/* ---------------- Top card ---------------- */

.top-card {
  position: absolute;
  top: calc(16px + var(--safe-top));
  left: 16px;
  right: 16px;
  z-index: 500;
  background: rgba(255, 246, 237, 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 16px 18px;
  box-shadow: var(--shadow-lg);
  max-width: 420px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.brand-mark {
  font-size: 22px;
  line-height: 1;
}

.brand-name {
  font-family: 'Fredoka', 'Nunito Sans', sans-serif;
  font-weight: 600;
  font-size: 19px;
  letter-spacing: 0.2px;
  color: var(--acai);
}

.status-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pulse-dot {
  position: relative;
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--mint);
}

.pulse-dot::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--mint);
  animation: pulse-ring 1.8s ease-out infinite;
}

.pulse-dot.is-offline {
  background: #C9BFC7;
}
.pulse-dot.is-offline::after {
  animation: none;
  display: none;
}

@keyframes pulse-ring {
  0%   { transform: scale(1);   opacity: 0.55; }
  100% { transform: scale(2.8); opacity: 0; }
}

.status-text {
  margin: 0;
  font-family: 'Fredoka', sans-serif;
  font-weight: 500;
  font-size: 15.5px;
  color: var(--acai);
}

.status-sub {
  margin: 4px 0 0 18px;
  font-size: 12.5px;
  color: var(--ink-soft);
}

/* ---------------- Reconnect banner ---------------- */

.reconnect-banner {
  position: absolute;
  top: calc(16px + var(--safe-top));
  left: 50%;
  transform: translate(-50%, -140%);
  z-index: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--acai);
  color: var(--cream);
  font-size: 13px;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  opacity: 0;
  transition: transform 0.35s ease, opacity 0.35s ease;
  pointer-events: none;
  white-space: nowrap;
}

.reconnect-banner.is-visible {
  transform: translate(-50%, 0);
  opacity: 1;
}

.reconnect-spinner {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 2px solid rgba(255, 246, 237, 0.35);
  border-top-color: var(--cream);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---------------- Trip card (bottom sheet, Uber/InDrive style) ---------------- */

.trip-card {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: calc(16px + var(--safe-bottom));
  z-index: 500;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.trip-row {
  display: flex;
  align-items: center;
}

/* Row 1 — vehicle */
.trip-row--vehicle {
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(61, 31, 71, 0.08);
}

.vehicle-title {
  margin: 0;
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  font-size: 15.5px;
  color: var(--acai);
}

.vehicle-sub {
  margin: 2px 0 0;
  font-size: 12.5px;
  color: var(--ink-soft);
}

.vehicle-photo {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  object-fit: cover;
  flex-shrink: 0;
  
}

/* Row 2 — driver / chat / help, 3 equal columns */
.trip-row--actions {
  padding: 14px 10px 16px;
  justify-content: space-between;
}

.trip-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1;
  text-decoration: none;
}

.trip-col-label {
  font-family: 'Nunito Sans', sans-serif;
  font-weight: 700;
  font-size: 11px;
  color: var(--acai);
  text-align: center;
  line-height: 1.2;
  max-width: 78px;
}

.driver-photo {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--cream);
  box-shadow: var(--shadow-sm);
  background: #EAE3DD;
}

.action-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #c4f222;
  color: var(--acai);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease;
}

.trip-col:active .action-icon {
  transform: scale(0.92);
}

/* ---------------- Scooter marker ---------------- */

.scooter-marker {
  width: 44px;
  height: 44px;
  transition: transform 0.15s linear;
  filter: drop-shadow(0 3px 6px rgba(61, 31, 71, 0.35));
}

.scooter-marker img {
  width: 100%;
  height: 100%;
  display: block;
}

/* ---------------- Hub marker (fixed pickup point) ---------------- */

.hub-marker {
  width: 60px;
  height: 60px;
  filter: drop-shadow(0 3px 6px rgba(61, 31, 71, 0.35));
}

.hub-marker img {
  width: 100%;
  height: 100%;
  display: block;
}

/* ---------------- Responsive ---------------- */

@media (min-width: 640px) {
  .top-card { left: 24px; }
  .action-bar { left: 24px; right: auto; width: 420px; }
}

@media (prefers-reduced-motion: reduce) {
  .pulse-dot::after { animation: none; }
  .scooter-marker { transition: none; }
  .reconnect-spinner { animation-duration: 1.6s; }
}


/* ---------------- Order pins (geolocation only, number badge) ---------------- */

.order-pin {
  display: flex;
  align-items: center;
  justify-content: center;
}

.order-pin span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 14px;
  background: red;
  color: var(--cream);
  border: 3px solid var(--cream);
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  font-size: 15px;
  box-shadow: var(--shadow-sm);
}