*,
*:before,
*:after {
    -moz-box-sizing: border-box;
    -ms-box-sizing: border-box;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --accent-color: #298046;
    --default-font-family: "Calibri", sans-serif;
    --secondary-accent-color: #ecedee;
}

/* MATERIAL SYMBOLS */
/* fallback */
@font-face {
    font-family: 'Material Symbols Outlined';
    font-style: normal;
    font-weight: 400;
    src: url('../fonts/material-icons-fallback.woff2') format('woff2');
}

.material-symbols-outlined {
    -webkit-font-feature-settings: 'liga';
    -webkit-font-smoothing: antialiased;
    direction: ltr;
    display: inline-block;
    font-family: 'Material Symbols Outlined';
    font-size: 24px;
    font-style: normal;
    font-weight: normal;
    letter-spacing: normal;
    line-height: 1;
    text-transform: none;
    white-space: nowrap;
    word-wrap: normal;
}

/* HEADER */
header {
    align-items: flex-end;
    display: grid;
    grid-template-columns: 25% 50% 25%;
    padding: 8px 16px;
    width: 100%;
}

.logo-container {
    height: 80px;
    width: auto;
}

.logo-container>img {
    max-height: 100%;
    max-width: 100%;
}

.sensor-selection {
    align-items: end;
    color: var(--accent-color);
    display: flex;
    font-weight: 700;
    height: 35px;
    justify-content: center;
    text-align: center;
}

.sensor-selection>.button {
    align-items: center;
    background: linear-gradient(to left, white 50%, var(--accent-color) 50%) right;
    background-size: 200% 100%;
    border-bottom: solid 1px;
    border-color: var(--accent-color);
    border-left: solid 1px;
    border-top: solid 1px;
    cursor: pointer;
    display: flex;
    height: 30px;
    justify-content: center;
    padding: 2px 4px;
    width: 100px;
}

.sensor-selection>.button:last-of-type {
    border-right: solid 1px;
}

.sensor-selection>.button.selected,
.sensor-selection>.button:hover {
    background-position: left;
    border: solid 1px var(--accent-color);
    color: white;
    transition: all 0.3s ease;
}

.icons-container {
    align-items: flex-end;
    display: flex;
    height: 100%;
    justify-content: end;
}

.header-icon {
    color: var(--accent-color);
    cursor: pointer;
    font-size: 24px;
    padding: 0 8px;
}

/* BODY GENERAL */
.body-container {
    display: flex;
    font-family: var(--default-font-family);
    margin-top: 16px;
    min-height: 100px;
    width: 100%;
}

.left,
.middle,
.right {
    border-top: solid 1px var(--secondary-accent-color);
    margin: 0 16px;
}

.left,
.right {
    width: 25%;
}

.middle {
    width: 50%;
}

.hide,
.mobile-med,
.mobile-sm {
    display: none !important;
}

/* LEFT */
.instructions-container {
    display: grid;
    font-size: 16px;
    gap: 16px 8px;
    grid-auto-rows: max-content;
    grid-template-columns: max-content auto;
    padding: 8px 0;
}

.instructions-number {
    border: solid 1px var(--accent-color);
    border-radius: 50%;
    color: var(--accent-color);
    font-weight: 700;
    height: 20px;
    text-align: center;
    width: 20px;
}

.model-accuracy-container {
    margin: 8px 16px;
    text-align: center;
}

/* CENTER */
.input-output-container {
    display: flex;
    font-family: var(--default-font-family);
    font-size: 16px;
    align-items: center;
    padding-top: 8px;
    flex-direction: column;
}

.input-output-container>div {
    display: grid;
    gap: 8px;
    grid-auto-rows: 30px;
    grid-template-columns: max-content max-content 110px max-content;
    align-items: center;
}

.table-icon {
    color: var(--accent-color);
    cursor: pointer;
    font-size: 24px;
    padding: 0 8px;
}

.table-icon.disabled{
    opacity: 0.5;
    pointer-events: none;
}

.results-container {
    grid-template-rows: 30px min-content;
}

#finalResult,
#difference,
#dailyMaxResult {
    align-items: center;
    display: flex;
    justify-content: center;
    margin-right: 8px;
}

#dailyMaxResult {
    font-style: italic;
}

.input-output-container p {
    border: none;
    display: flex;
}

.input-output-container input,
.input-output-container select {
    background: rgb(240, 240, 240);
    border: solid 1px black;
    box-sizing: border-box;
    font-family: inherit;
    font-size: inherit;
    outline: 0;
    padding: 0 4px;
    position: relative;
    text-align: center;
    width: 100%;
}

.input-output-separator,
.daily-max-separator {
    align-self: center;
    background-color: var(--secondary-accent-color);
    grid-column: 1/-1;
    height: 1px;
    width: 100%;
}

.daily-max-separator {
    background-color: var(--accent-color);
    opacity: 0.3;
    width: calc(100% - 32px); /* -32px so it doesn't extend to help icon */
}

.daily-max-icon {
    color: var(--accent-color);
    cursor: help;
    font-size: 20px;
    padding: 0 8px;
    margin: auto 0;
}

