:root {
    --darker: #344e41;
    --dark: #3a5a40;
    --light: #588157;
    --lighter: #a3b18a;
    --background: #dad7cd;
    --serif: "Playfair Display";
    --sans-serif: "Inter";
}

body {
    background-color: var(--background);
    font-family: var(--serif);
    margin: 0px;
}

div#content_container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    box-sizing: border-box;
}

header {
    margin-bottom: 3rem;
    padding: 1rem;
    background-color: var(--lighter);
    width: 100vw;
    box-sizing: border-box;
    display: flex;
}

header.no_margin {
    margin: 0px;
}

header span {
    font-size: 2rem;
    flex-grow: 1;
}

header div#map_switcher_container {
    display: flex;
    border: 1px solid black;
}

header div#map_switcher_container button {
    width: 5rem;
    color: white;
    background-color: var(--dark);
    border: none;
    font-family: var(--serif);
}

header div#map_switcher_container button.selected {
    background-color: var(--light);
}

main#query_container {
    position: relative;
}

main#query_container input {
    width: 80vw;
    font-size: 1.5rem;
    padding: 1.5rem 2.5rem;
    box-sizing: border-box;
    border-radius: 5rem;
    font-family: var(--serif);
    border: 1px solid black;
    box-shadow: 0px 0px 10px rgba(0, 0, 0, .2);
}

div#image_container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 4rem;
    flex-grow: 1;
}

div#image_container span {
    font-size: 1.5rem;
}

div#query_results_container {
    position: absolute;
    background: var(--lighter);
    width: 80vw;
}

div.query_result_container {
    padding: 1rem;
    display: flex;
    align-items: center;
}

div.query_result_container:hover {
    background-color: var(--light);
}

div.query_result_container img {
    width: 1.5rem;
    margin-right: 1rem;
}

div.query_result_container span.station_name {
    font-size: 1.5rem;
    margin-right: 2rem;
    font-family: var(--sans-serif);
    -webkit-user-select: none;
    user-select: none;
}

div.query_result_container span.station_code {
    font-size: 1.2rem;
    font-weight: bold;
    font-family: var(--sans-serif);
    color: var(--dark);
    -webkit-user-select: none;
    user-select: none;
    flex-grow: 1;
}

div.query_result_container::after {
    content: " ";
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    flex-shrink: 0;
    margin-left: 1rem;
}

div.query_result_container[data-station-status="IMAGE"]::after {
    background-color: green;
}

div.query_result_container[data-station-status="NO_IMAGE"]::after {
    background-color: orange;
}

div.query_result_container[data-station-status="NO_VISIT"]::after {
    background-color: red;
}

img#img {
    height: 50vh;
}

main#map_container {
    flex-grow: 1;
    align-self: stretch;
}

div#map {
    width: 100%;
    height: 100%;
}

img.popup_img {
    height: 25vh;
}

div#input_wrapper {
    position: relative;
}

button#input_clear {
    display: none;
}

div.mapboxgl-popup {
    max-width: initial !important;
}

div.mapboxgl-popup button.mapboxgl-popup-close-button {
    font-size: 1.5em;
    padding: 0 .5em;
    color: black;
}

div.mapboxgl-popup p {
    margin-right: 1.5em;
}

main#stats_container {
    flex-grow: 1;
    align-self: stretch;
    margin: 0 3em 3em 3em;
    color: white;
    overflow-x: hidden;
}

div.stat_container {
    background: var(--dark);
    padding: 1em;
    display: flex;
    flex-direction: row;
    position: relative;
}

div.stat_container:not(:last-child) {
    border-bottom: 1px solid white;
}

div.stat_container.total {
    background: var(--darker);
    border-bottom: 3px solid white;
}

div.stat_container span.identifier {
    font-size: 1.5em;
    flex-grow: 1;
}

div.stat_container.total span.identifier {
    font-size: 1.7em;
    font-weight: bold;
}

div.stat_container div.bar_container {
    width: 15em;
    height: 60%;
    position: absolute;
    right: 12em;
    top: 20%;
    border: 1px solid white;
    background: var(--lighter);
}

div.stat_container div.bar_container div.bar {
    background: var(--light);
    height: 100%;
}

div.label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-shadow: 0px 0px 5px black;
    font-size: 1.2em;
}

div.stat_container div.numbers_container {
    display: flex;
    flex-direction: row;
}

div.stat_container div.numbers_container span {
    align-self: center;
}

div.stat_container div.numbers_container span.complete {
    font-weight: bold;
    font-size: 1.7em;
}

div.stat_container div.numbers_container span.total {
    font-size: 1.3em;
}

div.stat_container div.numbers_container span.total::before {
    content: "/";
    margin: .5em;
}

@media (max-width: 630px) {
    header span {
        font-size: 1.5rem;
    }

    main#query_container input {
        width: 100vw;
        border-radius: 0px;
        padding: 1rem 1.5rem;
    }

    main#query_container input::after {
        content: "×";
    }

    div#query_results_container {
        width: 100vw;
    }

    img#img {
        width: 100vw;
        height: initial;
    }

    div#image_container span {
        text-align: center;
        margin-top: 1rem;
    }

    button#input_clear {
        position: absolute;
        top: 0px;
        right: 0px;
        height: 100%;
        width: 10vw;
        font-size: 2rem;
        background: none;
        border: 1px solid black;
        border-left: none;
    }

    button#input_clear.visible {
        display: initial;
    }

    div.query_result_container span.station_name {
        font-size: 1rem;
        flex-grow: 1;
    }

    div.query_result_container span.station_code {
        font-size: .9rem;
        flex-grow: initial;
    }

    main#stats_container {
        margin: -3rem 0 0 0;
    }

    div.stat_container {
        flex-direction: column;
        align-items: center;
    }

    div.stat_container div.bar_container {
        position: relative;
        width: 100%;
        height: 3em;
        top: initial;
        right: initial;
        order: 3;
    }

    div.stat_container span.identifier {
        order: 1;
    }

    div.stat_container div.numbers_container {
        order: 2;
        margin: 0 0 1em 0;
    }
}
