@import url("styleVariables.css");

/* ================================== Site styles ================================== */
/*********** Body ***********/
body {
    min-height: 100dvh;
    max-width: 100%;
    font-family: var(--fontFamily);
    font-size: var(--fontNormal);
}

/*********** Scrollbar ***********/
body::-webkit-scrollbar-track,
.scrollArea::-webkit-scrollbar-track,
.scrollArea2::-webkit-scrollbar-track {
    background-color: var(--white);
    border: var(--border);
}

body::-webkit-scrollbar,
.scrollArea::-webkit-scrollbar,
.scrollArea2::-webkit-scrollbar {
    width: 0.2dvw;
    height: 0.5dvh;
    background-color: var(--white);
}

body::-webkit-scrollbar-thumb,
.scrollArea::-webkit-scrollbar-thumb,
.scrollArea2::-webkit-scrollbar-thumb {
    -webkit-box-shadow: inset 0 0 0.4dvh 0.2dvh var(--darkGray);
    background-color: var(--lightGray);
}

/*********** Navbar ***********/
.nav {
    z-index: 3;
    position: sticky;
    top: -1px;
    background-color: var(--invertWhite);
    box-shadow: var(--bottomShadow);
}

.bigNavbar,
.smallNavbar {
    height: clamp(0px, 5.723dvh, 75px);
    display: grid;
    grid-template-columns: 25% auto auto;
}

.bigNavbar .container,
.smallNavbar .container {
    display: grid;
    grid-auto-flow: column;
}

.bigNavbar .container img,
.smallNavbar .container img {
    height: 5.2dvh;
    max-height: 60px;
    padding-top: 0.5dvh;
}

.bigNavbar a,
.smallNavbar a {
    text-decoration: none;
    text-align: center;
    color: var(--ctGreen);
    font-size: var(--fontNormal);
    font-weight: var(--fontBold);
    padding-top: 1dvh;
    width: clamp(0px, 10dvh, 150px);
    display: inline-block;
    border-bottom: 0.3dvh solid transparent;
}

.bigNavbar a:hover {
    border-bottom-color: var(--ctGreen);
}

.bigNavbar a.active {
    border-bottom-color: var(--ctGreen);
}

/*********** Small screen navbar ***********/
.smallNavbar {
    display: none;
}

.dropdown {
    text-align: center;
    padding-right: 1dvh;
    padding-top: 0.3dvh;
}

.dropdown-content {
    height: 94.3dvh;
    width: 100dvw;
    display: none;
    position: absolute;
    background-color: rgba(150, 150, 150, 0.9);
    box-shadow: var(--boxShadow);
    z-index: 100;
}

.dropdown-content a {
    width: 87dvw;
    color: var(--ctGreen);
    padding: 3dvh 3dvh;
    text-decoration: none;
    text-shadow: black 1px 0 10px;
    display: block;
    border-bottom: 1px solid black;
}

.dropdown:hover .dropdown-content {
    display: block;
    overflow-x: auto;
}

/*********** Secondary navbar ***********/
.activeView {
    background-color: var(--fadedBlack) !important;
    border-bottom: 0.2dvh solid var(--ctGreen) !important;
}

/* --------------- Small screen styles --------------- */
@media screen and (max-width: 500px) {
    .dropdown-content {
        top: 5.74dvh;
        box-shadow: none;
    }

    .dropdown-content a {
        color: var(--ctGreen);
        text-shadow: var(--ctGreen) 1px 0 10px;
        box-shadow: var(--bottomShadow);
    }
}

@media screen and (max-width: 999px) {
    .smallNavbar {
        display: grid;
    }

    .bigNavbar {
        display: none;
    }
}

