/* Map Container Fixes */
.map-container {
    width: 100%;
    height: 600px;
    position: relative;
    margin-bottom: 2rem;
    border-radius: 20px;
    overflow: visible !important; /* Changed from hidden to allow popups to extend outside */
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

#map {
    width: 100% !important;
    height: 100% !important;
    border-radius: 20px;
    position: relative;
    z-index: 1;
}

/* Ensure popups are always visible above other elements */
.leaflet-popup {
    z-index: 10000 !important;
}

.leaflet-popup-pane {
    z-index: 10000 !important;
}

/* Ensure bin popups are clickable and visible */
.bin-popup {
    z-index: 10001 !important;
    pointer-events: auto !important;
}

.bin-popup .leaflet-popup-content-wrapper {
    pointer-events: auto !important;
    min-width: 320px;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.98) 0%, rgba(30, 41, 59, 0.95) 100%) !important;
}

.bin-popup .leaflet-popup-content {
    pointer-events: auto !important;
}

/* Ensure Leaflet map renders properly */
.leaflet-container {
    width: 100% !important;
    height: 100% !important;
    border-radius: 20px;
}

/* Fix for monitoring section visibility */
#monitoring {
    min-height: 100vh;
    padding: 2rem;
}

#monitoring.content-section {
    display: none;
}

#monitoring.content-section.active {
    display: block !important;
}

/* Loading state for map */
.map-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    background: rgba(255,255,255,0.9);
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    font-weight: 600;
    color: #374151;
}

.map-loading .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e5e7eb;
    border-top: 4px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

/* Ensure proper tracking panel layout */
.tracking-panel {
    width: 100%;
    max-width: 400px;
    min-width: 350px;
}

/* Fix for small screens */
@media (max-width: 768px) {
    .map-container {
        height: 400px;
        border-radius: 12px;
    }
    
    #map {
        border-radius: 12px;
    }
    
    .leaflet-container {
        border-radius: 12px;
    }
}


