/* Leaflet CSS for CareShare - Simplified and Customized */

/* Import base Leaflet styles */
@import url('https://unpkg.com/leaflet@1.9.4/dist/leaflet.css');

/* Ensure map container has proper dimensions */
.leaflet-container {
    height: 100% !important;
    width: 100% !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    /* Force hardware acceleration and proper rendering */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    will-change: transform;
    /* Force proper rendering */
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    perspective: 1000px;
    -webkit-perspective: 1000px;
}

/* Fix map canvas sizing - override existing styles */
#map-canvas,
.map-canvas {
    height: 500px !important;
    width: 100% !important;
    min-height: 400px;
    position: relative;
    /* Force proper rendering */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    will-change: transform;
    /* Additional rendering fixes */
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    perspective: 1000px;
    -webkit-perspective: 1000px;
    /* Ensure proper display */
    
    overflow: hidden;
}

/* Ensure map tiles display correctly */
.leaflet-tile-pane {
    z-index: 1;
}

.leaflet-overlay-pane {
    z-index: 2;
}

.leaflet-marker-pane {
    z-index: 3;
}

.leaflet-tooltip-pane {
    z-index: 4;
}

.leaflet-popup-pane {
    z-index: 5;
}

/* Fix tile loading issues */
.leaflet-tile {
    filter: none !important;
    -webkit-filter: none !important;
}

/* Ensure proper map rendering */
.leaflet-map-pane {
    z-index: 1;
}

.leaflet-tile-pane img {
    max-width: none !important;
    max-height: none !important;
}

/* Custom styles for CareShare */
.leaflet-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

.leaflet-popup-content {
    margin: 0;
    padding: 0;
}

.leaflet-popup-tip {
    background: white;
}

/* User location marker styling */
.user-location-marker {
    background: transparent;
    border: none;
}

.user-location-marker svg {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* Custom marker clustering styles */
.marker-cluster {
    background: rgba(97, 40, 113, 0.8);
    border: 2px solid #612871;
    border-radius: 50%;
    color: white;
    font-weight: bold;
    text-align: center;
    line-height: 1;
}

.marker-cluster:hover {
    background: rgba(97, 40, 113, 1);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .leaflet-popup-content {
        max-width: 280px !important;
    }
    
    .leaflet-control-zoom {
        margin: 10px !important;
    }
}

/* Simplified controls */
.leaflet-control-attribution {
    font-size: 10px;
    background: rgba(255, 255, 255, 0.8);
    padding: 2px 4px;
}

.leaflet-control-attribution a {
    color: #612871;
    text-decoration: none;
}

.leaflet-control-attribution a:hover {
    text-decoration: underline;
}

.leaflet-container a.btn-secondary {
    color: white;
}
.leaflet-container a.btn-secondary:hover:not(:disabled) {
    background-color: var(--bs-tertiary);
    border-color: var(--bs-tertiary);
    color: var(--color-secondary-500);
  }