.tooltip {
    position: relative;
    display: inline-block;
  }
  
  .tooltip .tooltiptext {
    visibility: hidden;
    width: 225px;
    background-color: var(--accent-color);
    color: #fff;
    text-align: center;
    padding: 5px;
    border-radius: 6px;
    top: 150%;
    right: 0%;
    position: absolute;
    z-index: 1;
  }

  .tooltip .tooltiptext::after {
    content: " ";
    position: absolute;
    bottom: 100%;  /* At the top of the tooltip */
    right: 10%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: transparent transparent var(--accent-color) transparent;
  }
  
  .tooltip-action:hover + .tooltiptext {
    visibility: visible;
  }

select.units {
    background: none;
    border: none;
    text-align: left;
    width: 40px;
}

.api-inputs{
    align-items: center;
}

.toggle{
    justify-self: center;
}

#contactButton,
#calculateButton {
    align-items: center;
    background-color: var(--accent-color);
    border: solid 1px var(--accent-color);
    color: white;
    cursor: pointer;
    display: flex;
    font-family: var(--default-font-family);
    font-size: 16px;
    grid-column: 1/-1;
    justify-content: center;
    margin: 0 auto;
    padding: 4px 4px;
    width: max-content;
}

#contactButton:hover,
#calculateButton:hover {
    filter: brightness(90%);
}

#contactButton > a {
    color: white;
    text-decoration: none;
    width: 100%;
    height: 100%;
}

#autofill{
    grid-column: 1/3;
}

#autofilltoggle{
    grid-column: 3/4;
    justify-content: end;
}

#timezoneSelect{
    text-align: left;
}

#countrySelect{
    text-align-last: center;
    text-align: left;
}

.calculate-btn-container{
    margin-top: 8px;
}

input[type="checkbox"] {
    accent-color: var(--accent-color);
    height: 15px;
    margin: auto auto;
    width: 15px;
}

input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
    background: transparent;
    bottom: 0;
    color: transparent;
    cursor: pointer;
    height: auto;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    width: auto;
}

input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
    background: transparent;
    bottom: 0;
    color: transparent;
    cursor: pointer;
    height: auto;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    width: auto;
}

input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type=number] {
    -moz-appearance: textfield;
}

select:disabled,
input:disabled{
    opacity: 0.5;
    border-color: lightgray;
}

#location.disabled {
    opacity: 0.5
}

/* Toggle */
.toggle {
    position: relative;
    display: inline-block;
    width: 38px;
    height: 20px;
  }
  
  .toggle input {
    opacity: 0;
    width: 0;
    height: 0;
  }
  
  .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    -webkit-transition: .4s;
    transition: .4s;
    border-radius: 34px;
    border: none;
  }
  
  .slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    -webkit-transition: .3s;
    transition: .3s;
    border-radius: 50%;
  }
  
  input:checked + .slider {
    background-color: var(--accent-color);
  }
  
  input:focus + .slider {
    box-shadow: 0 0 1px var(--accent-color);
  }

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


/* RIGHT */
.right h1 {
    color: black;
    font-size: 20px;
    font-weight: 400;
}

.intermediate-variables-container {
    display: flex;
    flex-direction: column;
    font-size: 16px;
    padding: 8px 0 8px 8px;
}

.intermediate-variables-container>div {
    column-gap: 4px;
    display: grid;
    grid-template-columns: 100px min-content 75px 50px min-content;
    margin: 8px 0;
}

.intermediate-variables-container>div>p:nth-child(5n-1) {
    align-items: center;
    display: flex;
    justify-content: end;
    margin-right: 8px;
}

.variable-description {
    display: block;
    font-size: 14px;
    font-style: italic;
    grid-column: 1/-2;
}

.expand-icon {
    cursor: pointer;
    font-size: 15px;
    font-weight: 700;
    line-height: 20px;
    text-align: center;
}

/* POPUPS */
.popup {
    background-color: rgb(240, 240, 240);
    box-shadow: rgba(100, 100, 111, 0.5) 0px 7px 29px 0px;
    display: block;
    font-family: var(--default-font-family);
    height: max-content;
    left: 50%;
    max-height: 60vh;
    overflow-y: auto;
    padding: 32px 16px;
    position: fixed;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 500px;
    z-index: 10;
}

.help-popup-content {
    display: grid;
    gap: 4px;
    grid-template-columns: auto min-content;
    margin: 8px 0;
}

.help-popup-content h1{
    margin: 8px 0 0 0;
}

.help-popup-content>div {
    grid-column: 1/-1;
}

.help-popup-content h2 {
    font-size: 16px;
    font-weight: 700;
    margin: 8px 0 2px 0;
}

.help-popup-content p {
    font-size: 16px;
}

.help-popup-content .expand-icon{
    line-height: 37px;
    text-align: end;
}

.popup h1 {
    font-size: 24px;
}

.popup a {
    color: var(--accent-color);
}

.close-icon-container,
.back-icon-container {
    align-items: center;
    display: flex;
    height: 32px;
    justify-content: end;
    margin-top: -32px;
    position: fixed;
    top: auto !important;
    width: auto;
}

