.geocoder {
    max-width: 600px;
    margin: 20px auto;
    position: relative;
}

.geocoder input[type="text"] {
    padding-left: 40px;
    width: 100%;
    box-sizing: border-box;
    border-radius: 20px;
    border: 1px solid #ccc;
    padding: 12px 20px;
    font-size: 14px;
}

.map-legend {
    background: white;
    padding: 10px;
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    display: flex;
    justify-content: center;
}

.map-legend div {
    padding: 5px 12px 5px 5px;
    margin: 0 2px;
    color: white;
    font-weight: bold;
    text-align: center;
    border-radius: 4px;
}

.map-legend .close-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: none;
    border: none;
    font-size: 20px; 
    cursor: pointer; 
}

/* Responsive tweaks for smaller screens */
@media (max-width: 768px) {
    .geocoder, .map-legend {
        width: 90%;
        margin: 5px auto !important;
    }

    .map-legend {
        bottom: 20px;
        left: 10px;
        transform: translateX(0);
        flex-direction: row; /* Change to row to allow horizontal scrolling */
        overflow-x: auto;
        padding-bottom: 10px; /* Add padding for better touch target */
    }

    .map-legend .legend-scroll-container {
        white-space: nowrap;
        -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    }

    .map-legend div {
        padding: 5px 10px;
        display: inline-block;
        margin: 0 4px;
        font-size: 12px;
        box-sizing: border-box;
    }
}

#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.7);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.spinner-border {
    width: 3rem;
    height: 3rem;
}