@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Roboto+Slab&display=swap');

:root {
    --page-side-margin: 200px;
    --text-font-family: "Roboto Slab", Arial, Helvetica, sans-serif;
    --accent-font-familty: Poppins, Arial, Helvetica, sans-serif;

    --root-background-color: #323e4d;
    --page-background-color: white;

    --foreground-color: black;
    --secondary-foreground-color: #bdbdbd;
    --tertiary-foreground-color: #eaeaea;

    --accent-color: #007fc6;
    --link-color: #1f57bf;
    --error-color: #d92c1c;
    --error-background-color: #ffc5bf;
    --ok-color: #09d654;
    --ok-background-color: #b3ffce;

    --general-margin: 10px;
}

body {
    display: flex;
    flex-direction: column;
    background-color: var(--root-background-color);
    font-family: var(--text-font-family);
}

body::-webkit-scrollbar {
    display: none;
}

a {
    text-decoration: none;
    color: inherit;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--accent-font-familty);
    font-weight: bold;
}

select {
    width: 100%;
    padding: 5px;
    border-radius: 5px;
    border: 2px solid var(--foreground-color);
}

canvas {
    margin: 0;
}

dd {
    margin-top: 5px;
    margin-bottom: 20px;
}

ul {
    margin: 0;
    padding: 0;
    list-style-type: none;
}

li {
    display: flex;
    flex-direction: row;
    align-items: center;
}

li label {
    margin-left: 5px;
}

button {
    border: none;
    color: var(--page-background-color);
    background-color: var(--accent-color);
    border-radius: 5px;
    padding: 10px;
    padding-top: 5px;
    padding-bottom: 5px;
    white-space: nowrap;
    cursor: pointer;
}

table, th, td {
    border: 1px solid var(--secondary-foreground-color);
    white-space: nowrap;
}

table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
}

td, th {
    padding: 10px;
    text-align: left;
}

th {
    background-color: var(--tertiary-foreground-color);
}

.sticky-header table thead th {
    position: sticky;
    z-index: 1;
    top: 0;
}

.horizontal-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
}

.space-between {
    justify-content: space-between;
}

.margin-bottom {
    margin-bottom: var(--general-margin);
}

.margin-top {
    margin-top: var(--general-margin);
}

.margin-right {
    margin-right: var(--general-margin);
}

table thead :first-child :first-child {
    position: sticky;
    left: 0;
    z-index: 2;
}

table tbody * :first-child {
    position: sticky;
    left: 0;
    background: var(--page-background-color);
    z-index: 1;
}

.table-wrapper {
    max-width: 100%;
    max-height: 50vh;
    overflow: hidden;
    margin-top: 10px;
    margin-bottom: 10px;
}


.table-wrapper:hover {
    overflow: auto;
}

.table-wrapper::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.table-wrapper::-webkit-scrollbar-thumb {
    background-color: var(--secondary-foreground-color);
    border-radius: 5px;
}

.table-wrapper::-webkit-scrollbar-button {
    display: none;
}

.table-wrapper::-webkit-scrollbar-corner {
    display: none;
}

.section {
    margin-bottom: 40px;
}

.grow {
    flex-grow: 1;
}

#graphs-wrapper, .graph-container, .graph {
    width: 100%;
    min-height: 70vh;
    max-height: 70vh;
}

#cities {
    max-height: 150px;
    overflow: auto;
}

#cities::-webkit-scrollbar {
    display: none;
}

#module-display {
    display: flex;
    flex-direction: row;
    justify-content: center;
    width: 100%;
    min-height: 70vh;
}

#module-display a {
    width: 100%;
    min-height: 100%;
    margin: 10px;
    border-radius: 10px;
    background-color: var(--accent-color);
    color: var(--page-background-color)
}

#module-display :first-child {
    margin-left: 0;
}

#module-display :last-child {
    margin-right: 0;
}

.module-select {
    width: 100%;
    min-height: 100%;
    padding: 20px;
    border-radius: 5px;
}