.close-icon-container {
    margin-right: 8px;
    right: 0;
}

.back-icon-container {
    left: 0;
    margin-left: 8px;
}

.close {
    cursor: pointer;
    font-size: 16px;
    transition: transform 0.1s ease-in-out;
}

.back {
    cursor: pointer;
    font-size: 14px;
}

.close:hover {
    transform: scale(1.2);
}

.popup-background {
    background-color: rgba(0, 0, 0, 0.25);
    bottom: 0;
    left: 0;
    position: fixed;
    right: 0;
    top: 0;
    z-index: 5;
}

sup { 
    vertical-align: top; 
    font-size: 0.6em; 
}

/* FOOTER */
footer {
    background-color: var(--secondary-accent-color);
    color: black;
    display: flex;
    font-family: var(--default-font-family);
    justify-content: space-around;
    margin-top: 100px;
    padding: 50px 16px 50px 32px;
    width: 100%;
}

footer a {
    color: var(--accent-color);
    text-decoration: none;
}

footer ul {
    list-style: none;
}

#apogeeLogo {
    height: auto;
    width: 75%;
}

#apogeeLogo>img {
    max-height: 100%;
    max-width: 100%;
}

.about,
.references {
    max-width: 300px;
    width: max-content;
}

footer h1 {
    font-size: 24px;
    font-weight: 400;
    margin-top: 16px;
}

footer li {
    margin: 8px 0;
}

/* SNACKBAR */
.snackbar {
    background-color: #656565;
    border-radius: 50px;
    bottom: 35px;
    color: #fff;
    font-family: var(--default-font-family);
    left: 50%;
    padding: 4px 8px;
    position: fixed;
    text-align: center;
    transform: translate(-50%, 0);
    visibility: hidden;
    width: max-content;
    max-width: 90vw;
    z-index: 15;
}

.snackbar.show {
    -webkit-animation: fadein 0.5s;
    animation: fadein 0.5s;
    visibility: visible;
}

.grecaptcha-badge { 
    visibility: hidden;
}

@-webkit-keyframes fadein {
    from {
        bottom: 0;
        opacity: 0;
    }

    to {
        bottom: 30px;
        opacity: 1;
    }
}

@keyframes fadein {
    from {
        bottom: 0;
        opacity: 0;
    }

    to {
        bottom: 30px;
        opacity: 1;
    }
}

/* MEDIA QUERIES */
@media only screen and (max-width: 1200px) {
    .logo-container {
        height: 70px;
    }

    .mobile-med {
        display: grid !important;
    }

    .left {
        width: 33%;
    }

    .middle {
        width: 66%;
    }
}

@media only screen and (max-width: 900px) {
    .logo-container {
        height: 60px;
    }

    .mobile-sm {
        display: grid !important;
    }

    .middle {
        width: 100%;
    }

    header {
        display: grid;
        grid-template-columns: repeat(2, 50%);
        grid-template-rows: auto;
    }

    .logo-container {
        grid-column: 1/2;
        grid-row: 1/2;
    }

    .icons-container {
        align-items: flex-start;
        grid-column: 2/3;
        grid-row: 1/2;
    }

    .sensor-selection {
        grid-column: 1/3;
        grid-row: 2/3;
        margin: 16px 16px 0 16px;
    }

    .popup {
        width: 80%;
    }

    footer {
        flex-direction: column;
        font-size: 14px;
        padding-left: 16px;
        white-space: normal;
        word-wrap: normal;
    }

    footer h1 {
        font-size: 20px;
    }

    footer>div {
        margin: 50px 0 0 32px;
    }

    .about,
    .references {
        width: auto;
    }
}

@media only screen and (max-width: 500px) {
    .sensor-selection {
        margin: 16px 0 0 0;
    }

    .sensor-selection>.button {
        width: 80px;
    }

    .input-output-container>div {
        gap: 4px 8px;
        font-size: 14px;
        grid-template-columns: max-content max-content 100px max-content;
    }

    .popup {
        width: 90%;
    }

    #apogeeLogo {
        height: auto;
        width: 50%;
    }

    footer>div {
        margin: 50px 0 0 16px;
    }
}

@media only screen and (max-width: 400px) {
    .input-output-container {
        padding: 8px 0;
    }

    .input-output-container>div {
        font-size: 12px;
        grid-template-columns: auto min-content 100px auto;
    }

    .sensor-selection>.button {
        font-size: 14px;
    }

    .intermediate-variables-container {
        padding: 8px 0;
        width: auto;
    }

    .intermediate-variables-container>div {
        font-size: 14px;
        grid-template-columns: 75px min-content 60px 50px min-content;
    }

    .popup {
        font-size: 14px;
        padding: 32px 8px;
        width: 95%;
    }

    .popup h1 {
        font-size: 20px;
    }

    footer {
        font-size: 12px;
        padding-left: 8px;
    }

    footer>div {
        margin: 50px 0 0 8px;
    }
}

@media only screen and (max-width: 300px){
    .input-output-container>div {
        font-size: 12px;
        grid-template-columns: min-content min-content 75px max-content;
    }
}