:root {
  --accent-color: #4051b5;
  --action-btn-color-dark: #cfcfcf9c;
  --action-btn-color: #9898989c;
  --btn-round-color: #545454;
  --font-family:
    "Roboto", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", "Helvetica Neue", Arial, "Noto Sans", sans-serif,
    "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
}

@font-face {
  font-family: "Roboto";
  font-display: swap;
  src:
    local("Roboto"),
    url("Roboto-Regular.woff") format("woff"),
    url("Roboto-Regular.eot") format("embedded-opentype");
}

body {
  font-family: ui-sans-serif, system-ui;
  font-family: var(--font-family);
  color: #444;
  margin: 0;
}
.darkmode body {
  color: #b0b0b0;
}
.darkmode a {
  color: #e2e2e2;
}
div#site {
  width: 420px;
  max-width: 100%;
  margin: 0px auto;
  box-sizing: border-box;
  background: #dfdfdf;
  overflow: hidden;
  position: relative;
  min-height: 100vh;
}
.darkmode #site {
  background: #333;
}
header,
section,
footer {
  position: relative;
  padding: 6px;
}
footer a {
  color: #4051b5;
}

.darkmode footer a {
  color: #e2e2e2;
}

header {
  text-align: center;
  background-color: var(--accent-color);
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: calc(100% + 20px);
  box-sizing: border-box;
  left: -10px;
  z-index: 12;
  height: 66px;
}
#header {
  font-size: 1em;
  position: relative;
  font-weight: normal;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
#header span:nth-child(1) {
  font-size: 0.9em;
}
#header span:nth-child(2) {
  font-size: 0.8em;
}
#header::before {
  content: "";
  background-image: url("./logo.png");
  width: 38px;
  height: 38px;
  background-size: contain;
  background-repeat: no-repeat;
  position: absolute;
  left: -43px;
  filter: grayscale(0.2);
  top: -1px;
}
section {
  padding: 1em 1em;
  background: #e2e2e2;
}
section.odd-section {
  background: #ededed;
}
.darkmode section {
  background: #4d4d4d;
}
.darkmode section.odd-section {
  background: #3a3a3a;
}
#sectionDisplay {
  padding-top: 2px;
  width: 100%;
  box-sizing: border-box;
  height: 47px;
  background: #ededed;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
}
.darkmode #sectionDisplay {
  background-color: #3a3a3a;
}
div#display {
  color: red;
  font-size: 1.8em;
  text-align: center;
  padding-top: 2px;
  background: rgb(60, 60, 60);
  width: 25%;
  display: block;
  height: 35px;
  -webkit-appearance: none;
  border-radius: 34px;
  /* padding: 0 4px; */
  margin: 0 auto;
}

.darkmode div#display {
  background: #222;
}
#display {
  color: #4d4d4d;
}

h2 {
  margin: 4px 0 10px;
  font-size: 1.1em;
  text-transform: capitalize;
  font-weight: 200;
  letter-spacing: 0.6px;
  color: #6b6b6b;
}
.darkmode h2 {
  color: #848484;
}
p {
  padding: 3px 0;
  margin: 0;
}

table {
  width: 100%;
}
table.fixed {
  table-layout: fixed;
}

tr.queueeven {
  width: 100%;
  border-spacing: 0;
  background: #e6e6e6;
}
tr.queueodd {
  width: 100%;
  border-spacing: 0;
  background: #ededed;
}
.darkmode tr.queueeven {
  background: #404040;
}
.darkmode tr.queueodd {
  background: #3a3a3a;
}

.center {
  text-align: center;
}
.right {
  text-align: right;
}
.small {
  font-size: 0.6em;
}
.smaller {
  font-size: smaller;
}
.larger {
  font-size: larger;
}
.button,
.button_red {
  text-decoration: none;
  border: none;
  color: white;
  background-color: var(--accent-color);
  padding: 8px 24px;
  font-size: 0.8em;
  cursor: pointer;
  border: 1px solid #d6d6d6;
  border-radius: 34px;
  outline: none;
  margin: 4px auto;
  display: inline-block;
  letter-spacing: 1.1px;
}
.button_red {
  background-color: #c99540;
}
.button:hover,
.button_red:hover {
  background-color: #0076d1;
  box-shadow: 1px 1px 3px #444;
}
.button_red:hover {
  background-color: #ec0000;
}
.button:disabled,
.button_red:disabled {
  background-color: green;
  box-shadow: none;
  cursor: default;
}

