html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
}

#map {
    width: 100vw;
    height: 100vh;
}

/* Search-box container */
#search-container {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    background: white;
    padding: 5px;
    border-radius: 5px;
}

#search-input {
    width: 250px;
    padding: 5px;
    padding-right: 26px;
}

/* Clear button "X" inside input */
#clear-btn {
    position: absolute;
    right: 13px;
    transform: translateY(-120%);
    cursor: pointer;
    font-size: 18px;
    color: gray;
    display: none;
    /* Initially hidden */
}

#clear-btn:hover {
    color: black;
}

/* Suggestions drop-down */
#suggestions {
    position: absolute;
    top: 40px;
    left: 0;
    width: 100%;
    background: white;
    border: 1px solid #ccc;
    max-height: 200px;
    overflow-y: auto;
    display: none;
    z-index: 1000;
    border-radius: 3px;
    box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.3);
}

.suggestion {
    padding: 8px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
}

.suggestion:last-child {
    border-bottom: none;
}

.suggestion:hover {
    background: #f0f0f0;
}

/* Settings Button */
#settings-button {
    position: absolute;
    top: 10px;
    right: 10px;
    background: white;
    border: 1px solid #ccc;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 5px;
    box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.3);
    z-index: 1000;
}

#settings-button:hover {
    background: #f0f0f0;
}

/* Settings Modal */
#settings-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 20px;
    width: 300px;
    border-radius: 8px;
    box-shadow: 0px 5px 15px rgba(0, 0, 0, 0.3);
    display: none;
    z-index: 1100;
    animation: slideIn 0.3s ease-out forwards;
}

/* Modal Overlay */
#modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    z-index: 1099;
    transition: opacity 0.3s ease-in-out;
}

/* Close Button */
#close-modal {
    float: right;
    cursor: pointer;
    font-size: 18px;
    color: gray;
}

#close-modal:hover {
    color: black;
}

.legend {
    background: white;
    padding: 10px 12px;
    border-radius: 6px;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.4);
    line-height: 1.5;
    font-size: 13px;
}

.legend-title {
    font-weight: bold;
    margin-bottom: 6px;
}

.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 4px;
}

.legend-color {
    width: 18px;
    height: 18px;
    margin-right: 8px;
    border: 1px solid #666;
}

.legend-icon {
    width: 18px;
    height: 30px;
    margin-right: 8px;
}

/* Move zoom buttons above settings button on mobile */
@media (max-width: 768px) {
    .leaflet-top.leaflet-left {
        top: auto !important;
        left: auto !important;

        right: 10px !important;
        bottom: 107px !important;

        flex-direction: column;
    }

    .leaflet-control-zoom {
        margin: 0 !important;
    }
}

/* Put settings button in bottom-right instead of top-right on mobile */
@media (max-width: 768px) {
    #settings-button {
        top: auto;
        bottom: 10px;
        left: auto;
        right: 10px;
    }
}

@media (max-width: 768px) {
    .leaflet-bottom.leaflet-left {
        bottom: 55px !important;
    }
}

/* Slide-in animation */
@keyframes slideIn {
    from {
        transform: translate(-50%, -60%);
        opacity: 0;
    }

    to {
        transform: translate(-50%, -50%);
        opacity: 1;
    }
}

/* Slide-out animation */
@keyframes slideOut {
    from {
        transform: translate(-50%, -50%);
        opacity: 1;
    }

    to {
        transform: translate(-50%, -60%);
        opacity: 0;
    }
}