@import url('https://fonts.googleapis.com/css2?family=Ubuntu:wght@300;400;500;700&display=swap');

body {
    margin: 0;
    padding: 0;
}

#map {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 100%;
    z-index: -1;
}

.marker {
    background-image: url("assets/icons/service/station.png");
    background-size: cover;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
}

.ubuntu-light {
    font-family: "Ubuntu", sans-serif;
    font-weight: 300;
    font-style: normal;
}

.ubuntu-regular {
    font-family: "Ubuntu", sans-serif;
    font-weight: 400;
    font-style: normal;
}

.ubuntu-medium {
    font-family: "Ubuntu", sans-serif;
    font-weight: 500;
    font-style: normal;
}

.ubuntu-bold {
    font-family: "Ubuntu", sans-serif;
    font-weight: 700;
    font-style: normal;
}

:root {
    --primary-color: rgb(245, 240, 226);
    --text-color: black;
    --input-color: white;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0);
    z-index: 1059;
}

.welcome {
    display: flex;
    width: 40%;
    height: auto;
    background: var(--primary-color);
    z-index: 1100;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    border-radius: 25px;
    padding: 1rem 0 3rem 0;
    box-sizing: border-box;
    overflow-y: auto;
}

.welcome h1 {
    font-family: "Ubuntu";
    text-align: center;
    color: var(--text-color);
}

.welcome h3 {
    text-align: center;
    font-family: "Ubuntu";
    padding-left: 5%;
    padding-right: 5%;
    color: var(--text-color);
}

.welcome_button {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40%;
    font-size: 1.2em;
    font-family: "Ubuntu";
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    gap: 0.5rem;
    flex-wrap: nowrap;
    color: black;
    background: var(--input-color);
    padding: 0.3rem 0.6rem;
}

.welcome_button span {
    font-family: "Ubuntu";
    flex: 1 1 auto;
    min-width: 0;
    font-size: clamp(0.6rem, 1.2vw, 1rem);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-color);
}

.welcome_button:hover {
    transform: translateX(-50%) scale(1.1);
}

.about,
.settings {
    display: none;
    width: 40%;
    background: var(--primary-color);
    z-index: 1090;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    border-radius: 25px;
    padding: 1rem 0 3rem 0;
    box-sizing: border-box;
}

.about {
    height: 80%;
    margin: auto;
}

.about h1,
.settings h1 {
    font-family: "Ubuntu";
    text-align: center;
    color: var(--text-color);
}

.about_button,
.settings button,
.current_trains_button {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40%;
    font-size: 1.2em;
    font-family: "Ubuntu";
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    gap: 0.5rem;
    flex-wrap: nowrap;
    color: black;
    background: var(--input-color);
    padding: 0.3rem 0.6rem;
}

.about_button:hover,
.settings button:hover,
.current_trains_button:hover {
    transform: translateX(-50%) scale(1.1);
}

.about_elements {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    gap: 0.5rem;
    width: 90%;
    font-family: "Ubuntu", sans-serif;
    font-size: 1.2em;
    overflow-y: auto;
    padding: 0.5rem;
}

.about_elements h1 {
    text-align: center;
    color: var(--text-color);
}

.about_element {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    cursor: pointer;
    width: 80%;
    padding: 0.5rem 1rem;
    border-radius: 10px;
    transition: background 0.2s, transform 0.2s;
    background: white;
    border: 2px solid black;
    height: auto;
}

.about_element:hover {
    cursor: default;
}

.time_display {
    font-family: 'Ubuntu';
    font-size: 0.8rem;
    color: #555;
    margin-top: 0.25rem;
    display: block;
    text-align: left;
}

.settings-list {
    display: flex;
    flex-direction: column;
    width: 80%;
    gap: 0.75rem;
    margin: 0 auto;
    overflow-y: auto;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    font-family: "Ubuntu";
}

.setting-name {
    font-size: 1rem;
    color: black;
}

.switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
}

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

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 26px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.switch input:checked+.slider {
    background-color: #000000;
}

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

.station_departures {
    display: none;
    width: 40%;
    background: white;
    z-index: 1070;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    border-radius: 25px;
    padding-bottom: 2.5vh;
    position: absolute;
}

.station_departures h1 {
    font-family: "Ubuntu";
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: var(--text-color);
}

.station_departures h4 {
    padding: 5%;
    font-family: "Ubuntu";
    text-align: center;
    color: var(--text-color);
}

.station_departure_close {
    display: flex;
    align-items: center;
    width: 40%;
    font-size: 1.2em;
    font-family: "Ubuntu";
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    gap: 0.5rem;
    flex-wrap: nowrap;
    color: black;
    background: var(--primary-color);
}