div.visualapproach {
  position: absolute;
  right: 0px;
  top: 10px;
  width: 100vw;
  height: 100vh;
  opacity: 0.09;
  background-image: url("./logo.png");
  background-repeat: no-repeat;
  display: none;
  filter: grayscale(1);
  background-size: contain;
}

/* input range slider */
input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 34px;
  background: #ccc;
  border-radius: 34px;
  padding: 0 4px;
  margin: 0;
}
.darkmode input[type="range"] {
  background: var(--action-btn-color-dark);
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  height: 22px;
  width: 22px;
  border-radius: 50%;
  background: var(--accent-color);
  cursor: ew-resize;
  border: 2px solid white;
  transition: background 0.3s ease-in-out;
}

input[type="range"]::-moz-range-thumb {
  -webkit-appearance: none;
  height: 25px;
  width: 25px;
  border-radius: 50%;
  background: var(--btn-round-color);
  cursor: ew-resize;
  border: none;
  transition: background 0.3s ease-in-out;
}

input[type="range"]::-ms-thumb {
  -webkit-appearance: none;
  height: 22px;
  width: 22px;
  border-radius: 50%;
  background: var(--accent-color);
  cursor: ew-resize;
  border: 2px solid white;
  transition: background 0.3s ease-in-out;
}

input[type="range"]::-webkit-slider-thumb:hover {
  background: var(--accent-color);
}

input[type="range"]::-moz-range-thumb:hover {
  background: var(--accent-color);
}

input[type="range"]::-ms-thumb:hover {
  background: var(--accent-color);
}

/* Input Track */
input[type="range"]::-webkit-slider-runnable-track {
  -webkit-appearance: none;
  box-shadow: none;
  border: none;
  background: transparent;
}

input[type="range"]::-moz-range-track {
  -webkit-appearance: none;
  box-shadow: none;
  border: none;
  background: transparent;
}

input[type="range"]::-ms-track {
  -webkit-appearance: none;
  box-shadow: none;
  border: none;
  background: transparent;
}

input[type="datetime-local"],
input[type="date"],
input[type="time"],
input[type="number"] {
  font-family: ui-sans-serif, system-ui;
  font-family: var(--font-family);
}

input:invalid {
  border: 2px dashed red;
}

/* The switch - the box around the slider */
.switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 34px;
}

/* Hide default HTML checkbox */
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

/* The slider */
.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  -webkit-transition: 0.4s;
  transition: 0.4s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 4px;
  bottom: 4px;
  background-color: var(--accent-color);
  border: 2px solid white;
  -webkit-transition: 0.4s;
  transition: 0.4s;
}

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

input:focus + .slider {
  box-shadow: 0 0 1px #2196f3;
}

input:checked + .slider:before {
  -webkit-transform: translateX(16px);
  -ms-transform: translateX(16px);
  transform: translateX(16px);
  background-color: #ccc;
}
.sun::after {
  content: "";
  width: 8px;
  height: 8px;
  border: solid 1px #797b40;
  border-radius: 50%;
  box-shadow:
    8px 0 0 -4px #797b40,
    -8px 0 0 -4px #797b40,
    0 8px 0 -4px #797b40,
    0 -8px 0 -4px #797b40,
    6px -6px 0 -4px #797b40,
    -6px -6px 0 -4px #797b40,
    -6px 6px 0 -4px #797b40,
    6px 6px 0 -4px #797b40;
  position: absolute;
  left: 28px;
  top: 11px;
  -webkit-transition: 0.4s;
  transition: 0.4s;
}
.moon::after {
  content: "";
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  box-shadow: 0.3rem 0.2rem 0 0 #909090;
  position: absolute;
  left: 2px;
  top: 4px;
  -webkit-transition: 0.4s;
  transition: 0.4s;
}
input:checked + .slider.moon::after {
  -webkit-transform: translateX(16px);
  -ms-transform: translateX(16px);
  transform: translateX(16px);
}
input:checked + .heateron::before {
  border: 3px solid #bc3434;
  box-sizing: border-box;
  content: "On";
  font-size: 0.6em;
  display: flex;
  justify-content: center;
  align-items: center;
}

