/* ============================================================
   WAZE-STYLE HUD OVERLAY
   ============================================================ */

/* ── NAV HUD root ─────────────────────────────────────────── */
/* NOTE: #nav-hud is a sibling of #map (NOT inside it), so map
   rendering and navigation HUD state remain independent. */
#nav-hud {
  position: absolute;
  /* Offset left by sidebar width so HUD covers only the map area */
  left: var(--sidebar-w, 300px);
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 600;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* When sidebar is hidden during nav, expand HUD to full width */
.sidebar.nav-hidden ~ #nav-hud,
#nav-hud.full-width {
  left: 0;
}

#nav-hud.hidden { display: none; }

@media (max-width: 768px) {
  #nav-hud {
    left: 0 !important;
  }
}

/* ══════════════════════════════════════════════════════════
   TOP DIRECTION BANNER
   ══════════════════════════════════════════════════════════ */
.waze-top-bar {
  pointer-events: all;
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.875rem 1rem 0.875rem 1rem;
  background: #111827;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 6px 30px rgba(0,0,0,0.6);
  animation: wazeBannerIn 0.4s cubic-bezier(0.34,1.56,0.64,1) both;
}

@keyframes wazeBannerIn {
  from { transform: translateY(-100%); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

/* Turn arrow box */
.waze-arrow-box {
  flex-shrink: 0;
  width: 60px;
  height: 60px;
  border-radius: 14px;
  background: #2563eb;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.24);
  position: relative;
  overflow: hidden;
}

.waze-arrow-box::after {
  content: '';
  position: absolute;
  inset: 0;
  background: transparent;
  border-radius: inherit;
}

#nav-arrow {
  font-size: 2.1rem;
  font-weight: 900;
  color: #fff;
  line-height: 1;
  text-shadow: 0 2px 6px rgba(0,0,0,0.4);
}

/* Text block */
.waze-direction-text {
  flex: 1;
  min-width: 0;
}

.waze-dist-to-turn {
  font-size: 1.5rem;
  font-weight: 800;
  color: #f9fafb;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

#nav-instruction {
  font-size: 0.9rem;
  font-weight: 600;
  color: #9ca3af;
  margin-top: 0.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#nav-next-hint {
  font-size: 0.7rem;
  color: #64748b;
  margin-top: 0.1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Exit badge */
.waze-exit-badge {
  flex-shrink: 0;
  background: #f59e0b;
  color: #000;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Stop button */
#nav-stop-btn {
  flex-shrink: 0;
  pointer-events: all;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(239,68,68,0.15);
  border: 1.5px solid rgba(239,68,68,0.4);
  color: #f87171;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}
#nav-stop-btn:hover {
  background: rgba(239,68,68,0.3);
  color: #fff;
  transform: scale(1.1);
}

/* Route rain warning below the turn banner */
.nav-rain-alert {
  position: absolute;
  top: calc(92px + env(safe-area-inset-top, 0px));
  left: 12px;
  right: 12px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  max-width: 520px;
  padding: 10px 12px;
  background: rgba(12, 18, 29, 0.96);
  border: 1px solid rgba(245, 158, 11, 0.7);
  border-left: 4px solid #f59e0b;
  border-radius: 10px;
  color: #f9fafb;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
  pointer-events: auto;
  cursor: pointer;
  z-index: 1;
}
.nav-rain-alert.hidden { display: none; }
.nav-rain-alert-icon { font-size: 1.25rem; line-height: 1.2; }
.nav-rain-alert-copy { display: flex; flex: 1; flex-direction: column; gap: 2px; min-width: 0; }
.nav-rain-alert-copy strong { font-size: 0.82rem; }
.nav-rain-alert-copy span { font-size: 0.76rem; line-height: 1.4; color: #e5e7eb; }
.nav-rain-alert-copy small { font-size: 0.65rem; color: #9ca3af; }
.nav-rain-alert-action { margin-top: 3px; font-size: 0.7rem; font-weight: 700; color: #fbbf24; }
.nav-rain-alert-radar-credit { width: fit-content; font-size: 0.65rem; color: #93c5fd; text-decoration: underline; }
.nav-rain-alert-radar-credit.hidden { display: none; }
.nav-rain-alert-close {
  flex: none;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.1);
  color: #f9fafb;
  font-size: 1.25rem;
  cursor: pointer;
}
.nav-rain-alert-close:hover, .nav-rain-alert-close:focus-visible { background: rgba(255, 255, 255, 0.22); }
.app-container:has(#nav-rain-alert:not(.hidden)) #sidebar-toggle-btn { top: 218px; }

/* ══════════════════════════════════════════════════════════
   LEFT SPEED DIAL
   ══════════════════════════════════════════════════════════ */
.waze-speed-dial {
  pointer-events: all;
  position: absolute;
  left: 1rem;
  bottom: 7rem;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: #1f2937;
  border: 2.5px solid rgba(255,255,255,0.08);
  box-shadow: 0 4px 20px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  animation: wazeDialIn 0.5s cubic-bezier(0.34,1.56,0.64,1) 0.1s both;
}

@keyframes wazeDialIn {
  from { transform: scale(0.5); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

#nav-speed {
  font-size: 1.5rem;
  font-weight: 900;
  color: #f9fafb;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.04em;
}

.speed-unit {
  font-size: 0.58rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 1px;
}

/* Speed limit exceeded flash */
.waze-speed-dial.over-limit {
  border-color: #ef4444;
  animation: speedAlert 0.5s ease-in-out infinite alternate;
}
@keyframes speedAlert {
  from { box-shadow: 0 4px 20px rgba(0,0,0,0.6); }
  to   { box-shadow: 0 4px 20px rgba(0,0,0,0.6); }
}

/* ETA mini chip next to speed */
.waze-eta-chip {
  pointer-events: none;
  position: absolute;
  left: 1rem;
  bottom: 12.5rem;
  background: #1e293b;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  padding: 0.3rem 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  backdrop-filter: blur(10px);
  animation: wazeDialIn 0.5s cubic-bezier(0.34,1.56,0.64,1) 0.15s both;
}

#nav-remain-time-mini {
  font-size: 0.85rem;
  font-weight: 800;
  color: #f9fafb;
  font-variant-numeric: tabular-nums;
}
.eta-chip-label {
  font-size: 0.6rem;
  color: #94a3b8;
  font-weight: 600;
}

/* ══════════════════════════════════════════════════════════
   REPORT BUTTON (Yellow triangle, Waze style)
   ══════════════════════════════════════════════════════════ */
.nav-recenter-btn {
  pointer-events: auto;
  position: absolute;
  right: 1rem;
  bottom: 11.5rem;
  min-width: 56px;
  min-height: 48px;
  padding: 0.5rem 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid rgba(59, 130, 246, 0.55);
  border-radius: 12px;
  background: #1e3a8a;
  color: #fff;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  z-index: 2;
}
.nav-recenter-btn.hidden { display: none; }
.nav-recenter-btn:hover, .nav-recenter-btn:focus-visible { background: #2563eb; }

.waze-report-btn {
  pointer-events: all;
  position: absolute;
  right: 1rem;
  bottom: 7rem;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: #f59e0b;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 18px rgba(0,0,0,0.24);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34,1.56,0.64,1);
  animation: wazeReportIn 0.5s cubic-bezier(0.34,1.56,0.64,1) 0.2s both;
  flex-direction: column;
  gap: 2px;
}
@keyframes wazeReportIn {
  from { transform: scale(0) rotate(-45deg); opacity: 0; }
  to   { transform: scale(1) rotate(0); opacity: 1; }
}
.waze-report-btn:hover {
  transform: scale(1.1) translateY(-2px);
  box-shadow: 0 8px 28px rgba(0,0,0,0.3);
}
.waze-report-btn:active { transform: scale(0.95); }

.waze-report-btn svg { flex-shrink: 0; }
.waze-report-btn-label {
  font-size: 0.52rem;
  font-weight: 700;
  color: rgba(0,0,0,0.75);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

/* ══════════════════════════════════════════════════════════
   BOTTOM INFO BAR  (Waze style)
   ══════════════════════════════════════════════════════════ */
.waze-bottom-bar {
  pointer-events: all;
  display: flex;
  align-items: center;
  padding: 0.75rem 1.25rem 1rem;
  background: #111827;
  border-top: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 -6px 30px rgba(0,0,0,0.5);
  gap: 0;
  animation: wazeBarIn 0.4s cubic-bezier(0.34,1.56,0.64,1) both;
}
@keyframes wazeBarIn {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

.waze-bottom-cell {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
}

.waze-bottom-value {
  font-size: 1.1rem;
  font-weight: 800;
  color: #f9fafb;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.waze-bottom-label {
  font-size: 0.6rem;
  color: #9ca3af;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.waze-bottom-divider {
  width: 1px;
  height: 30px;
  background: rgba(255,255,255,0.07);
  flex-shrink: 0;
}

/* Clock cell */
.waze-clock-cell {
  flex: 1.2;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#nav-clock {
  font-size: 1.1rem;
  font-weight: 800;
  color: #f9fafb;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.waze-clock-sub {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.15rem;
}

#nav-eta {
  font-size: 0.7rem;
  color: #9ca3af;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.waze-clock-dot { color: #334155; font-size: 0.65rem; }

#nav-remain-dist-bottom {
  font-size: 0.7rem;
  color: #64748b;
  font-weight: 600;
}

/* ══════════════════════════════════════════════════════════
   REROUTE OVERLAY
   ══════════════════════════════════════════════════════════ */
.nav-reroute-overlay {
  pointer-events: none;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%,-50%) scale(0.9);
  z-index: 650;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.5rem;
  background: #111827;
  backdrop-filter: blur(16px);
  border: 1.5px solid rgba(255,255,255,0.08);
  border-radius: 999px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
.nav-reroute-overlay.visible {
  opacity: 1;
  transform: translate(-50%,-50%) scale(1);
}
.reroute-spinner {
  width: 20px; height: 20px;
  border: 2.5px solid rgba(255,255,255,0.08);
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.reroute-text {
  font-size: 0.8125rem; font-weight: 700;
  color: #f9fafb; white-space: nowrap;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ══════════════════════════════════════════════════════════
   REPORT MODAL  (Waze "What do you see?" sheet)
   ══════════════════════════════════════════════════════════ */
.report-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  animation: backdropIn 0.2s ease both;
}
@keyframes backdropIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.report-modal-backdrop.closing {
  animation: backdropOut 0.22s ease both;
}
@keyframes backdropOut {
  from { opacity: 1; }
  to   { opacity: 0; }
}

.report-modal {
  background: #111827;
  border-radius: 22px 22px 0 0;
  border-top: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 -12px 50px rgba(0,0,0,0.7);
  padding: 1rem 1.25rem 2rem;
  max-height: 90vh;
  overflow-y: auto;
  animation: sheetIn 0.35s cubic-bezier(0.34,1.56,0.64,1) both;
}
@keyframes sheetIn {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
.report-modal-backdrop.closing .report-modal {
  animation: sheetOut 0.22s ease both;
}
@keyframes sheetOut {
  from { transform: translateY(0); }
  to   { transform: translateY(100%); }
}

/* Handle */
.report-handle {
  width: 36px; height: 4px;
  border-radius: 2px;
  background: rgba(255,255,255,0.15);
  margin: 0 auto 1rem;
}

/* Header */
.report-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}
.report-modal-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #f9fafb;
}
.report-modal-close {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  color: #94a3b8;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 1rem;
  transition: all 0.2s;
}
.report-modal-close:hover { background: rgba(255,255,255,0.15); color: #fff; }

/* Grid of report categories */
.report-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.875rem;
  margin-bottom: 0.5rem;
}

.report-category-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 0.25rem;
  background: #1f2937;
  border: 1.5px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34,1.56,0.64,1);
}
.report-category-btn:hover {
  background: #2d3748;
  border-color: rgba(255,255,255,0.08);
  transform: translateY(-2px) scale(1.03);
}
.report-category-btn:active { transform: scale(0.97); }

.report-icon-circle {
  width: 58px; height: 58px;
  border-radius: 50%;
  background: #1e293b !important;
  border: 1.5px solid rgba(255,255,255,0.08) !important;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.75rem;
  transition: all 0.2s;
}
.report-category-btn:hover .report-icon-circle {
  background: #374151;
  border-color: rgba(255,255,255,0.08);
}

.report-category-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: #9ca3af;
  text-align: center;
}

/* ── Sub-type sheet ─────────────────────────────────────── */
.report-subtype-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.report-back-btn {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  color: #94a3b8;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 1rem;
  transition: all 0.2s;
}
.report-back-btn:hover { background: rgba(255,255,255,0.15); color: #fff; }
.report-subtype-title { font-size: 1.1rem; font-weight: 800; color: #f9fafb; }

.report-subtype-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.875rem;
  margin-bottom: 1.25rem;
}

.report-subtype-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 0.25rem;
  background: rgba(255,255,255,0.04);
  border: 2px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34,1.56,0.64,1);
}
.report-subtype-btn:hover {
  background: #2d3748;
  border-color: rgba(255,255,255,0.08);
  transform: translateY(-2px);
}
.report-subtype-btn.selected {
  background: #1f2937;
  border-color: rgba(37,99,235,0.5);
  box-shadow: none;
}
.report-subtype-btn .report-icon-circle { width: 54px; height: 54px; font-size: 1.6rem; }
.report-subtype-label { font-size: 0.68rem; font-weight: 600; color: #9ca3af; text-align: center; }

/* Report action buttons */
.report-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.5rem;
}
.report-cancel-btn {
  flex: 1;
  padding: 0.875rem;
  border-radius: 12px;
  background: rgba(255,255,255,0.06);
  border: 1.5px solid rgba(255,255,255,0.12);
  color: #f9fafb;
  font-size: 0.9rem; font-weight: 700;
  cursor: pointer; transition: all 0.2s;
}
.report-cancel-btn:hover { background: rgba(255,255,255,0.1); }

.report-submit-btn {
  flex: 1.5;
  padding: 0.875rem;
  border-radius: 12px;
  background: #2563eb;
  border: none;
  color: #fff;
  font-size: 0.9rem; font-weight: 700;
  cursor: pointer; transition: all 0.2s;
  box-shadow: 0 4px 16px rgba(0,0,0,0.24);
}
.report-submit-btn:hover { transform: translateY(-1px); background: #1d4ed8; box-shadow: 0 6px 22px rgba(0,0,0,0.3); }
.report-submit-btn:disabled {
  opacity: 0.4; cursor: not-allowed; transform: none;
}

/* ══════════════════════════════════════════════════════════
   WAZE-STYLE MAP REPORT BADGES
   Circular icon badge with a pointed tail — like the reference image
   ══════════════════════════════════════════════════════════ */
.wr-map-badge {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.55));
  animation: wrBadgeIn 0.4s cubic-bezier(0.34,1.56,0.64,1) both;
  transform-origin: bottom center;
}

@keyframes wrBadgeIn {
  from { transform: scale(0) translateY(10px); opacity: 0; }
  to   { transform: scale(1) translateY(0);    opacity: 1; }
}

.wr-badge-circle {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #f59e0b;
  border: 3px solid rgba(255,255,255,0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0,0,0,0.3);
  transition: transform 0.18s cubic-bezier(0.34,1.56,0.64,1);
  position: relative;
  overflow: hidden;
}

/* Subtle shine inside circle */
.wr-badge-circle::after {
  content: '';
  position: absolute;
  top: 3px; left: 5px;
  width: 55%;
  height: 40%;
  background: rgba(255,255,255,0.25);
  border-radius: 50%;
}

.wr-map-badge:hover .wr-badge-circle {
  transform: scale(1.15);
}

.wr-badge-icon {
  font-size: 1.35rem;
  line-height: 1;
  position: relative;
  z-index: 1;
}

/* Pointed tail below the circle */
.wr-badge-tail {
  width: 0;
  height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: 10px solid #f59e0b;
  margin-top: -1px;
  filter: drop-shadow(0 3px 3px rgba(0,0,0,0.3));
}

/* Small dot at tip */
.wr-map-badge::after {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255,255,255,0.6);
  margin-top: 1px;
}
