:root {
    --border-radius: 20px;
    --shadow-color: #00000010;
    --primary-color: #0e96d0;
    --hover-color: #f5f5f5;
    --selected-bg: #e0f7fa;
    --selected-hover: #b2ebf2;
}

.city-container {
    display: grid;
    grid-template-columns: 2fr 3fr;
    margin: 3rem 4rem;
    height: 75vh;
    border-radius: var(--border-radius);
}

.list-container {
    padding: 16px;
    box-sizing: border-box;
    background: #ffffff;
    border-top-left-radius: var(--border-radius);
    border-bottom-left-radius: var(--border-radius);
    box-shadow: 0px 0px 20px var(--shadow-color);
}

.list-container label {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 0px;
    font-weight: bold;
    cursor: pointer;
}

.list-container input.city-name {
    display: none;
}

#share-location {
    background-color: var(--primary-color);
}

.map-container {
    border-top-right-radius: var(--border-radius);
    border-bottom-right-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0px 0px 20px #0000001A;
}

#map {
    height: 100%;
}

.city-hidden {
    display: none;
}

.city-search-popup {
    position: absolute;
    z-index: 1010;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 2px 8px #0001;
    max-height: 220px;
    width: 100%;
    overflow-y: scroll;
    top: 45px;
}

.city-search-item {
    padding: 8px 12px;
    cursor: pointer;
}

.city-search-item:hover {
    background: var(--hover-color);
}

.city-search-item.disabled {
    color: #aaa;
    cursor: default;
    text-decoration: line-through;
    background-color: #f5f5f5;
}

.city-search-item.disabled:hover {
    background-color: #f5f5f5;
}

.map-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    opacity: 0;
    z-index: 1001;
    transition: opacity 0.3s ease-in-out;
}

.map-overlay.show-overlay {
    display: block;
    opacity: 1;
}

@media (max-width: 1200px) {
    .city-container {
        grid-template-columns: 3fr 2fr;
    }
}

@media (max-width: 768px) {
    .city-container {
        grid-template-columns: 1fr;
        height: auto;
        margin: 1rem;
    }

    .list-container {
        position: static;
        transform: none;
        width: 100%;
        height: auto;
        border-radius: var(--border-radius);
        box-shadow: 0px 0px 10px var(--shadow-color);
    }

    .map-container {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1010;
        border-radius: var(--border-radius);
        transform: translateY(100%);
        transition: transform 0.3s ease-in-out;
        display: block;
        visibility: hidden;
    }

    .map-container.show-map {
        transform: translateY(18%);
        visibility: visible;
        transition: transform 0.3s ease-in-out;
    }

    .map-close-btn {
        position: absolute;
        top: 1rem;
        right: 1rem;
        z-index: 2001;
        background: white;
        border: none;
        border-radius: 50%;
        width: 40px;
        height: 40px;
        box-shadow: 0 2px 6px var(--shadow-color);
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
    }

    .show-map-btn {
        position: fixed;
        bottom: 1rem;
        display: flex;
        align-items: center;
        left: 50%;
        transform: translateX(-50%);
        background: var(--primary-color);
        color: white;
        padding: 0.75rem 2rem;
        border-radius: 25px;
        border: none;
        box-shadow: 0 2px 6px var(--shadow-color);
        z-index: 1000;
    }

    .scrollable-list {
        display: block;
        max-height: 50vh;
    }
}

.scrollable-list {
    margin-top: 10px;
    height: 50vh;
    overflow-y: scroll;
    list-style-type: none;
    padding: 0;
    mask-image: linear-gradient(to bottom, black 98%, transparent);
    -webkit-mask-image: linear-gradient(to bottom, black 98%, transparent);
}

.scrollable-list li {
    padding: 3px 10px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.scrollable-list li:hover {
    background-color: var(--hover-color);
}

.scrollable-list li.checked {
    background-color: var(--selected-bg);
    font-weight: bold;
    border-left: 4px solid var(--primary-color);
    padding-left: 12px;
}

.scrollable-list li.checked:hover {
    background-color: var(--selected-hover);
}

.scrollable-list li.main-city {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap;
    border-left: 4px solid var(--primary-color);
    border-bottom: 1px solid #eee;
    font-weight: bold;
}

.scrollable-list ul.nearby-cities-list {
    padding-left: 0px;
}

.scrollable-list li.nearby-city {
    font-size: 11px;
    line-height: 1;
    border-left: 2px solid #ccc;
    list-style-type: none;
}

.remove-city {
    cursor: pointer;
    color: #999;
    padding: 5px;
}

.remove-city:hover {
    color: #666;
}

.desktop-only {
    display: block;
}

.selected-cities-header {
    background-color: #fbfbfa;
    padding: 0.75rem;
    font-weight: bold;
    border-bottom: 2px solid #ddd;
}
