/* Location Map Component Styles */
.location-map {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  overflow: visible;
  margin: 20px 0;
}

/* Map Header */
.map-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  background: linear-gradient(135deg, #004d97 0%, #cb3839 100%);
  color: white;
  border-radius: 12px 12px 0 0;
  border: 10px solid #f8d447;
}

.map-header h2 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  color: #FFFFFF;
}

.map-stats {
  display: flex;
  gap: 20px;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.stat-number {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1;
  color: #FFFFFF;
}

.stat-label {
  font-size: 0.75rem;
  opacity: 0.9;
  margin-top: 2px;
  color: #FFFFFF;
}

/* Leaflet Map Container */
.leaflet-container {
  border-radius: 0 0 12px 12px;
  font-family: inherit;
}

/* Custom Popup Styles */
.leaflet-popup-content-wrapper {
  border-radius: 8px;
  box-shadow: 0 10px 25px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.leaflet-popup-content {
  margin: 16px;
  line-height: 1.5;
  font-size: 14px;
}

.location-popup {
  min-width: 200px;
}

.location-name {
  margin: 0 0 12px 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: #1f2937;
  border-bottom: 2px solid #e5e7eb;
  padding-bottom: 8px;
}

.location-details p {
  margin: 6px 0;
  color: #4b5563;
  font-size: 0.9rem;
}

.location-details strong {
  color: #374151;
  font-weight: 600;
}

.status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-left: 6px;
}

.status-badge.active {
  background-color: #d1fae5;
  color: #065f46;
}

.status-badge.inactive {
  background-color: #f3f4f6;
  color: #6b7280;
}

.select-location-btn {
  width: 100%;
  margin-top: 12px;
  padding: 8px 16px;
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.select-location-btn:hover {
  background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
}

.select-location-btn:active {
  transform: translateY(0);
}

/* Map Legend */
.map-legend {
  display: flex;
  justify-content: center;
  gap: 20px;
  padding: 16px 24px;
  background-color: #f9fafb;
  border-top: 1px solid #e5e7eb;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: #4b5563;
}

.legend-icon {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid;
}

.legend-icon.active {
  background-color: #3b82f6;
  border-color: #1e40af;
}

.legend-icon.inactive {
  background-color: #6b7280;
  border-color: #4b5563;
}

/* Loading State */
.location-map.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  background: linear-gradient(135deg, #004d97 0%, #cb3839 100%);
}

.loading-container {
  text-align: center;
  color: #FFFFFF;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 200px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #004d97;
  border-top: 4px solid #f8d447;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 16px;
  /* Ensure only the spinner rotates, not the container */
  transform-origin: center;
}

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

.loading-container p {
  margin: 0;
  font-size: 1rem;
  font-weight: 500;
  color: #FFFFFF;
  /* Ensure text doesn't rotate */
  transform: none;
}

/* Error State */
.location-map.error {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
}

.error-message {
  text-align: center;
  color: #dc2626;
  max-width: 400px;
  padding: 24px;
}

.error-message h3 {
  margin: 0 0 12px 0;
  font-size: 1.25rem;
  font-weight: 600;
}

.error-message p {
  margin: 0 0 20px 0;
  color: #7f1d1d;
  line-height: 1.5;
}

.retry-btn {
  padding: 10px 20px;
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.retry-btn:hover {
  background: linear-gradient(135deg, #b91c1c 0%, #991b1b 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(220, 38, 38, 0.3);
}

/* Empty State */
.location-map.empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
}

.empty-message {
  text-align: center;
  color: #0369a1;
  max-width: 400px;
  padding: 24px;
}

.empty-message h3 {
  margin: 0 0 12px 0;
  font-size: 1.25rem;
  font-weight: 600;
}

.empty-message p {
  margin: 0 0 20px 0;
  color: #0c4a6e;
  line-height: 1.5;
}

.empty-message .retry-btn {
  background: linear-gradient(135deg, #0369a1 0%, #075985 100%);
}

.empty-message .retry-btn:hover {
  background: linear-gradient(135deg, #075985 0%, #0c4a6e 100%);
  box-shadow: 0 4px 8px rgba(3, 105, 161, 0.3);
}

/* Responsive Design */
@media (max-width: 768px) {
  .map-header {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }
  
  .map-stats {
    gap: 16px;
  }
  
  .stat {
    min-width: 60px;
  }
  
  .map-legend {
    flex-direction: column;
    gap: 12px;
    align-items: center;
  }
  
  .leaflet-container {
    height: 50vh;
    min-height: 400px;
    max-height: 60vh;
  }
  
  .location-popup {
    min-width: 180px;
  }
}

@media (max-width: 480px) {
  .map-header {
    padding: 16px 20px;
  }
  
  .map-header h2 {
    font-size: 1.25rem;
  }
  
  .map-stats {
    gap: 12px;
  }
  
  .stat-number {
    font-size: 1.1rem;
  }
  
  .stat-label {
    font-size: 0.7rem;
  }
  
  .leaflet-container {
    height: 45vh;
    min-height: 350px;
    max-height: 50vh;
  }
  
  .map-legend {
    padding: 12px 20px;
  }
}


/* ========================================
   INLINE STYLES EXTRACTED TO CSS
   ======================================== */

/* Map container sizing */
.leaflet-container {
  height: 60vh;
  width: 100%;
  min-height: 500px;
  max-height: 80vh;
}