.station_departure_close span {
    font-family: "Ubuntu";
    flex: 1 1 auto;
    min-width: 0;
    font-size: clamp(0.6rem, 1.2vw, 1rem);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-color);
}

.station_departure_close:hover {
    transform: scale(1.1);
}

.station_status {
    display: none;
    width: 40%;
    height: 80%;
    background: var(--primary-color);
    z-index: 1060;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    border-radius: 25px;
    padding: 1rem 0 3rem 0;
    box-sizing: border-box;
    overflow-y: auto;
}

.station_status h1 {
    font-family: "Ubuntu";
    text-align: center;
    margin: 0.5rem 0 1rem 0;
    color: var(--text-color);
}

.station_routes {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    gap: 0.5rem;
    width: 90%;
    font-family: "Ubuntu", sans-serif;
    font-size: 1.2em;
    overflow-y: auto;
    padding: 0.5rem;
}

.station_routes h3 {
    text-align: center;
    color: var(--text-color);
}

.station_route {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    cursor: pointer;
    width: 80%;
    padding: 0.5rem 1rem;
    border-radius: 10px;
    transition: background 0.2s, transform 0.2s;
    background: white;
    border: 2px solid black;
    height: auto;
}

.station_route:hover {
    transform: scale(1.02);
}

.station_route img {
    width: 10%;
    height: auto;
    flex-shrink: 0;
}

.station_route_header {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
}

.station_route_inner {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.station_route_inner>div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.station_route_inner h1,
.station_route_inner h3 {
    margin: 0;
    font-family: "Ubuntu", sans-serif;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: calc(0.4 * 1em + 1vh);
    color: var(--text-color);
}

.station_info {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 1rem;
    width: auto;
    padding: 0;
    overflow: hidden;
    height: 0;
    transition: height 0.3s ease, padding 0.3s ease;
    background: white;
    border-radius: 10px 10px 10px 10px;
}

.station_info.open {
    height: auto;
    padding: 1rem;
}

.station_col {
    align-items: flex-start;
}

.scheduled_col {
    align-items: center;
}

.status_col {
    align-items: flex-end;
}

.station_col,
.scheduled_col,
.status_col {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    height: auto;
}

.station_info .station_col h3,
.station_info .scheduled_col h3,
.station_info .status_col h3 {
    margin: 0;
    font-family: "Ubuntu", sans-serif;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: clamp(0.6rem, 2vw, 1rem);
    color: var(--text-color);
}

.station_info .station_col h4,
.station_info .scheduled_col h4,
.station_info .status_col h4 {
    margin: 0;
    font-family: "Ubuntu", sans-serif;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: clamp(0.6rem, 2vw, 1rem);
    color: var(--text-color);
}

.station_close {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40%;
    font-size: 1.2em;
    font-family: "Ubuntu";
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    gap: 0.5rem;
    flex-wrap: nowrap;
    color: black;
    background: white;
    padding: 0.3rem 0.6rem;
}

.station_close span {
    font-family: "Ubuntu";
    flex: 1 1 auto;
    min-width: 0;
    font-size: clamp(0.6rem, 1.2vw, 1rem);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-color);
}

.station_close:hover {
    transform: translateX(-50%) scale(1.1);
}

.draggable_station_status {
    position: absolute;
    bottom: 12px;
    right: 12px;
    width: 6%;
    aspect-ratio: 1 / 1;
    cursor: grab;
}

.draggable_station_status:active {
    cursor: grabbing;
}