@media screen and (max-height: 500px) {
    .smallNavbar {
        min-height: 12dvh;
        max-height: 12dvh;
    }

    .smallNavbar .container img {
        height: 10.4dvh;
        padding-top: 1dvh;
    }

    .smallNavbar a {
        font-size: var(--fontHuge);
        padding-top: 1dvh;
        padding-right: 1dvh;
        width: 15dvw;
    }

    .dropdown-content {
        height: 94dvh;
        width: 100dvw;
        display: none;
        position: absolute;
        box-shadow: var(--bottomShadow);
        z-index: 0;
    }

    .dropdown-content a,
    .dropdown-content button {
        width: 100dvw;
        color: var(--ctGreen);
        padding: 3dvh 3dvh;
        text-decoration: none;
        display: block;
        border-bottom: var(--border);
    }
}
/* --------------- Small screen styles --------------- */

/*********** Map background ***********/
/* Background image/color is in themeMode.php */

/* Styles for maplibre control button */
/* Zoom control */
.maplibre-zoom-wrapper {
    display: flex;
    flex-direction: column;
    background-color: var(--white);
    border: var(--darkBorder);
    border-radius: 4px;
    overflow: hidden;
    font: bold 12px Tahoma, Verdana, sans-serif;
}

.maplibre-zoom-button {
    width: 30px;
    height: 30px;
    line-height: 30px;
    text-align: center;
    font-size: var(--fontSmall);
    font-weight: var(--fontBold);
    background: var(--invertWhite);
    color: var(--invertBlack);
    border: none;
    cursor: pointer;
}

.maplibre-zoom-button:hover {
    background-color: var(--invertGray) !important;
}

.maplibre-zoom-display {
    width: 30px;
    height: 30px;
    line-height: 30px;
    text-align: center;
    font-size: var(--fontTiny);
    font-weight: var(--fontBold);
    background-color: var(--invertWhite);
    color: var(--invertBlack);
    border-top: var(--darkBorder);
    border-bottom: var(--darkBorder);
}

/* Scale control */
.maplibregl-ctrl-bottom-left .maplibregl-ctrl-scale {
    background-color: var(--invertWhite);
    color: var(--invertBlack);
    margin: 0 !important;
    font-size: var(--fontTiny);
    font-weight: var(--fontBold);
    box-shadow: var(--lightBoxShadow);
}

.maplibregl-ctrl-scale[data-unit]::before {
    font-size: var(--fontTiny);
    font-weight: var(--fontBold);
    color: var(--invertBlack);
}

/* Icon control */
.simple-marker {
    z-index: 100 !important;
}

/* Map popup control */
.highlight-marker {
    z-index: 999 !important;
}

/*********** Site inputs ***********/
.btn {
    border-radius: 0.5dvh;
    background: var(--invertWhite);
    border: var(--darkBorder);
    box-shadow: var(--lightBoxShadow);
    color: var(--invertBlack);
    font-weight: var(--fontBold);
    font-size: var(--fontNormal);
    text-decoration: none;
    padding: 0.3dvh;
    cursor: pointer;
}

.invisBtn {
    background-color: transparent;
    font-size: var(--fontNormal);
    box-shadow: none;
    outline: none;
    border: none;
    width: -webkit-fill-available;
}

input {
    border-radius: 0.5dvh;
    background: var(--white);
    border: var(--darkBorder);
    box-shadow: var(--lightBoxShadow);
    font-family: Arial;
}

#settingsMenu select {
    box-shadow: var(--selectShadow);
    border: 0.1dvh solid rgba(0, 0, 0, 0.5);
}

input[type="datetime-local"],
input[type="date"] {
    text-transform: uppercase;
}

input[type="file"] {
    background: transparent;
    border: none;
    box-shadow: none;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
input[type="number"]:focus,
input[type="search"]:focus,
input[type="week"]:focus,
input[type="datetime-local"]:focus,
input[type="date"]:focus {
    background-color: var(--fadedWhite);
    outline: none;
}

input[readonly]:hover {
    cursor: not-allowed;
}

::placeholder {
    color: var(--fadedBlack);
}

.scrollArea,
.scrollArea2 {
    overflow-y: auto;
    overflow-x: hidden;
}

select option {
    background-color: var(--invertWhite);
    font-size: 125%;
    border-radius: 1dvh;
    color: var(--invertBlack);
}

select option:checked {
    background-color: var(--lightGray);
    color: var(--white);
}

/* Input toggle hover */
.toggleHover:hover {
    background-color: var(--fadedBlack) !important;
}

/* Loading background */
.loading {
    position: fixed;
    width: 100%;
    height: var(--pageHeight);
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--fadedBlack);
    z-index: 999;
}

