/* Marker Cluster Styles - Custom optimized version matching waypoint markers */

/* Custom cluster icons */
.custom-cluster-icon {
  background: none !important;
  border: none !important;
}

.custom-cluster {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  color: white;
  text-align: center;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.06);
  border: 3px solid white;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.custom-cluster:hover {
  transform: scale(1.1);
  box-shadow: 0 10px 15px rgba(0, 0, 0, 0.2), 0 4px 6px rgba(0, 0, 0, 0.1);
}

.custom-cluster span {
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}

/* Size variants matching the marker color scheme */
.cluster-small {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.cluster-small span {
  font-size: 12px;
}

.cluster-medium {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

.cluster-medium span {
  font-size: 14px;
}

.cluster-large {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
}

.cluster-large span {
  font-size: 16px;
}

/* Animation for cluster transitions */
.leaflet-cluster-anim .leaflet-marker-icon,
.leaflet-cluster-anim .leaflet-marker-shadow {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
              opacity 0.3s ease-in;
}

/* Spider legs for expanded clusters */
.leaflet-cluster-spider-leg {
  stroke: #2563eb;
  stroke-width: 2;
  stroke-opacity: 0.5;
  transition: stroke-dashoffset 0.3s ease-out, 
              stroke-opacity 0.3s ease-in;
}

/* Hover effect on spider legs */
.leaflet-cluster-spider-leg:hover {
  stroke-opacity: 0.8;
  stroke-width: 3;
}

/* Override default marker cluster styles */
.marker-cluster-small,
.marker-cluster-medium,
.marker-cluster-large {
  background-color: transparent !important;
}

.marker-cluster-small div,
.marker-cluster-medium div,
.marker-cluster-large div {
  background-color: transparent !important;
}

/* Ensure clusters are above regular markers but below popups */
.custom-cluster-icon {
  z-index: 600 !important;
}

/* Pulse animation for new clusters (optional) */
@keyframes cluster-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(37, 99, 235, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0);
  }
}

.custom-cluster.new {
  animation: cluster-pulse 1.5s ease-out;
}

/* Active/clicked state */
.custom-cluster:active {
  transform: scale(0.95);
}

/* Make sure text is always readable */
.custom-cluster span {
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  user-select: none;
}

