/* Custom Scrollbar for all elements */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}
.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

html, body {
    height: 100%;
}

/* Custom Scrollbar for Proposals List */
#proposals-list-container::-webkit-scrollbar {
    width: 6px;
}
#proposals-list-container::-webkit-scrollbar-track {
    background: #f1f1f1;
}
#proposals-list-container::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 10px;
}
#proposals-list-container::-webkit-scrollbar-thumb:hover {
    background: #cbd5e1;
}

/* Mobile-specific adjustments */
@media (max-width: 768px) {
    body {
        overflow-x: hidden;
    }
    
    main {
        min-height: calc(100vh - 200px); /* Ensure content is scrollable */
    }
    
    #map {
        height: 40vh !important; /* Force fixed height on mobile */
        min-height: 40vh;
        max-height: 40vh;
        position: relative;
        z-index: 1;
    }
    
    #proposals-list-container {
        height: 60vh !important; /* Force fixed height on mobile */
        min-height: 60vh;
        max-height: 60vh;
        overflow-y: auto;
        position: relative;
        z-index: 2;
    }
    
    /* Prevent map from affecting page scroll */
    .leaflet-container {
        height: 100% !important;
        width: 100% !important;
    }
    
    /* Ensure popups don't break layout */
    .leaflet-popup {
        position: absolute !important;
        z-index: 1000 !important;
    }
}

/* Layout adjustments */
#map {
    background: #f8fafc;
}

/* Desktop-only improvements (do not affect mobile) */
@media (min-width: 769px) {
    body {
        background: linear-gradient(180deg, #f8fafc 0%, #f3f4f6 100%);
    }

    header {
        position: sticky;
        top: 0;
        z-index: 50;
        background: rgba(255, 255, 255, 0.92);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border-bottom: 1px solid #e5e7eb;
    }

    main {
        width: 100%;
        max-width: 80rem;
        margin-left: auto;
        margin-right: auto;
        padding: 1rem;
        gap: 1rem;
        align-items: stretch;
    }

    #map {
        height: calc(100vh - 160px) !important;
        min-height: 560px;
        border-radius: 16px;
        overflow: hidden;
        box-shadow: 0 12px 30px rgba(15, 23, 42, 0.10);
        border: 1px solid #e5e7eb;
        position: relative;
        z-index: 1;
    }

    #proposals-list-container {
        height: calc(100vh - 160px) !important;
        overflow-y: auto;
        border-radius: 16px;
        background: rgba(255, 255, 255, 0.9);
        box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
        border: 1px solid #e5e7eb;
        position: relative;
        z-index: 2;
    }
}

/* Pulsing animation for urgent icon */
@keyframes custom-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}
.animate-pulse-fast {
    animation: custom-pulse 1s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Card hover effect */
.proposal-card {
    transition: all 0.2s ease-in-out;
}
.proposal-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Leaflet Popup Overrides */
.leaflet-popup-content-wrapper {
    border-radius: 12px;
    padding: 0;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}
.leaflet-popup-content {
    margin: 0;
}
.leaflet-popup-tip {
    box-shadow: 0 3px 14px rgba(0,0,0,0.1);
}
.leaflet-container {
    font-family: 'Inter', sans-serif;
}
.leaflet-container a.leaflet-popup-close-button {
    font-size: 20px;
    padding: 8px 8px 0 0;
    color: #9ca3af;
}
.leaflet-container a.leaflet-popup-close-button:hover {
    color: #4b5563;
}

/* Custom Marker Cluster Styles */
.marker-cluster {
    background: rgba(59, 130, 246, 0.8);
    border-radius: 50%;
    text-align: center;
    font-size: 14px;
    font-weight: bold;
    color: white;
    border: 3px solid white;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: 0;
    margin: 0;
}

.marker-cluster-small {
    background: rgba(34, 197, 94, 0.8);
}

.marker-cluster-medium {
    background: rgba(245, 158, 11, 0.8);
}

.marker-cluster-large {
    background: rgba(239, 68, 68, 0.8);
}

 .marker-cluster > div {
     display: flex;
     align-items: center;
     justify-content: center;
     width: 100% !important;
     height: 100% !important;
     line-height: 1;
     box-sizing: border-box;
     padding: 0 !important;
     margin: 0 !important;
     background: none !important;
 }

.marker-cluster span {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    line-height: 1;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    margin: 0;
    padding: 0;
}

 

/* Spiderfy styles for overlapping markers */
.leaflet-spider-leg {
    stroke: #3b82f6 !important;
    stroke-opacity: 0.6 !important;
    stroke-width: 1px !important;
}
