/* assets/css/maps.css - Map Container and Coordinate Picker */
.map-container {
  width: 100%;
  height: 380px;
  border-radius: 14px;
  overflow: hidden;
  position: relative;
  border: 1px solid #cbd5e1;
  background: #f1f5f9;
}

.map-container.large {
  height: 520px;
}

@media (max-width: 768px) {
  .map-container {
    height: 280px;
  }
  .map-container.large {
    height: 320px;
  }
}

.map-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 1.5rem;
  text-align: center;
  background: #f8fafc;
  color: #64748b;
}

.map-badge-coords {
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(4px);
  color: #ffffff;
  padding: 4px 10px;
  border-radius: 20px;
  font-family: monospace;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
}

/* Custom Location Map Markers with Vehicle Count Badge */
.custom-loc-marker {
  background: transparent !important;
  border: none !important;
}

.loc-map-marker-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform-origin: center center;
  width: 56px;
  height: 44px;
}

.loc-map-marker-wrap:hover {
  transform: scale(1.18);
  z-index: 9999 !important;
}

.loc-pin-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  border: 2.5px solid #ffffff;
  font-size: 19px;
  position: relative;
}

.loc-pin-emoji {
  line-height: 1;
  display: inline-block;
  user-select: none;
}

.loc-count-badge {
  position: absolute;
  top: -8px;
  right: -16px;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 10px;
  font-weight: 800;
  padding: 1.5px 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  white-space: nowrap;
  line-height: 1.2;
}

.loc-count-badge.zero {
  background: #64748b;
  color: #ffffff;
}

.loc-count-badge.single {
  background: #059669;
  color: #ffffff;
}

.loc-count-badge.multiple {
  background: #7c3aed;
  color: #ffffff;
  animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {
  0%, 100% { box-shadow: 0 0 0 0 rgba(124, 58, 237, 0.5); }
  50% { box-shadow: 0 0 0 5px rgba(124, 58, 237, 0); }
}

/* Hover Tooltip Popup Card Styling */
.leaflet-tooltip.loc-hover-tooltip {
  background: #ffffff !important;
  color: #0f172a !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 12px !important;
  box-shadow: 0 14px 30px -4px rgba(15, 23, 42, 0.22), 0 4px 8px -2px rgba(15, 23, 42, 0.08) !important;
  padding: 10px 12px !important;
  white-space: normal !important;
  min-width: 240px !important;
  max-width: 300px !important;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
  font-size: 12px !important;
  line-height: 1.4 !important;
  pointer-events: none !important;
  z-index: 1000 !important;
}

.leaflet-tooltip-top.loc-hover-tooltip::before {
  border-top-color: #ffffff !important;
}
.leaflet-tooltip-bottom.loc-hover-tooltip::before {
  border-bottom-color: #ffffff !important;
}
.leaflet-tooltip-left.loc-hover-tooltip::before {
  border-left-color: #ffffff !important;
}
.leaflet-tooltip-right.loc-hover-tooltip::before {
  border-right-color: #ffffff !important;
}

.loc-hover-card-inner {
  display: flex;
  flex-direction: column;
}

.loc-hover-header {
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 6px;
  margin-bottom: 8px;
}

.loc-hover-name {
  font-weight: 800;
  font-size: 13px;
  color: #0f172a;
  line-height: 1.3;
  display: flex;
  align-items: center;
  gap: 6px;
}

.loc-hover-subtitle {
  font-size: 10px;
  color: #64748b;
  margin-top: 2px;
  font-weight: 600;
}

.loc-hover-section-title {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #475569;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.loc-hover-count {
  background: #f1f5f9;
  color: #334155;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 700;
}

.loc-hover-vehicles-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 180px;
  overflow-y: auto;
}

.loc-hover-veh-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 6px 8px;
}

.loc-hover-veh-card.is-second {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.loc-hover-veh-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 4px;
}

.loc-hover-plate {
  font-family: 'Courier New', Courier, monospace;
  font-weight: 900;
  font-size: 11px;
  letter-spacing: 0.8px;
  color: #ffffff;
  padding: 2px 7px;
  border-radius: 4px;
  display: inline-block;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}

.loc-hover-plate-tag {
  font-size: 9px;
  font-weight: 800;
  padding: 2px 5px;
  border-radius: 4px;
  letter-spacing: 0.3px;
}

.loc-hover-veh-desc {
  font-size: 11px;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 2px;
}

.loc-hover-veh-owner {
  font-size: 10px;
  color: #64748b;
}

.loc-hover-empty {
  font-size: 11px;
  color: #94a3b8;
  padding: 6px 0;
  font-style: italic;
  text-align: center;
}

.loc-hover-hint {
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid #f1f5f9;
  font-size: 9px;
  color: #94a3b8;
  text-align: center;
  font-weight: 600;
}

.loc-plates-strip {
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  gap: 2.5px;
  align-items: center;
}

.map-mini-plate {
  font-family: 'Courier New', Courier, monospace, sans-serif;
  font-weight: 800;
  font-size: 10px;
  padding: 1.5px 6px;
  border-radius: 4px;
  letter-spacing: 0.8px;
  white-space: nowrap;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.35);
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

/* Plat Hitam = Standar */
.map-mini-plate.plate-black {
  background: #111827;
  color: #ffffff;
  border: 1.5px solid #4b5563;
}

/* Plat Merah = Rumah Pokok */
.map-mini-plate.plate-red {
  background: #dc2626;
  color: #ffffff;
  border: 1.5px solid #fca5a5;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Plat Biru = Usaha / Kantor */
.map-mini-plate.plate-blue {
  background: #1d4ed8;
  color: #ffffff;
  border: 1.5px solid #93c5fd;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Plat Hijau = Sering Berkunjung */
.map-mini-plate.plate-green {
  background: #059669;
  color: #ffffff;
  border: 1.5px solid #6ee7b7;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Hide plates and labels from the map marker pin (shown inside hover popup) */
.loc-plates-strip,
.map-loc-label {
  display: none !important;
}