/* Link button styles */
a {
    text-decoration: none;
    color: var(--black);
}

.aBtn {
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: var(--fontBold);
    height: 100%;
    width: 100%;
    text-align: center;
    border-radius: 0.5dvh;
    padding: 0.3dvh;
}

.aBtn:hover {
    color: var(--white);
    background-color: var(--fadedGray);
}

.aTableBtn {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: center;
    justify-content: left;
    padding: 1dvh;
}

.aCellBtn {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    text-decoration: none;
    font-size: inherit;
    font-weight: var(--fontBold);
    color: inherit;
    padding: 1dvh;
    display: grid;
    align-content: center;
    justify-content: center;
}

.aCellBtn:hover {
    color: var(--white);
    background-color: var(--fadedGray);
}

/* Dark mode slider */
.switch {
    position: relative;
    display: inline-block;
    width: 3dvw;
    height: 3dvh;
}

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

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--mediumGray);
    -webkit-transition: background-color 0.4s;
    transition: background-color 0.4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 2.2dvh;
    width: 1.1dvw;
    left: 0.2dvw;
    bottom: 0.4dvh;
    background-color: var(--white);
    -webkit-transition: transform 0.4s;
    transition: transform 0.4s;
}

input:checked + .slider {
    background-color: var(--darkGray);
}

input:checked + .slider:before {
    -webkit-transform: translateX(1.45dvw);
    -ms-transform: translateX(1.45dvw);
    transform: translateX(1.45dvw);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

@media screen and (max-width: 500px) {
    /* Dark mode slider */
    .switch {
        width: 12dvw;
        height: 3dvh;
    }

    .slider:before {
        position: absolute;
        content: "";
        height: 2.2dvh;
        width: 5dvw;
        left: 1dvw;
        bottom: 0.4dvh;
        background-color: var(--white);
        -webkit-transition: transform 0.4s;
        transition: transform 0.4s;
    }

    input:checked + .slider:before {
        -webkit-transform: translateX(4.5dvw);
        -ms-transform: translateX(4.5dvw);
        transform: translateX(4.5dvw);
    }
}

/*********** Popup ***********/
.popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--fadedBlack);
    z-index: 500;
}

.popup-content {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: var(--invertWhite);
    color: var(--invertBlack);
    padding: 2dvh;
    border-radius: 2dvh;
    text-align: center;
}

.popup-content h1 {
    margin-top: 0;
    font-size: var(--fontPopup);
    font-weight: var(--fontBold);
    padding: 2dvh;
}

.popup-content h2 {
    font-size: var(--fontPopup);
    padding: 2dvh;
}

.popup-content hr {
    margin-bottom: 3dvh;
}

.popup-content p {
    font-size: var(--fontBig);
    padding-bottom: 2dvh;
}

.popup-content button {
    padding: 1dvh;
    margin: 0dvh 1dvh;
    width: 42%;
    height: 100%;
    font-size: var(--fontBig);
    font-weight: var(--fontBold);
}

.btn:hover {
    background-color: var(--fadedGray);
    color: var(--white);
}

/* --------------- Small screen styles --------------- */
@media screen and (max-height: 500px) {
    .overlay a {
        font-size: var(--fontSmall);
    }

    .overlay .closebtn {
        font-size: var(--fontNormal);
        top: 11.6dvh;
        right: 6dvw;
    }

    .dropdown-content {
        height: 88.2dvh;
    }

    .dropdown-content a {
        width: 97.5dvw;
        padding: none;
        font-size: var(--fontNormal);
    }
}

@media screen and (max-width: 500px) {
    .popup-content {
        padding: 2dvh;
        width: 90dvw;
    }
}

/* --------------- Small screen styles --------------- */

