/* Global Styles */
@import url('https://fonts.googleapis.com/css2?family=Nunito+Sans:wght@300;400;600;700&display=swap');

body {
    margin: 0;
    padding: 0;
    font-family: 'Nunito Sans', sans-serif;
    color: #333;
}

h2,
h3,
h4 {
    margin: 0 0 10px 0;
    font-weight: 700;
}

h2 {
    font-size: 1.5rem;
}

h3 {
    font-size: 1.25rem;
}

h4 {
    font-size: 1rem;
    color: #555;
}

p {
    margin: 0 0 10px 0;
    line-height: 1.5;
}

* {
    box-sizing: border-box;
}

/* Map Container */
#map,
.map {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 100%;
}

/* Overlays (Legend, Menus) */
.map-overlay {
    position: absolute;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 15px;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Legend */
#legend {
    bottom: 30px;
    left: 20px;
    width: 220px;
    max-height: 400px;
    overflow-y: auto;
    z-index: 10;
}

.legend h4 {
    text-align: center;
    margin-bottom: 12px;
    font-size: 0.95rem;
    color: #333;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
}

.legend div {
    display: flex;
    align-items: center;
    margin-bottom: 6px;
}

.legend i {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    margin-right: 10px;
    display: inline-block;
    flex-shrink: 0;
    opacity: 0.9;
}

.legend span {
    font-size: 0.85rem;
    color: #555;
}

/* Menus (Top Left/Right) */
#menu,
#menu-left,
#menu-right {
    position: absolute;
    top: 20px;
    background: rgba(255, 255, 255, 0.95);
    padding: 10px 15px;
    border-radius: 50px;
    /* Pill shape */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 10px;
    backdrop-filter: blur(5px);
}

#menu {
    left: 20px;
    flex-wrap: wrap;
    border-radius: 12px;
    /* Slightly less rounded for multi-line */
    max-width: 300px;
}

#menu-left {
    left: 20px;
}

#menu-right {
    right: 20px;
}

#menu label,
#menu-left label,
#menu-right label {
    font-weight: 600;
    font-size: 0.9rem;
    color: #333;
    cursor: pointer;
}

/* Radio Buttons Styling in Menu */
#menu input[type="radio"] {
    appearance: none;
    background-color: #fff;
    margin: 0;
    font: inherit;
    color: currentColor;
    width: 1.15em;
    height: 1.15em;
    border: 0.15em solid #ccc;
    border-radius: 50%;
    display: grid;
    place-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

#menu input[type="radio"]::before {
    content: "";
    width: 0.65em;
    height: 0.65em;
    border-radius: 50%;
    transform: scale(0);
    transition: 120ms transform ease-in-out;
    box-shadow: inset 1em 1em #333;
}

#menu input[type="radio"]:checked {
    border-color: #333;
}

#menu input[type="radio"]:checked::before {
    transform: scale(1);
}

#menu div {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 5px;
}

/* Home Button */
.home-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    /* Top right corner */
    background: rgba(255, 255, 255, 0.95);
    padding: 10px 15px;
    border-radius: 50px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 20;
    text-decoration: none;
    color: #333;
    font-weight: 600;
    font-size: 0.9rem;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.home-btn:hover {
    background: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
    color: #e74c3c;
    /* Accent color */
}

.home-btn-lower {
    top: 80px;
}

/* Comparison Container */
#comparison-container {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 100%;
    overflow: hidden;
}

/* Responsive Adjustments */
@media (max-width: 600px) {
    #legend {
        width: 180px;
        bottom: 40px;
        left: 10px;
    }

    #menu,
    #menu-left,
    #menu-right {
        top: 10px;
        padding: 8px 12px;
    }

    #menu-left {
        left: 10px;
    }

    #menu-right {
        right: 10px;
    }

    h2 {
        font-size: 1.2rem;
    }

    h3 {
        font-size: 1rem;
    }

    .home-btn {
        top: auto;
        bottom: 40px;
        right: 10px;
        padding: 8px 12px;
    }
}