input[type="checkbox"] {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0;
    width: 20px;
    height: 20px;
    border: 2px solid var(--foreground-color);
    border-radius: 5px;
    background: none;
    appearance: none;
    cursor: pointer;
}

input[type=checkbox]:checked {
    background-color: var(--accent-color);
}

input[type=text], input[type=password] {
    width: 100%;
    padding: 5px;
    border: 2px solid var(--foreground-color);
    border-radius: 5px;
}

.normal-link {
    color: var(--link-color);
    text-decoration: underline;
}

#divider {
    height: 15px;
    width: 100%;
    background-color: var(--root-background-color);
}

#topbar {
    font-size: 16px;
    justify-content: space-between;
    align-items: center;
    white-space: nowrap;
}

footer {
    font-size: 14px;
    justify-content: center;
    align-items: center;
    white-space: nowrap;
}

.top-bottom-container {
    display: flex;
    font-family: var(--accent-font-familty);
    flex-direction: row;
    padding: 20px;
    padding-left: 40px;
    padding-right: 40px;
}

#topbar-left a {
    display: flex;
    flex-direction: row;
    justify-content: left;
    align-items: center;
}

#topbar-left, #topbar-right, #menu {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
}

#topbar-left :not(:last-child) {
    margin-right: 10px;
}

#menu > * {
    margin-left: 30px;
}

#topbar-left {
    font-size: 18px;
    font-weight: bold;
}

.topbar-icon {
    width: 20px;
    cursor: pointer;
}

.page-margin-container {
    display: flex;
    flex-direction: column;
    margin-left: var(--page-side-margin);
    margin-right: var(--page-side-margin);
    background-color: var(--page-background-color);
    min-height: 100vh;
}

#content {
    padding: 40px;
    flex-grow: 1;
}

.errors {
    color: red;
    font-size: 14px;
    font-style: italic;
}

#menu-icon, #close-icon {
    display: none;
}

.logo {
    width: 150px;
    margin: 0;
}

#menu {
    display: flex;
}

.flashes {
    width: 100%;
}

.flashes > * {
    display: block;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: var(--general-margin);
}

.flash-error {
    border: 2px solid var(--error-color);
    color: var(--error-color);
    background-color: var(--error-background-color);
}

.flash-ok {
    border: 2px solid var(--ok-color);
    color: var(--ok-color);
    background-color: var(--ok-background-color);
}

h1 {
    margin-bottom: 10px;
}

@media only screen and (max-width: 1300px) {
    :root{
        --page-side-margin: 100px;
    }
}

@media only screen and (max-width: 1000px) {
    :root{
        --page-side-margin: 50px;
    }

    #graphs-wrapper, .graph-container, .graph {
        min-height: 50vh;
        max-height: 50vh;
    }

    #module-display {
        flex-direction: column;
    }

    #module-display a {
        margin: 0;
        margin-bottom: 20px;
    }
}

@media only screen and (max-width: 800px) {
    #menu-icon {
        display: block;
    }

    #menu {
        position: fixed;
        background-color: var(--root-background-color);
        flex-direction: column;
        justify-content: flex-start;
        align-items: flex-end;
        padding: 20px;
        padding-right: 40px;
        color: var(--page-background-color);
        min-height: 100vh;
        max-height: 100vh;
        right: 0;
        top: 0;
        width: 300px;
        z-index: 100;
        font-size: 20px;
        translate: 300px;
        transition: translate 0.2s ease;
    }

    #close-icon {
        display: block;
    }

    #close-icon * {
        width: 20px;
    }

    #menu > * {
        margin: 0;
        margin-bottom: 30px;
    }
}

@media only screen and (max-width: 700px) {
    :root{
        --page-side-margin: 0px;
    }

    table thead :first-child :first-child {
        position: sticky;
        top: 0;
        left: unset;
        z-index: 2;
    }

    table tbody * :first-child {
        position: unset;
        left: unset;
        background: var(--page-background-color);
        z-index: 1;
    }
}

@media only screen and (max-width: 320px) {
    .logo {
        width: 100px;
    }
}