/*********** Standard styles for tables ***********/
table {
    width: 100%;
}

tr {
    background-color: var(--oddRow);
    border: var(--darkBorder);
}

tr:nth-child(even) {
    background-color: var(--evenRow);
}

th {
    background-color: var(--invertGray);
    border: var(--darkBorder);
    overflow-wrap: break-word;
    position: sticky;
    width: 18dvw;
    height: clamp(0px, 2dvh, 50px);
}

td {
    border-right: var(--darkBorder);
    overflow-wrap: break-word;
    padding: 1.1dvh;
    font-size: var(--fontBig);
    height: clamp(0px, 3dvh, 50px);
    position: relative;
}

/*********** Standard chart styles ***********/
#noDataMessage,
#noIdFound {
    text-align: center;
    font-size: var(--fontBig);
    font-weight: var(--fontBold);
    color: var(--invertBlack);
}

#timePeriodSelect,
#customTimeRange {
    background-color: var(--invertWhite);
    color: var(--invertBlack);
    font-weight: var(--fontBold);
    display: inline-flex;
}

#loadChartBtn {
    background-color: var(--invertWhite);
    color: var(--invertBlack);
    display: none;
    box-shadow: var(--boxShadow);
}

#chartLegendControls {
    display: inline-flex;
    align-items: center;
    min-width: 15dvw;
    column-gap: 1%;
    font-size: var(--fontNormal);
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    z-index: 2;
    width: 100%;
}

#chartLegendControls::-webkit-scrollbar {
    display: none;
}

#chartLegendControls .legend-toggle {
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 4px 10px;
    border-radius: 4px;
    border: var(--darkBorder);
    background-color: var(--invertWhite);
    color: var(--invertBlack);
    cursor: pointer;
}

#chartLegendControls .legend-toggle.active {
    background-color: var(--invertGray);
    font-weight: bold;
}

#loadingIcon2 {
    color: var(--invertBlack);
}

.chartContainer {
    border: var(--border);
    border-radius: 1dvh;
    padding: 1dvh;
    height: 100%;
    width: 100%;
}

.paused::before {
    content: "\f04c";
    font-family: "Font Awesome 5 Free";
    font-weight: var(--fontBold);
    position: absolute;
    top: 53.5%;
    transform: translate(-50%, -50%);
    font-size: 12dvh;
    color: var(--fadedBlack);
}

/* --------------- Small screen styles --------------- */

@media screen and (max-width: 500px) {
    #chartLegendControls {
        width: 85%;
        margin-left: 0.5dvw;
    }
}

@media screen and (max-height: 500px) {
    #chartLegendControls {
        width: 85%;
        margin-left: 0.5dvw;
    }
}

/* --------------- Small screen styles --------------- */

/*********** Standard gauge styles ***********/
.boundaryLine {
    outline: var(--dottedBorder);
}

/*********** Error  styles ***********/
.invalid-feedback {
    color: var(--errorRed);
}

.warningMessage {
    display: grid;
    justify-content: center;
    padding: 10dvh;
}

.warningMessage p {
    color: var(--errorRed);
    font-size: var(--fontNormal);
    text-shadow: 0.1dvh 0.1dvh 0.1dvh var(--fadedBlack);
}

/*********** Test server banner ***********/
.testBanner {
    background-color: rgba(150, 0, 0);
    width: 100%;
    overflow: hidden;
    white-space: nowrap;
    height: clamp(0px, 1.9dvh, 25px);
    box-shadow: var(--bottomShadow);
    border-bottom: var(--darkBorder);
    box-sizing: border-box;
}

.scrollContainer {
    display: inline-block;
    animation: scroll-left 60s linear infinite;
}

.scrollText {
    display: inline;
    white-space: nowrap;
    color: yellow;
    font-size: var(--fontSmall);
    font-weight: var(--fontBig);
    margin-right: 30dvh;
}

@keyframes scroll-left {
    0% {
        transform: translateX(100%);
    }
    100% {
        transform: translateX(-100%);
    }
}

/*********** Misc ***********/
.hidden {
    display: none;
}
