/* Enhanced CE Delivery Map - Pin Styles */

/* Pin Icons */
.cedm-custom-icon {
  background: transparent !important;
  border: none !important;
}

.cedm-pin-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 32px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
  transition: transform 0.2s ease;
}

.cedm-pin-icon:hover {
  transform: scale(1.1);
}

.cedm-pin-icon svg {
  width: 100%;
  height: 100%;
}

/* Animated pin drop effect */
@keyframes pinDrop {
  0% {
    transform: translateY(-20px);
    opacity: 0;
  }
  60% {
    transform: translateY(3px);
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

.leaflet-marker-icon {
  animation: pinDrop 0.5s ease-out;
}

/* Pin Popups */
.cedm-popup {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.cedm-pin-popup {
  padding: 10px;
}

.cedm-pin-popup h4 {
  margin: 0 0 10px 0;
  color: #333;
  font-size: 16px;
  font-weight: 600;
}

.cedm-pin-popup p {
  margin: 0 0 10px 0;
  color: #666;
  font-size: 14px;
  line-height: 1.5;
}

.cedm-pin-link {
  display: inline-block;
  color: #4A90E2;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s ease;
}

.cedm-pin-link:hover {
  color: #357ABD;
  text-decoration: underline;
}

/* Custom Popup Styling */
.leaflet-popup-content-wrapper {
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.leaflet-popup-tip {
  box-shadow: 0 3px 8px rgba(0,0,0,0.15);
}

/* Loading and Error States */
.cedm-loading-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 12px;
}

.cedm-loading-content {
  text-align: center;
  color: #666;
}

.cedm-spinner {
  width: 40px;
  height: 40px;
  margin: 0 auto 15px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #4A90E2;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.cedm-error {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  background: #fff5f5;
  border: 1px solid #fed7d7;
  border-radius: 8px;
}

.cedm-error-content {
  text-align: center;
  padding: 20px;
  color: #c53030;
}

.cedm-error-title {
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 8px;
}

.cedm-error-message {
  font-size: 14px;
}

/* Enhanced Tooltips */
.cedm-tooltip {
  background: rgba(0, 0, 0, 0.85) !important;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  color: white !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  padding: 8px 12px;
}

.cedm-tooltip.leaflet-tooltip-top:before {
  border-top-color: rgba(0, 0, 0, 0.85);
}

.cedm-tooltip.leaflet-tooltip-bottom:before {
  border-bottom-color: rgba(0, 0, 0, 0.85);
}

.cedm-tooltip.leaflet-tooltip-left:before {
  border-left-color: rgba(0, 0, 0, 0.85);
}

.cedm-tooltip.leaflet-tooltip-right:before {
  border-right-color: rgba(0, 0, 0, 0.85);
}

.cedm-country-tooltip strong,
.cedm-region-tooltip strong {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
}

.cedm-region-tooltip span {
  display: block;
  opacity: 0.9;
}

/* Legend Enhancements */
.cedm-legend {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 8px;
  padding: 15px;
  margin-top: 15px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.cedm-legend h4 {
  margin: 0 0 12px 0;
  font-size: 16px;
  font-weight: 600;
  color: #333;
}

.cedm-legend-items {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.cedm-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 14px;
}

.cedm-legend-item:hover {
  background: #f8f9fa;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.cedm-legend-item.active {
  background: #4A90E2;
  color: white;
  border-color: #4A90E2;
}

.cedm-legend-color {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.cedm-legend-item.active .cedm-legend-color {
  border-color: rgba(255, 255, 255, 0.3);
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .cedm-legend {
    padding: 12px;
  }
  
  .cedm-legend h4 {
    font-size: 14px;
    margin-bottom: 10px;
  }
  
  .cedm-legend-items {
    gap: 8px;
  }
  
  .cedm-legend-item {
    padding: 5px 10px;
    font-size: 13px;
  }
  
  .cedm-legend-color {
    width: 14px;
    height: 14px;
  }
  
  .cedm-pin-popup h4 {
    font-size: 15px;
  }
  
  .cedm-pin-popup p {
    font-size: 13px;
  }
}

/* Pin Clustering (if enabled) */
.marker-cluster {
  background-clip: padding-box;
  border-radius: 20px;
}

.marker-cluster div {
  width: 30px;
  height: 30px;
  margin-left: 5px;
  margin-top: 5px;
  text-align: center;
  border-radius: 15px;
  font: 12px "Helvetica Neue", Arial, Helvetica, sans-serif;
}

.marker-cluster-small {
  background-color: rgba(110, 204, 57, 0.6);
}

.marker-cluster-small div {
  background-color: rgba(110, 204, 57, 0.6);
}

.marker-cluster-medium {
  background-color: rgba(240, 194, 12, 0.6);
}

.marker-cluster-medium div {
  background-color: rgba(240, 194, 12, 0.6);
}

.marker-cluster-large {
  background-color: rgba(241, 128, 23, 0.6);
}

.marker-cluster-large div {
  background-color: rgba(241, 128, 23, 0.6);
}