html, body {
  height: 100%;
  margin: 0;
  font-family: 'Jost', sans-serif;
}

#map {
  position: absolute;
  top: 56px;
  bottom: 0;
  left: 0;
  right: 0;
}

/* Leaflet UI */
.leaflet-control-zoom {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
  margin-left: 8px;
}

.leaflet-bar a {
  background: #fff;
  color: #05a37c;
  border-radius: 4px !important;
  transition: 0.2s;
}

.leaflet-bar a:hover {
  background: #05a37c;
  color: white;
}

.stats-btn {
  background: white;
  border-radius: 8px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #05a37c;
  font-size: 1.1rem;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0,0,0,0.25);
  transition: 0.2s;
}

.stats-btn:hover {
  background: #05a37c;
  color: white;
  transform: scale(1.05);
}

.leaflet-control-layers {
  font-size: 0.8rem;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

@media (max-width: 768px) {
  #statsModal .modal-dialog {
    margin: 1rem;
  }
}
/* ===== Stats Modal ===== */
#statsModal .modal-body {
  height: 350px; /* Fixed height */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden !important; /* Prevent scrollbars */
}

#statsModal canvas {
  width: 100% !important;
  height: 300px !important; /* Chart area */
  max-height: 180px;
}

#statsModal .badge {
  font-size: 0.85rem;
}

@media (max-width: 768px) {
  #statsModal .modal-body {
    height: 300px;
  }
}
/* === Apply Jost font globally to map controls === */
.leaflet-control,
.leaflet-control-layers,
.leaflet-control-layers label,
.leaflet-control-layers-base label span {
  font-family: 'Jost', sans-serif !important;
  font-size: 0.9rem;
  color: #333;
}

/* === Optional Orbital theme accent === */
.leaflet-control-layers {
  border: 1px solid #05a37c !important;
  border-radius: 8px !important;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

/* === Custom Title for Base Layer Control === */
.leaflet-control-layers::before {
  /*content: 'Base Layer Control';*/
  display: block;
  font-family: 'Jost', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  color: #05a37c;
  text-align: center;
  padding: 6px 8px;
  border-bottom: 1px solid rgba(5,163,124,0.2);
}
#locateBtn {
  position: absolute;
  top: 95px;
  left: 10px;
  z-index: 1000;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #05a37c;
  border: none;
  color: white;
  font-size: 1.2rem;
  box-shadow: 0 3px 8px rgba(0,0,0,0.3);
}

#locateBtn.locate-active {
  background-color: #02991b;
  box-shadow: 0 0 10px rgba(5, 163, 124, 0.9);
}

/* Ripple animation */
#locateBtn.locate-active::after {
  content: "";
  position: absolute;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(5, 163, 124, 0.4);
  animation: pulse 1.5s infinite ease-in-out;
  z-index: -1;
}

@keyframes pulse {
  0% { transform: translate(-50%, -50%) scale(0.9); opacity: 0.8; }
  70% { transform: translate(-50%, -50%) scale(1.6); opacity: 0; }
  100% { opacity: 0; }
}
.rotating-arrow {
  transition: transform 0.5s linear;
  transform-origin: center center;
}

.leaflet-routing-container {
  display: none !important; /* Hide the default routing panel */
}

.leaflet-routing-line {
  filter: drop-shadow(0px 0px 3px rgba(0,0,0,0.4));
}
#stopNavBtn {
  position: absolute !important;
  z-index: 3000 !important;
}
.leaflet-popup-content .btn {
  transition: all 0.2s ease-in-out;
}
.leaflet-popup-content .btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 6px rgba(0,0,0,0.15);
}
/* === GPS Arrow Pulse Enhancements === */
.rotating-arrow {
  transform-origin: center center !important;
  transition: transform 0.8s linear, opacity 0.3s ease-in-out;
  opacity: 1;
}

/* Add this class dynamically on each GPS update */
.arrow-pulse {
  animation: pulseArrow 0.8s ease-out;
}

@keyframes pulseArrow {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.25);
    opacity: 0.8;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* === GPS Arrow Pulse === */
.rotating-arrow {
  transform-origin: center center !important;
  transition: transform 0.1s linear, opacity 0.3s ease-in-out;
  opacity: 1;
}

.arrow-pulse {
  animation: pulseArrow 0.1s ease-out;
}

@keyframes pulseArrow {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.25);
    opacity: 0.85;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* === Radar Ping for Accuracy Circle === */
.accuracy-circle {
  transition: all 0.3s ease;
}

.circle-ping {
  stroke: #09b30f;
  stroke-width: 2;
  fill: rgba(9, 179, 15, 0.3);
  transform-origin: center;
  animation: radarPing 1.5s ease-out forwards;
}

@keyframes radarPing {
  0% {
    transform: scale(1);
    opacity: 0.8;
  }
  100% {
    transform: scale(2.2);
    opacity: 0;
  }
}
.rotating-arrow {
  transform-origin: center center !important;
  transition: transform 0.1s linear, opacity 0.3s ease-in-out;
  opacity: 1;
}

.arrow-pulse {
  animation: pulseArrow 0.1s ease-out;
}

@keyframes pulseArrow {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.25); opacity: 0.85; }
  100% { transform: scale(1); opacity: 1; }
}

.circle-ping {
  stroke: #09b30f;
  stroke-width: 2;
  fill: rgba(9, 179, 15, 0.3);
  transform-origin: center;
  animation: radarPing 1.5s ease-out forwards;
}

@keyframes radarPing {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(2.2); opacity: 0; }
}
.rotating-arrow img, .rotating-arrow svg {
  filter: drop-shadow(0 0 4px rgba(152, 203, 0, 0.8));
}
body,
.leaflet-popup-content,
.btn,
input,
select,
textarea {
  font-family: 'Jost', sans-serif !important;
}

.leaflet-popup-content {
  color: #333;
  font-size: 14px;
  font-weight: 500;
}

.leaflet-popup-content h6 {
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 4px;
}

.btn-outline-success {
  border-color: #98cb00;
  color: #98cb00;
  font-weight: 600;
}

.btn-outline-success:hover {
  background-color: #98cb00;
  color: white !important;
}
/* Ensure rotation origin is the center of the map container */
.leaflet-map-pane {
  transform-origin: center center !important;
  will-change: transform;
}

/* Disable pointer transitions while rotating */
.leaflet-map-pane, .leaflet-tile-pane, .leaflet-overlay-pane {
  transition: transform 1s linear;
}
