/* Interactive Service Area Map Styles */
.local-map-card {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 10px 30px rgba(8, 42, 70, 0.07);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.map-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.map-card-title {
  font-weight: 800;
  color: #082A46;
  font-size: 1.15rem;
  line-height: 1.3;
  display: block;
  font-family: 'Manrope', 'Inter', sans-serif;
}

.map-card-subtitle {
  font-size: 0.825rem;
  color: #627D98;
  margin-top: 0.25rem;
}

.map-card-badges {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.map-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.775rem;
  font-weight: 700;
  background: #ECFDF5;
  color: #065F46;
  border: 1px solid #A7F3D0;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  letter-spacing: 0.02em;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10B981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.35);
  animation: pulseDot 2s infinite ease-in-out;
}

@keyframes pulseDot {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.35);
    opacity: 0.7;
  }
}

.map-geo-pill {
  font-size: 0.8rem;
  background: #F1F5F9;
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  font-weight: 600;
  color: #243B53;
  border: 1px solid #E2E8F0;
}

.map-preview-wrap {
  background: #EBF1F7;
  border: 1px solid #D6E4F0;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.04);
}

.service-leaflet-map {
  height: 380px;
  width: 100%;
  border-radius: 12px;
  background: #F1F5F9;
}

/* Custom DivIcon and Pin Markers */
.service-leaflet-div-icon {
  background: transparent;
  border: none;
}

.custom-leaflet-marker {
  position: relative;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.3));
}

.custom-leaflet-marker:hover {
  transform: translateY(-4px) scale(1.1);
  z-index: 9999 !important;
}

/* Tooltip Badges */
.leaflet-tooltip.custom-pin-tooltip {
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  color: #0F172A;
  border-radius: 6px;
  padding: 2px 8px;
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.14);
}

.leaflet-tooltip.custom-pin-tooltip::before {
  border-top-color: #CBD5E1;
}

.leaflet-tooltip.hub-tooltip {
  background: #082A46;
  border: 1px solid #F97316;
  color: #FFFFFF;
}

.leaflet-tooltip.hub-tooltip::before {
  border-top-color: #082A46;
}

.pin-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.hub-badge {
  color: #FFEDD5;
}

/* Popup Styles */
.service-area-custom-popup .leaflet-popup-content-wrapper {
  border-radius: 12px;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 12px 28px rgba(8, 42, 70, 0.2);
  border: 1px solid #CBD5E1;
}

.service-area-custom-popup .leaflet-popup-content {
  margin: 0;
  line-height: 1.5;
}

.service-popup-card {
  padding: 1.15rem 1.25rem;
  background: #FFFFFF;
  font-family: 'Inter', sans-serif;
}

.popup-header {
  margin-bottom: 0.5rem;
}

.popup-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #1478FF;
  background: #EFF6FF;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  margin-bottom: 0.35rem;
}

.popup-badge.hub-badge {
  color: #EA580C;
  background: #FFF7ED;
}

.popup-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 800;
  color: #082A46;
  font-family: 'Manrope', 'Inter', sans-serif;
}

.popup-desc {
  font-size: 0.825rem;
  color: #475569;
  margin: 0.4rem 0 0.6rem 0;
}

.popup-zips {
  font-size: 0.775rem;
  color: #334155;
  margin-bottom: 0.5rem;
  padding: 0.35rem 0.6rem;
  background: #F8FAFC;
  border-radius: 6px;
  border: 1px solid #E2E8F0;
}

.popup-dispatch-tag {
  font-size: 0.75rem;
  font-weight: 700;
  color: #059669;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.popup-phone-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: #F97316;
  color: #FFFFFF !important;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.2s ease;
}

.popup-phone-btn:hover {
  background: #EA580C;
}

/* Reset View Button in Leaflet */
.leaflet-reset-view-btn {
  background-color: #FFFFFF;
  border: 2px solid rgba(0, 0, 0, 0.2);
  border-radius: 4px;
  width: 30px;
  height: 30px;
  line-height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #334155;
  transition: background 0.2s ease, color 0.2s ease;
}

.leaflet-reset-view-btn:hover {
  background-color: #F8FAFC;
  color: #0F172A;
}

/* Service Pins Summary Grid */
.service-pins-summary {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
}

.pins-summary-title {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: #082A46;
  margin-bottom: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.service-pin-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.pin-chip {
  display: inline-flex;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.55rem;
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  border-radius: 9999px;
  color: #1E293B;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.pin-chip:hover {
  background: #EFF6FF;
  border-color: #1478FF;
  color: #1478FF;
  transform: translateY(-1px);
}

.pin-chip.hub {
  background: #FFF7ED;
  border-color: #FDBA74;
  color: #C2410C;
  font-weight: 700;
}

.pin-chip.hub:hover {
  background: #FFEDD5;
  border-color: #F97316;
}

/* Footer of the Map Card */
.map-card-footer {
  margin-top: 1.15rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.map-zip-text {
  font-size: 0.825rem;
  color: #526578;
}

.map-view-all-link {
  font-size: 0.85rem;
  font-weight: 700;
  color: #1478FF;
  text-decoration: underline;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  transition: color 0.2s ease;
}

.map-view-all-link:hover {
  color: #0A58CA;
}

@media (max-width: 640px) {
  .service-leaflet-map {
    height: 320px;
  }
  .map-card-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .map-card-footer {
    flex-direction: column;
    align-items: flex-start;
  }
}