input:checked + .heateroff:before {
  border: 3px solid green;
  box-sizing: border-box;
  content: "Off";
  font-size: 0.6em;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Rounded sliders */
.slider.round {
  border-radius: 34px;
}

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

/* navigation */
a.topnavicon {
  width: 30px;
  height: 30px;
  text-decoration: none;
  color: #fff;
  font-size: 2.2em;
  display: flex;
  justify-content: center;
  align-items: center;
}
.darkmode .topnavicon {
  color: #b9b9b9;
}
.topnavicon::before {
  content: "\00D7";
  line-height: 0.8;
  top: 13px;
  position: absolute;
  opacity: 0;
  -webkit-transition: 0.2s;
  transition: 0.2s;
}
.show-before.topnavicon::before {
  opacity: 1;
}
.topnavicon::after {
  content: "\2630";
  line-height: 0.8;
  top: 13px;
  position: absolute;
  -webkit-transition: 0.2s;
  transition: 0.2s;
  opacity: 1;
  display: inline-block;
}
.show-before.topnavicon::after {
  opacity: 0;
}
.topnav {
  overflow: hidden;
  background-color: #ccc;
  width: calc(100% + 20px);
  left: -10px;
  position: absolute;
  top: -100vh;
  z-index: 10;
  height: calc(100vh - 66px);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  transition: 0.3s all;
  gap: 0.7em;
  padding-top: 1em;
}
.darkmode .topnav {
  background: linear-gradient(180deg, rgb(65, 65, 65) 0%, rgb(44, 44, 44) 100%);
}
.topnav a {
  float: left;
  display: none;
  color: inherit;
  text-align: center;
  padding: 12px 16px;
  text-decoration: none;
  font-size: 1em;
  font-weight: 300;
  letter-spacing: 0.04em;
  background: #eee;
}
.darkmode .topnav a {
  background: #454545;
  box-shadow: 0px 1px 2px #0000004d;
}
.topnav a.bgred {
  color: white;
  background-color: #bf0000;
}

.topnav a:hover {
  color: #444;
  background-color: #ddd;
}

.topnav a.active {
  background-color: #4051b5;
  color: white;
}

.topnav.responsive {
  transition: 0.3s all;
  top: 66px;
}

.topnav a {
  float: none;
  display: block;
  text-align: center;
}

.inputunit {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  font-size: 0.9em;
}

/* tooltips */
.tooltip {
  position: relative;
  display: inline-block;
  width: 1.2em;
  height: 1.2em;
  font-size: 1em;
  text-align: center;
  text-decoration: none;
  color: #fff;
  background-color: var(--accent-color);
  border-radius: 34%;
  -webkit-box-shadow: inset -1px -1px 1px 0px rgba(0, 0, 0, 0.25);
  -moz-box-shadow: inset -1px -1px 1px 0px rgba(0, 0, 0, 0.25);
  box-shadow: inset -1px -1px 1px 0px rgba(0, 0, 0, 0.25);
}

.tooltip::before {
  content: attr(data-text);
  position: absolute;
  top: 30%;
  transform: translateY(-30%);
  left: 100%;
  margin-left: 15px;
  width: 200px;
  color: #444;
  background: #ccc;
  text-align: left;
  padding: 6px;
  border-radius: 14px;
  border: 2px solid var(--accent-color);
  z-index: 1;
  visibility: hidden;
}

.tooltip::after {
  content: "";
  position: absolute;
  top: 30%;
  transform: translateY(-30%);
  left: 100%;
  margin-left: -5px;
  border: 10px solid var(--accent-color);
  border-color: transparent var(--accent-color) transparent transparent;
  visibility: hidden;
}

.tooltip:focus::before,
.tooltip:focus::after,
.tooltip:hover::before,
.tooltip:hover::after,
.tooltip.active::before,
.tooltip.active::after {
  visibility: visible;
}

.tooltip.left::before {
  left: auto;
  right: 100%;
  margin-left: 0;
  margin-right: 15px;
}

.tooltip.left::after {
  left: auto;
  right: 100%;
  margin-left: 0;
  margin-right: -5px;
  border-color: transparent transparent transparent var(--accent-color);
}

/**********************
 * temperature selector
\*/

table#tableSelector {
  display: none;
}

.selector {
  position: relative;
  width: 100px;
  border-radius: 6px;
  margin: auto;
}

.selector .selectorbutton {
  width: 100%;
  height: 30px;
  color: #fff;
  font-size: 20px;
  background-color: var(--accent-color);
  border: none;
  cursor: pointer;
}

.selector .selectorbutton:hover {
  background-color: #0076d1;
}

.selector .selectorbutton.selectortop {
  border-radius: 10px 10px 0 0;
}

