/* Leaflet specific styles moved off the critical path */
.leaflet-container {
  background: #1a1a1a !important;
  touch-action: manipulation;
  height: 100% !important;
  width: 100% !important;
}

.leaflet-popup-content-wrapper {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.leaflet-popup-tip {
  background: rgba(255, 255, 255, 0.95);
}

.leaflet-popup-content {
  margin: 8px 12px;
  min-width: 200px;
}

/* Custom styles for video popups */
.video-popup .leaflet-popup-content-wrapper {
  padding: 0;
  overflow: hidden;
}

.video-popup .leaflet-popup-content {
  margin: 0;
  width: 320px !important;
  max-width: 100%;
}

.poi-popup {
  width: 320px;
  max-width: 100%;
}

.custom-poi-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Custom zoom controls */
.custom-zoom-control {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Hide the default Leaflet layer control */
.leaflet-control-layers {
  display: none !important;
}

/* Mobile-specific styles */
@media (max-width: 768px) {
  /* Ensure the map container doesn't overflow */
  .leaflet-container {
    height: calc(100% - 4rem) !important; /* Account for bottom navigation */
  }

  /* Improve touch handling */
  .leaflet-touch .leaflet-bar a {
    width: 30px;
    height: 30px;
    line-height: 30px;
  }

  /* Prevent text selection during map interaction */
  .leaflet-container {
    -webkit-user-select: none;
    user-select: none;
  }

  /* Fix for blank map issue */
  .leaflet-fade-anim .leaflet-tile,
  .leaflet-zoom-anim .leaflet-zoom-animated {
    will-change: auto !important;
    backface-visibility: hidden;
  }

  .leaflet-touch .leaflet-control-zoom {
    display: none; /* Hide default zoom controls on mobile */
  }

  .leaflet-popup {
    max-width: 90vw; /* Limit popup width on mobile */
  }

  .leaflet-popup-content {
    max-width: 85vw; /* Limit popup content width on mobile */
  }
}
