html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    background-image: linear-gradient(to bottom, #0b3d1a, #146c2e);
}

#container {
    display: flex;
    height: 100vh;
}

#map {
    width: 100%;
    height: 100vh;
    flex: 1;
}

#infobox button {
    background-color: #f2cd00;
    border-radius: 6px;
}

#sidebar {
    width: 300px;
    overflow-y: auto;
    border-left: 1px solid #444;
    padding: 10px;
    border-left: 2px solid black;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .2);
}

#line-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.line-button {
    text-align: left;
    padding: 8px;
    cursor: pointer;
    border-radius: 6px;
}

.station-item {
    padding: 10px 20px;
    cursor: pointer;
    font-weight: bold;
    background-color: rgba(255, 255, 255, 0.5);
    color: white;
    border: 3px solid white;
    margin-top: 5px;
    border-radius: 6px;

}

.station-item:hover {
    background: rgba(0, 160, 0, 0.5);
}

#infobox {
    position: absolute;
    left: 25px;
    bottom: 25px;
    width: 360px;
    background: linear-gradient(to bottom, #0b3d1a, #146c2e);
    padding: 15px;
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
    border: 2px solid black;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .2);
    color: white;
    border-radius: 6px;

}

#search-desktop {
    width: 100%;
    box-sizing: border-box;
    font-size: 24px;

}

#settings {
    color: white;
}

.switch-row {
    display: flex;
    justify-content: space-between;
    align-items: center;

    margin: 12px 0;
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
}

.switch input{
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0px;
    left: 0px;
    right: 0px;
    bottom: 0px;
    background: #555;
    transition: .2s;
    border-radius: 6px;
}

.slider::before {
    content: "";
    position: absolute;
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background: black;
    transition: .2s;
    border-radius: 6px;
}

.switch input:checked + .slider {
    background: #f2cd00;
}

.switch input:checked + .slider::before {
    transform: translateX(22px);
}

#year-slider-container {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px 16px;
    background-image: linear-gradient(to bottom, #0b3d1a, #146c2e);
    border: 2px solid black;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .2);
    border-radius: 6px;
    color: white;
}
#year-slider {
    width: 250px;
    accent-color: #f2cd00;
    cursor: pointer;
}

.group-line-button {
    border-radius: 6px;
}

.line-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 40px;
    height: 28px;

    padding: 4px 8px;
    border-radius: 8px;

    font-weight: bold;
    white-space: nowrap;

    flex-shrink: 0;

    font-variant-numeric: tabular-nums;
}

.terminus {
    display: inline-flex;
    align-items: center;

    flex: 1;
    min-width: 0;

    padding: 4px 10px;
    border-radius: 8px;
    font-weight: bold;

    white-space: normal;
    word-break: normal;
    overflow-wrap: normal;
}

.infobox-display {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

@media (min-width: 769px) {

    #infobox-mobile {
        display: none;
    }

    #search-bar {
        display: none;
    }

    #search-results {
        display: none;
    }

    #station-list {
        display: none;
    }

    #line-list {
        display: none;
    }

}

@media (max-width: 768px) {

    #container {
        display: block;
    }

    #sidebar {
        display: none;
    }

    #infobox {
        display: none;
    }

    #search-bar {
        position: fixed;
        display: flex;
        align-items: center;
        gap: 8px;
        top: 15px;
        left: 15px;
        right: 15px;
        z-index: 1000;
        border-radius: 6px;
    }

    #search-results {
        display: none;
        position: fixed;
        top: 70px;
        left: 15px;
        right: 15px;
        max-height: 50vh;
        overflow-y: auto;
        background: linear-gradient(to right, #0b3d1a, #146c2e);
        color: white;
        z-index: 1500;
        border-radius: 6px;
    }
    .search-result {
        padding: 15px;
        border-bottom: 1px solid white;
        border-top: 1px solid white;
        border-left: 2px solid white;
        border-right: 2px solid white;
        
    }

    #search-bar-mobile {
        width: 100%;
        box-sizing: border-box;
        padding: 12px 16px;
        border: 4px solid black;
        font-size: 16px;
        box-shadow: 0 2px 10px rgba(0, 0, 0, .2);
        background-image: linear-gradient(to right, #0b3d1a, #146c2e);
        color: white;
        border-radius: 6px;
        flex: 1;
    }

    #settings-mobile {
        width: 50px;
        height: 50px;
        border: 4px solid black;
        border-radius: 6px;
        background: linear-gradient(to right, #0b3d1a, #146c2e);
        font-size: 20px;
        
    }

    #settings-results {
        display: none;
        position: fixed;
        top: 70px;
        left: 15px;
        right: 15px;
        max-height: 50vh;
        overflow-y: auto;
        background: linear-gradient(to right, #0b3d1a, #146c2e);
        color: white;
        z-index: 1500;
        border-radius: 6px;
        padding: 12px;
        box-sizing: border-box;
        border: 2px solid black;
        box-shadow: 0 2px 10px rgba(0, 0, 0, .2);
    }

    #settings-results .switch-row {
        margin: 10px 0;
        font-size: 15px;
    }

    #infobox-mobile {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        /* min-height: 120px; */
        max-height: 70vh;
        overflow-y: auto;
        background-image: linear-gradient(to bottom, #0b3d1a, #146c2e);
        border: 4px solid black;
        color: white;
        border-radius: 6px 6px 0 0;
        z-index: 1000;
        padding: 15px;
        box-shadow: 0 -2px 12px rgba(0,0,0,.2);

    }

    #mobile-infocontent {
        max-height: 25vh;
    }
    
    #mobile-handle {
        width: 40px;
        height: 5px;
        background: #ccc;
        border-radius: 6px;
        margin: 0 auto 15px auto;
    }

    #year-slider-container {
        position: fixed;
        width: calc(100% - 55px);
        top: 70px;
        bottom: auto;
        padding: 10px;
        z-index: 1000;
        touch-action: none;
    }

    #year-slider {
        flex: 1;
        width: auto;
    }

    .group-line-button {
        font-size: 18px;
        padding: 4px 8px;
    }

}