.selector .selectorbutton.selectorbottom {
  border-radius: 0 0 10px 10px;
}
.selector .wrapper {
  background: #ccc;
  display: flex;
  justify-content: center;
  align-items: center;
}
.selector .numDisplay {
  width: fit-content;
  height: 50px;
  border: none;
  color: var(--accent-color);
  font-size: 34px;
  text-align: center;
  padding: 0;
  border-radius: 0;
  appearance: textfield;
  pointer-events: none;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  left: -2px;
}
.selector .numDisplay.noleft {
  left: 0px;
}
.selector .degrees .numDisplay::after {
  content: "\00B0";
  position: absolute;
  right: -14px;
  top: 0;
  font-weight: 200;
}
.selector .selectorvalue {
  width: 100%;
  height: 50px;
  border: none;
  color: var(--accent-color);
  font-size: 34px;
  text-align: center;
  background-color: #ccc;
  padding: 0;
  border-radius: 0;
  appearance: textfield;
  pointer-events: none;
}

.selector .degree {
  position: absolute;
  top: 32px;
  right: 20px;
  font-size: 24px;
  color: var(--accent-color);
}

/* dark mode */
html.darkmode {
  background: #282828;
}
/* toggle button */
.switch {
  position: relative;
  width: 50px;
  height: 30px;
  float: left;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #a0a0a09c;
  -webkit-transition: 0.4s;
  transition: 0.4s;
  border-radius: 34px;
}
.darkmode .slider {
  background-color: var(--action-btn-color-dark);
}
.slider:before {
  position: absolute;
  content: "";
  height: 25px;
  width: 25px;
  left: 4px;
  bottom: 2px;
  background-color: var(--btn-round-color);
  -webkit-transition: 0.4s;
  transition: 0.4s;
  border-radius: 50%;
  border: none;
}

input:checked + .slider {
  background-color: #c3c3c3a8;
}

input:focus + .slider {
  box-shadow: 0 0 1px #2196f3;
}

input:checked + .slider:before {
  -webkit-transform: translateX(16px);
  -ms-transform: translateX(26px);
  transform: translateX(16px);
  background-color: #3c3c3c;
}

/* error handling css */
.error header {
  background-color: rgb(132, 39, 39);
  animation: colorfade 1s linear 0s infinite alternate-reverse;
}
@keyframes colorfade {
  0% {
    background-color: rgb(132, 39, 39);
  }
  100% {
    background-color: rgb(172, 82, 82);
  }
}

/* rssi signal symbol */
.wave {
  display: inline-block;
  border: 5px solid transparent;
  border-top-color: var(--accent-color);
  border-radius: 50%;
  border-style: solid;
  margin: 3px;
}

.waveStrength-3 .wv4.wave,
.waveStrength-2 .wv4.wave,
.waveStrength-2 .wv3.wave,
.waveStrength-1 .wv4.wave,
.waveStrength-1 .wv3.wave,
.waveStrength-1 .wv2.wave {
  border-top-color: #eee;
}

.rssi2 {
  position: relative;
  display: inline-block;
}

.rssi2::before {
  content: attr(data-text);
  position: absolute;
  top: 30%;
  transform: translateY(-40%);
  left: 100%;
  width: 70px;
  color: #444;
  background: #ccc;
  text-align: left;
  padding: 6px;
  border-radius: 14px;
  border: 2px solid var(--accent-color);
  z-index: 1;
  visibility: hidden;
}

.rssi2::after {
  content: "";
  position: absolute;
  top: 30%;
  transform: translateY(-30%);
  left: 70%;
  margin-left: -5px;
  border: 10px solid var(--accent-color);
  border-color: transparent var(--accent-color) transparent transparent;
  visibility: hidden;
}

.rssi2:hover::before,
.rssi2:hover::after {
  visibility: visible;
}

/* Water Quality Section */
.wq-input {
  width: 70px;
  padding: 6px 8px;
  border: none;
  border-radius: 6px;
  font-size: 1em;
  text-align: center;
  background: #ccc;
  font-family: var(--font-family);
}

.darkmode .wq-input {
  background: var(--action-btn-color-dark);
}

.wq-input:focus {
  outline: 2px solid var(--accent-color);
  outline-offset: 1px;
}

.wq-info-row {
  font-size: 0.85em;
  opacity: 0.7;
  padding-top: 2px !important;
  padding-bottom: 12px !important;
}

.label-subtle {
  opacity: 0.7;
}
