@import url('https://fonts.googleapis.com/css2?family=Lexend+Deca:wght@100..900&family=Lexend:wght@100..900&display=swap');

:root {
    --global-top-margin: 50px;
}

html,
body {
    width: 100%;
    height: 100%;

    margin: 0;
    padding: 0;

    background-color: #1a1a1a;
}

* {
    box-sizing: border-box;
    font-family: 'Lexend', sans-serif;
    overscroll-behavior: none !important;
}

@keyframes fadeBackground {
    0% {
      background: rgba(0, 0, 0, 0.5); /* Starting color */
      filter: opacity(1);
    }
    50% {
      background: rgba(112, 112, 112, 0.5); /* Ending color (same as start) */
      filter: opacity(0.5);
    }
    100% {
        background: rgba(0, 0, 0, 0.5); /* Starting color */
        filter: opacity(1);
    }
}

#map {
    width: 100%;
    height: calc(100% - var(--global-top-margin));
}

#searchButton {
    position: absolute;
    top: calc(15px + var(--global-top-margin));
    left: 15px;
    z-index: 1000;
    padding-top: 4px;
    padding-right: 9px;
    padding-bottom: 4px;
    padding-left: 9px;
    border-radius: 7px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

#locateMeButton {
    position: absolute;
    bottom: 15px;
    right: 15px;
    z-index: 1000;
    padding-top: 4px;
    padding-right: 9px;
    padding-bottom: 4px;
    padding-left: 9px;
    border-radius: 7px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);

    transition: all 0.50s;
}

.vehicleMarker {
    transition: all 0.50s;
}
.geoLocationMarker img {
    background-color: #5367d9;
    padding: 4px !important;
    border-radius: 100px;
    border: 2px solid white;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.button img {
    width: 32px;
    height: 32px;
}

#activeSearchContainer {
    position: absolute;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 75%;
    top: calc(0px + var(--global-top-margin));
    z-index: 1000;

    background-color: rgba(0, 0, 0, 0.66);

    overflow-y: hidden;
}

#searchBox {
    display: flex;
    margin-top: 15px;
    margin-left: 15px;
    gap: 10px;
}

#searchResults {
    margin-top: 15px;
    margin-left: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

#activeSearchIcon {
    width: 32px;
    height: 32px;

    margin-top: 4px;
    margin-right: 9px;
    margin-bottom: 4px;
    margin-left: 9px;
}

#activeSearchInput {
    background: none;
    border: none;
    font-size: 20px;

    color: #fff;
}

.searchResultCategoryHeader {
    font-weight: normal;
    color: snow;
}

.busSearchResult {
    display: flex;
    gap: 20px;
    align-items: baseline;
}

.busSearchResult .busLineNumber {
    background-color: #FF983F;
    width: 100%;
    height: 100%;
    max-width: 60px;
    max-height: 30px;
    padding: 5px;
    text-align: center;
    border-radius: 7px;
    color: white;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.busSearchResult .busLineDestination,
.stopSearchResult .stopName {
    color: snow;
}

.stopSearchResult {
    display: flex;
    gap: 20px;
    align-items: baseline;
    cursor: pointer;
}

.stopSearchResult .stopNumber {
    background-color: #3F8CFF;
    width: 100%;
    height: 100%;
    max-width: 60px;
    max-height: 30px;
    padding: 5px;
    text-align: center;
    border-radius: 7px;
    color: white;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

#searchResultCategories {
    display: flex;
    flex-direction: column;
    gap: 40px;
    max-height: 100%;
}

#stopSearchResults {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 70%;
    overflow-y: scroll;
}

.searchResultCategory {
    display: flex;
    flex-direction: column;
    gap: 12px;

    overflow-y: scroll;
}

#activeSearchInput:focus-visible {
    outline: none;
}

#alertContainer {
    position: absolute;
    bottom: 45%;
    z-index: 1000;

    background-color: rgba(129, 23, 23, 0.66);
    width: 95%;
    margin: 2.5%;
    padding: 2.5%;
    border-radius: 15px;
}

#alertContainer * {
    color: snow;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

#alertContainer h2,
#alertContainer p {
    margin: 5px;
}

#stopDisplayContainer {
    position: absolute;
    bottom: 0;
    z-index: 1000;

    background-color: rgba(0, 0, 0, 0.66);
    width: 100%;
    height: 45%;
    padding: 15px;
    padding-left: 25px;

    display: flex;
    flex-direction: column;

    border-radius: 15px 15px 0 0;
}

#stopDisplayHeader * {
    margin: 0;
    padding: 0;
    color: snow;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

#stopDisplayId {
    min-width: 11%;
}

#stopDisplayHeader {
    display: flex;
    align-items: center;
    gap: 20px;
    justify-content: space-between;
    margin-right: 20px;
}

#displayToggleFavoriteButton {
    cursor: pointer;
}

.stopLineBadge {
    cursor: pointer;
}

.button {
    border: none;
    background: rgba(0, 0, 0, 0.5);
    cursor: pointer;
}

.button.loading {
    animation: fadeBackground 2s infinite;
}

.button.error {
    background-color: rgba(180, 19, 19, 0.5);
}

/* 
.leaflet-marker-icon,
.leaflet-popup,
.leaflet-marker-shadow,
.leaflet-popup-content-wrapper {
    transition: all 0.3s;
}
 */

.leaflet-tile {
    filter: saturate(2.0);
    /* filter: invert(90%) brightness(1.5) contrast(1.25) hue-rotate(180deg) saturate(0.6) */
}

.leaflet-container {
    background: #202020 !important; /* dark background to blend with tiles */
}

/* https://github.com/Leaflet/Leaflet/issues/3575#issuecomment-203821877 */
.leaflet-tile-container img {
    box-shadow: 0 0 1px rgba(0, 0, 0, 0.05);
}

.leaflet-popup-tip,
.leaflet-popup-content-wrapper {
    background: rgba(0, 0, 0, 0.66) !important;
}

.leaflet-popup-content-wrapper {
    border-radius: 7px;
}

.leaflet-popup-content-wrapper * {
    color: snow;
}

#stopDisplayHeaderMainInfo a {
    color: snow;
}

#stopLines {
    display: flex;
    flex-direction: column;
    margin-top: 20px;
    gap: 15px;
    overflow-y: scroll;

    transition: all 0.20s;
}

.stopLine {
    display: flex;
    align-items: center;
    gap: 20px;
}

.stopLineId {
    background-color: #FF983F;
    width: 100%;
    max-width: 60px;
    padding: 15px;
    text-align: center;
    border-radius: 7px;
    color: white;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.stopLineMetaData {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.stopLineBadges {
    display: flex;
    gap: 10px;
}

.stopLineDestination {
    font-size: 17px;
}

.stopLineBadge {
    padding: 5px;
    padding-left: 15px;
    padding-right: 15px;

    background-color: rgba(0, 0, 0, 0.33);
    border-radius: 7px;
    font-size: 15px;
    color: snow;
}

.stopLineBadge.late {
    color: #ea7474 !important;
}

.stopLineDestination {
    color: snow;
}