.amenity-item {
    padding: 5px;
    margin: 2px 0;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    border-radius: 4px;
}

.amenity-item:hover {
    background: #f0f0f0;
}
.amenity-item:active {
    background: #f0f0f0;
}

.community-item:hover {
    background: #f0f0f0;
}



.amenity-number {
    display: inline-block;
    width: 25px;
    height: 25px;
    background: #000;
    color: #fff;
    border-radius: 50%;
    text-align: center;
    line-height: 25px;
    margin-right: 10px;
    font-weight: bold;
}


/* Pulse animation for selected marker */
@keyframes marker-pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.7;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.marker-selected {
    animation: marker-pulse 0.5s ease-in-out;
}

/* Desktop styles - controls on right side */
@media (min-width: 769px) {
    .map-wrapper {
        display: flex;
        flex-direction: row;
        position: relative;
        min-height: 800px;
    }
    
    .acf-map {
        width: 75vw !important;
        height: 800px;
        order: 1;
    }
    
    .map-controls-container {
        width: 25vw !important;
        order: 2;
        padding: 20px;
        box-sizing: border-box;
        position: relative;
        background: #f9f9f9;
        height: 600px;
        overflow-y: visible; /* Changed from 'auto' to 'visible' */
    }
    
    .map-hdr-wrapper {
        position: relative !important;
        left: auto !important;
        top: auto !important;
        width: 100% !important;
        margin-bottom: 20px;
    }
    
    .legends-container {
        position: relative !important;
        left: auto !important;
        top: auto !important;
        width: 100% !important;
    }
    
    .section-title.map-title {
        margin-top: 0;
        font-size: 24px;
    }
}

/* Mobile styles - controls after map */
@media (max-width: 768px) {
    .map-wrapper {
        display: flex;
        flex-direction: column;
    }
    
    .acf-map {
        width: 100% !important;
        height: 400px;
        order: 1;
    }
    
    .map-controls-container {
        width: 100% !important;
        order: 2;
        padding: 15px;
        box-sizing: border-box;
        overflow-y: visible; /* Changed from 'auto' to 'visible' */
    }
    
    .map-hdr-wrapper {
        position: relative !important;
        left: 0 !important;
        top: 0 !important;
        width: 100% !important;
        margin-bottom: 15px;
    }
    
    .legends-container {
        position: relative !important;
        left: 0 !important;
        top: 0 !important;
        width: 100% !important;
    }
    
    /* Filter buttons styling for mobile */
    .map-markers-filters-list {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        padding: 0;
        margin: 10px 0;
    }
    
    .map-markers-filters-list li {
        flex: 1 1 auto;
        list-style: none;
    }
    
    .btn-map-filter,
    .btn-reset-map {
        width: 100%;
        text-align: center;
        padding: 12px !important;
        font-size: 16px;
    }
}

/* Small mobile styles */
@media (max-width: 480px) {
    .acf-map {
        height: 300px;
    }
    
    .map-markers-filters-list {
        flex-direction: column;
    }
    
    .map-markers-filters-list li {
        width: 100%;
    }
    
    .btn-map-filter,
    .btn-reset-map {
        padding: 14px !important;
        font-size: 16px;
    }
}

/* Legend panel styles - ABSOLUTELY NO SCROLLBARS */
.legend-panel {
    transition: all 0.3s ease;
    margin-bottom: 15px;
    border-radius: 8px;
    overflow: visible; /* Changed from 'hidden' to 'visible' */
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    background: #fff;
}

.legend-header {
    padding: 12px 15px;
    background: #f5f5f5;
    border-bottom: 1px solid #e0e0e0;
    cursor: pointer;
    transition: background 0.3s;
}

.legend-header:hover {
    background: #e8e8e8;
}

.legend-header p {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.toggle-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #666;
}

.legend-content {
    padding: 10px 15px;
    max-height: none; /* Remove any max-height constraint */
    overflow: visible; /* Ensure content is always visible */
}

/* List containers - no scrolling */
.communities-list,
.amenities-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: none; /* Remove any max-height */
    overflow: visible; /* Prevent any scrolling */
}

/* Individual items */
.community-item,
.amenity-item {
    padding: 10px;
    margin: 5px 0;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    border-radius: 4px;
    overflow: visible; /* Ensure no scrolling on items */
}

.community-item:hover,
.amenity-item:hover {
    background: #f5f5f5 !important;
    /*transform: translateX(5px);*/
}

/* Active states */
.community-item.active,
.amenity-item.active {
    background: #e3f2fd !important;
    border-left: 4px solid #e0e0e0;
}

.btn-map-filter.active {
    background: #333;
    color: #fff;
    border-color: #333;
}

/* Button styling */
.btn-map-filter,
.btn-reset-map {
    cursor: pointer;
    padding: 10px 20px;
    border-radius: 30px;
    background: #fff;
    border: 1px solid #ddd;
    transition: all 0.3s;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    display: inline-block;
}

.btn-map-filter:hover,
.btn-reset-map:hover {
    background: #f0f0f0;
    border-color: #ccc;
}

/* Map title */
.section-title.map-title {
    margin-bottom: 15px;
    font-size: 20px;
    color: #333;
}

/* Remove any absolute positioning that might interfere */
.map-hdr-wrapper,
.legends-container {
    position: relative !important;
    left: auto !important;
    top: auto !important;
}

/* Ensure proper box sizing */
* {
    box-sizing: border-box;
}

/* Completely disable any scrollbar functionality */
.map-controls-container,
.legends-container,
.legend-panel,
.legend-content,
.communities-list,
.amenities-list,
.community-item,
.amenity-item {
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
    overflow: visible !important;
    overflow-y: visible !important;
    overflow-x: visible !important;
    max-height: none !important;
    height: auto !important;
}

/* Hide any scrollbars that might appear in any browser */
.map-controls-container::-webkit-scrollbar,
.legends-container::-webkit-scrollbar,
.legend-panel::-webkit-scrollbar,
.legend-content::-webkit-scrollbar,
.communities-list::-webkit-scrollbar,
.amenities-list::-webkit-scrollbar,
.community-item::-webkit-scrollbar,
.amenity-item::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    background: transparent !important;
}
