/* ============================================
   ENHANCED MAP STYLES
   ============================================ */

.map-container {
  position: relative;
  width: 100%;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 10px 40px rgb(0 0 0 / 30%);
  background: var(--color-neutral-900, #18181b);
}

.map-canvas {
  width: 100%;
  min-height: 600px;
  background: var(--color-neutral-950, #0a0a0a);
  position: relative;
  z-index: 1;
}

/* Map Overlay Legend */
.map-overlay {
  position: absolute;
  top: 1rem;
  left: 1rem;
  z-index: 1000;
  background: rgb(24 24 27 / 95%);
  backdrop-filter: blur(10px);
  border: 1px solid var(--color-neutral-700, #3f3f46);
  border-radius: 0.75rem;
  padding: 1rem;
  min-width: 200px;
  box-shadow: 0 4px 16px rgb(0 0 0 / 40%);
}

.map-overlay-title {
  font-size: var(--text-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-neutral-100, #f3f4f6);
  margin: 0 0 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.map-legend {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.map-legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--text-sm);
  color: var(--color-neutral-300, #d1d5db);
}

.map-legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dot-primary {
  background: var(--color-accent-500, #f97316);
  box-shadow: 0 0 8px rgb(249 115 22 / 50%);
}

.dot-secondary {
  background: var(--color-primary-500, #7e22ce);
  box-shadow: 0 0 8px rgb(126 34 206 / 50%);
}

.dot-accent {
  background: var(--color-secondary-500, #06b6d4);
  box-shadow: 0 0 8px rgb(6 182 212 / 50%);
}

/* Custom Leaflet Marker Styles */
.custom-marker {
  background: transparent !important;
  border: none !important;
}

.marker-pin {
  position: relative;
  width: 30px;
  height: 40px;
  border-radius: 50% 50% 50% 0;
  background: var(--color-accent-500, #f97316);
  transform: rotate(-45deg);
  box-shadow: 0 2px 8px rgb(0 0 0 / 40%);
  cursor: pointer;
  transition: all 0.2s ease;
}

.marker-pin:hover {
  transform: rotate(-45deg) scale(1.1);
  box-shadow: 0 4px 16px rgb(249 115 22 / 60%);
}

.marker-pin::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 12px;
  height: 12px;
  background: white;
  border-radius: 50%;
  transform: translate(-50%, -50%) rotate(45deg);
}

/* Popup Styles */
.leaflet-popup-content-wrapper {
  background: var(--color-neutral-900, #18181b) !important;
  border: 1px solid var(--color-neutral-700, #3f3f46) !important;
  border-radius: 0.75rem !important;
  box-shadow: 0 8px 32px rgb(0 0 0 / 40%) !important;
  padding: 0 !important;
}

.leaflet-popup-tip {
  background: var(--color-neutral-900, #18181b) !important;
  border: 1px solid var(--color-neutral-700, #3f3f46) !important;
}

.leaflet-popup-content {
  margin: 0 !important;
  width: 300px !important;
}

.map-popup {
  padding: 1.25rem;
}

.popup-title {
  font-size: var(--text-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--color-neutral-50, #fafafa);
  margin: 0 0 0.75rem;
  line-height: var(--line-height-tight);
}

.popup-content {
  margin-bottom: 1rem;
}

.popup-site-name {
  font-size: var(--text-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-neutral-200, #e5e7eb);
  margin: 0 0 0.5rem;
}

.popup-address {
  font-size: var(--text-sm);
  color: var(--color-neutral-400, #9ca3af);
  margin: 0 0 0.5rem;
  line-height: var(--line-height-normal);
}

.popup-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  font-size: var(--text-xs);
  font-weight: var(--font-weight-semibold);
  background: rgb(249 115 22 / 15%);
  color: var(--color-accent-400, #fb923c);
  border: 1px solid rgb(249 115 22 / 30%);
  border-radius: 9999px;
  text-transform: capitalize;
}

.popup-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem 1rem;
  font-size: var(--text-sm);
  font-weight: var(--font-weight-semibold);
  color: white;
  background: var(--color-accent-600, #ea580c);
  border-radius: 0.5rem;
  text-decoration: none;
  transition: all 0.2s ease;
}

.popup-link:hover {
  background: var(--color-accent-500, #f97316);
  transform: translateX(2px);
}

/* Map Error State */
.map-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 600px;
  padding: 2rem;
  text-align: center;
  background: var(--color-neutral-900, #18181b);
}

.map-error-icon {
  font-size: var(--text-5xl);
  margin-bottom: 1rem;
  opacity: 0.5;
}

.map-error h3 {
  font-size: var(--text-2xl);
  font-weight: var(--font-weight-semibold);
  color: var(--color-neutral-100, #f3f4f6);
  margin: 0 0 0.5rem;
}

.map-error p {
  font-size: var(--text-base);
  color: var(--color-neutral-400, #9ca3af);
  margin: 0 0 1.5rem;
  max-width: 400px;
}

.map-error button {
  padding: 0.75rem 1.5rem;
  font-size: var(--text-sm);
  font-weight: var(--font-weight-semibold);
  color: white;
  background: var(--color-accent-600, #ea580c);
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.map-error button:hover {
  background: var(--color-accent-500, #f97316);
  transform: translateY(-2px);
}

/* Marker Clusters (if using MarkerCluster) */
.marker-cluster {
  background: rgb(249 115 22 / 20%);
  border: 3px solid var(--color-accent-500, #f97316);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--font-weight-bold);
  color: white;
  box-shadow: 0 2px 12px rgb(249 115 22 / 40%);
  transition: all 0.2s ease;
}

.marker-cluster:hover {
  background: rgb(249 115 22 / 40%);
  transform: scale(1.1);
}

.marker-cluster-small {
  width: 40px;
  height: 40px;
  font-size: var(--text-sm);
}

.marker-cluster-medium {
  width: 50px;
  height: 50px;
  font-size: var(--text-base);
}

.marker-cluster-large {
  width: 60px;
  height: 60px;
  font-size: var(--text-lg);
}

/* Leaflet Control Styling */
.leaflet-control-zoom a {
  background: var(--color-neutral-800, #27272a) !important;
  border: 1px solid var(--color-neutral-700, #3f3f46) !important;
  color: var(--color-neutral-100, #f3f4f6) !important;
}

.leaflet-control-zoom a:hover {
  background: var(--color-neutral-700, #3f3f46) !important;
  border-color: var(--color-accent-600, #ea580c) !important;
}

.leaflet-control-attribution {
  background: rgb(24 24 27 / 90%) !important;
  color: var(--color-neutral-400, #9ca3af) !important;
  border-top: 1px solid var(--color-neutral-700, #3f3f46) !important;
}

.leaflet-control-attribution a {
  color: var(--color-accent-400, #fb923c) !important;
}

/* Mobile Responsiveness */
@media (width <=768px) {
  .map-overlay {
    top: 0.5rem;
    left: 0.5rem;
    min-width: 160px;
    padding: 0.75rem;
  }

  .map-overlay-title {
    font-size: var(--text-xs);
  }

  .map-legend-item {
    font-size: var(--text-xs);
  }

  .leaflet-popup-content {
    width: 250px !important;
  }
}