.sidebar_opener,
.location {
    appearance: none;
    line-height: normal;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    width: 7.5vh;
    height: auto;
    aspect-ratio: 1 / 1;
    background: var(--primary-color);
    border: none;
    font-size: 2rem;
    cursor: pointer;
    z-index: 1000;
    padding: 0.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.sidebar_opener {
    top: 1vw;
    left: 1vw;
}

.sidebar_opener:hover {
    transform: scale(1.1);
}

.sidebar_button {
    width: 100%;
    height: 100%;
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 80%;
    text-align: center;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    color: var(--text-color);
}

.sidebar_button:hover {
    transform: scale(1.1);
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 20%;
    height: 100vh;
    background-color: var(--primary-color);
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.2);
    z-index: 1080;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.sidebar h1 {
    text-align: center;
    font-family: "Ubuntu";
    color: var(--text-color);
}

.sidebar h4 {
    text-align: center;
    font-family: "Ubuntu";
    color: var(--text-color);
}

.sidebar_search {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    justify-content: flex-start;
    align-items: center;
    height: auto;
}

.sidebar_search input {
    flex: 1 1 auto;
    min-width: 0;
    font-family: "Ubuntu";
    font-size: 1.2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-radius: 8px;
    text-align: center;
    width: 80%;
}

.search_results {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 70%;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    background: white;
    border-radius: 10px;
    border-color: black;
}

.search_results.open {
    max-height: 500px;
    padding: 1rem;
}

.search_results h3:hover {
    transform: scale(1.1);
}

.search_results h3 {
    border-radius: 10px;
    border-color: black;
    text-align: center;
    margin: 0;
    padding: 0.5rem;
    font-family: "Ubuntu", sans-serif;
    font-size: clamp(1rem, 1.2vw, 1rem);
    cursor: pointer;
    transition: background 0.2s;
    color: var(--text-color);
}

.sidebar_routes {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    justify-content: flex-start;
    align-items: center;
}

.sidebar_route_button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80%;
    font-size: 1.2rem;
    font-family: "Ubuntu";
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    gap: 0.5rem;
    flex-wrap: nowrap;
    background: var(--input-color);
    text-decoration: none;
}

.sidebar_route_button img {
    flex: 0 1 auto;
    width: 15%;
    height: auto;
    min-width: 16px;
    background-color: transparent;
}

.sidebar_route_button span {
    flex: 1 1 auto;
    min-width: 0;
    font-size: clamp(0.6rem, 1.2vw, 1rem);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-color);
}

.sidebar_route_button:hover {
    transform: scale(1.1);
}

.sidebar_about {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    justify-content: flex-start;
    align-items: center;
}

.sidebar_about button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80%;
    font-size: 1.2rem;
    font-family: "Ubuntu";
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    gap: 0.5rem;
    flex-wrap: nowrap;
    color: black;
    background: var(--input-color);
    text-decoration: none;
}

.sidebar_about button:hover {
    transform: scale(1.1);
}

.links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: auto;
}

.links img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.links img:hover {
    transform: scale(1.10);
}

.location {
    bottom: 2vw;
    right: 1vw;
}

.location_button img {
    max-width: 100%;
}

.location:hover {
    transform: scale(1.1);
}

.location_button {
    width: 100%;
    height: 100%;
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(0.5rem, 3vw, 2rem);
    text-align: center;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}

.current_trains {
    display: none;
    width: 40%;
    height: 80%;
    background: var(--primary-color);
    z-index: 1060;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    border-radius: 25px;
    padding: 1rem 0 3rem 0;
    box-sizing: border-box;
    overflow-y: auto;
}

.current_trains h1 {
    font-family: "Ubuntu";
    text-align: center;
    margin: 0.5rem 0 1rem 0;
    color: var(--text-color);
}

.current_trains_list {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    gap: 0.5rem;
    width: 90%;
    font-family: "Ubuntu", sans-serif;
    font-size: 1.2em;
    overflow-y: auto;
    padding: 0.5rem;
}

.current_trains_list h3 {
    text-align: center;
    color: var(--text-color);
}

.current_train {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 0.5rem;
    cursor: pointer;
    width: 80%;
    height: auto;
    padding: 0.5rem 1rem;
    border-radius: 10px;
    transition: background 0.2s, transform 0.2s;
    background: white;
    border: 2px solid black;
}

.current_train h3 {
    font-size: auto;
    font-size: 1.2em;
}

.current_train:hover {
    cursor: pointer;
    transform: scale(1.02);
}

@media (max-width: 1135px) {
    .welcome {
        width: 80%;
    }

    .welcome_button span {
        flex: 1 1 auto;
        min-width: 0;
        font-size: clamp(1.2rem, 1.2vw, 1rem);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .about,
    .settings {
        width: 80%;
    }

    .station_status {
        width: 80%;
    }

    .station_status .station_routes {
        font-size: 0.9em;
    }

    .current_trains {
        width: 80%;
        font-size: 0.9em;
    }

    .station_close span {
        flex: 1 1 auto;
        min-width: 0;
        font-size: clamp(1.2rem, 1.2vw, 1rem);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .sidebar_opener .location {
        width: 3.25vh;
        height: auto;
        aspect-ratio: 1 /1;
    }

    .sidebar {
        width: 80%;
    }

    .sidebar_route_button img {
        flex-shrink: 0;
        width: 28px;
        height: 28px;
    }

    .sidebar_route_button span {
        flex: 1 1 auto;
        min-width: 0;
        font-size: clamp(1.2rem, 1.2vw, 1rem);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}