:root {
  --primary-color: #0d6efd;
  --primary-color-highlight: #054cb856;
  --primary-text-color: #000000;
  --sidebar-backgrund-color: #212529;
  --sidebar-text-color: #fff;

}


body {
  min-height: 100vh;
  min-height: -webkit-fill-available;
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif, Arial, Helvetica, sans-serif;
  display: flex;
}


ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

hr {
  border: none;
  height: 1px;
  background-color: #ccc;
  margin: 10px 0 20px 0;
  width: 100%;
  align-self: center;
}

main {
  flex-grow: 1;
  padding: 0px 20px 20px 20px;
  max-width: 1900px;
}

main h1 {

  font-size: 1.7rem;
  margin: 25px 0px 25px 0px;
}



.mainContent {
  margin-left: 320px;
  /* Space between Sitebar -  (content + 10px padding-right) */
  width: calc(100% - 330px);
}

#version,
#statusConnected {
  margin: 20px 0;
  color: var(--sidebar-text-color);
}


.hidden {
  display: none;
}

#sidebar {
  z-index: 1;
  position: fixed;
  height: 100%;
  padding: 0 20px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background-color: var(--sidebar-backgrund-color);
  color: var(--sidebar-text-color);
  width: 280px;
  box-shadow: 5px 0px 10px 0px rgba(0, 0, 0, 0.5);
  transition: translate 0.3s ease-in-out;
}

#mobileHeader {
background-color: var(--sidebar-backgrund-color);
padding: 0 1cqh;
align-items: center;
display: none;
}

#sidebarToggle {
  width: 40px;
  height: 40px;
  color: white;
  padding-right: 10px;
}

#mobileHeader a.websiteName {
  display: flex;
  align-items: center;
  margin: 20px 0px 20px 0px;
  color: var(--sidebar-text-color);
  font-size: 1.7rem;
  text-decoration: none;
}



#sidebar a.websiteName {
  display: flex;
  align-items: center;
  margin: 20px 0px 20px 0px;
  color: var(--sidebar-text-color);
  font-size: 1.7rem;
  text-decoration: none;
}

#sidebar a svg {
  margin-right: 10px;
}

#sidebarClose {
  display: none;
  margin: 20px 0px;
  font-size: 1.7rem;
  color: var(--sidebar-text-color);
}

#DebugWindow {
  margin: auto;
  margin-bottom: 0;
  width: 100%;
  height: 200px;
  border-radius: 5px;
  overflow-y: auto;
}


#DebugWindow #ServerStatus {
  padding: 0px  2px;
  border-radius: 5px;
  background-color: rgb(255, 0, 0);
}

#DebugWindow #ServerStatus.connected {
  background-color: rgb(32, 161, 0);
}

#DebugWindow #DebugLog {
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
  flex-direction: column;
  height: 155px;
  border: solid 2px rgba(255, 255, 255, 0.397);
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
  overflow-y: auto;

}

#DebugWindow .DebugMessage {
  padding: 5px;
  margin: 0;
}

.DebugMessage.info {
  background-color: #8080801f;
}
.DebugMessage::before {
  content: '\00BB';
}
.DebugMessage.error {
  background-color: #ff00001f;
}

.DebugMessage.warning {
  background-color: #ffd9001f;
}



/* Responsive Design */
@media only screen and (max-width: 1200px) {

  body {
    flex-direction: column;
  }

  main {
    padding-left: 8px;
  }

  #sidebar  {
    translate: -340px 0;
  }

  #sidebar.visible {
    translate: 0 0;
  }

  #sidebar a.websiteName, #sidebar>hr:nth-of-type(1) {
    display: none;
  }

  #sidebar .nav-item:nth-of-type(3) {
    display: none;
  }

   #sidebarClose {
    display: block;
  }

  #mobileHeader {
    display: flex;
  }

  #DebugWindow {
    margin: 40px 0;
}

  .mainContent {
    margin-left: 0px;
    width: 100%;
  }

}



.nav-link {
  margin-bottom: 5px;
  border-radius: 10px;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  padding: 10px 0px 10px 20px;
  color: var(--sidebar-text-color);
  text-decoration: none;
}

.nav-link:hover {
  background-color: var(--primary-color-highlight);
}

.nav-link.active {
  background-color: var(--primary-color);
}

#BoardSelector {
  margin-bottom: 20px;
}
#BoardSelector label {
  padding-left: 10px;
  font-size: 1.2rem;
}
#BoardSelector select {
  border: none;
  width: 210px;
  height: 40px;
  border-radius: 15px;
  margin: 5px;
  padding: 5px;
  vertical-align: middle
}

#BoardSelector select option {
  border: none;
  height: 40px;
  border-radius: 15px;
  margin: 5px;
  padding: 5px;
}

#BoardSelector button {
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 15px;
  margin: 5px;
  padding: 5px;
  vertical-align: middle
}

#BoardSelector button:hover:enabled {
  background-color: var(--primary-color);
  color: #fff;
}

.ani-refresh-spin {
  transition: transform 1.5s ease-in-out;
  transform: rotate(1080deg);
  
}

.outline-box {
  border: 1px solid #ccc;
  border-radius: 10px;
  margin: 5px;
  padding: 15px;
}

.outline-box.info {
  background-color: #fff674;
  border-color: #a89d00;
  padding: 5px 15px;
}

.channels {
  display: grid;
  flex-direction: column;
}

#dashboard .channels {
  grid-template-columns: repeat(2, 1fr);
}

@media only screen and (max-width: 1200px) {
  #dashboard .channels {
    grid-template-columns: repeat(1, 1fr);
  }
}

.outline-box.flex {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}

.outline-box label {
  flex-grow: 1;
  margin-right: 5px;
  text-align: right;
}

.outline-box input {
  height: 30px;
  border-radius: 10px;
  border: 1px solid #ccc;
}

.outline-box select {
  height: 30px;
  border-radius: 10px;
  margin-right: 15px;
  padding: 5px;
}

.outline-box select option {
  border: none;
  height: 30px;
  border-radius: 10px;
  padding: 5px;
}

.BarGraph {
  margin: auto 10px auto 10px;
  width: 30%;
  height: 10px;
  background-color: #ccc;
  border-radius: 5px;
  overflow: hidden;
}

.BarGraph .valueBar {
  width: 100%;
  height: 100%;
  background-color: var(--primary-color);
  transition: width 0.2s ease-in-out;
}

.GPIOs {
  grid-template-columns: repeat(2, 1fr);
  display: grid;
}

#dashboard .GPIOs {
  grid-template-columns: repeat(5, 1fr);
}

@media only screen and (max-width: 1500px) {
  #dashboard .GPIOs {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media only screen and (max-width: 500px) {
  #dashboard .GPIOs {
    grid-template-columns: repeat(1, 1fr);
  }
}

#dashboard .GPIOs .GPIO {
  padding: 14px;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
}

#dashboard .GPIOs .GPIO:not(.enabled) > * {
filter: opacity(0.5);
}

#dashboard .GPIO a {
 flex-grow: 1;
}

.channel.disabled > *{
  filter: opacity(0.5);
}

.channel a {
  margin-left: 10px;
}

.channel .VoltageOutput {
  text-align: right;
  width: 80px;
  margin-right: auto;
  margin-left: 10px;
  font-style: italic;
}

.rule {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

@media only screen and (max-width: 900px) {
 .rule {
      flex-direction: column;
    align-items: flex-start;
 }
}

.width-600 {
  max-width: 600px;
}

.width-650 {
  max-width: 650px;
}


.RuleBtn {
  border-radius: 20%;
  height: 24px;
  text-align: center;
  border: 1px solid #ccc;
}

.RuleBtn:hover {
 color: white;
 background-color: red;
}

.RuleBtn:active {
  color: white;
  background-color: rgb(110, 0, 0)
}

#newRule {
padding: 10px 15px;
}

#newRule *{
 margin: 0px 5px;
}

#newRule .condition,
#newRule .action  {
  display: flex;
  flex-direction: row;
  align-items: center;
  background-color: rgb(212, 212, 212);
  padding: 8px;
  border-radius: 5px;
}

#newRule .RuleBtn {
  height: 30px;
  margin: 5px;
}

#newRule input{
  box-sizing: border-box;
  margin-right: 0;
  text-align: end;
}


#newRule input:invalid {
  border: 2px solid red;
}

#newRule .RuleBtn:hover {
  background-color: var(--primary-color);
  color: #fff;
}

 a.number {
  margin-left: 10px;
  font-weight: bold;
}

#dashboard a.number {
  margin-right: auto;
}

.channel a.number {
  max-width: 30%;
  min-width: 85px;
}


.GPIO button.StatusIndicatorRound {
  padding: 8px 8px;
  border-radius: 5px;
  background-color: gray;
  border: 2px solid white;
  width: 55px;
}
.GPIO button:disabled {
  color: var(--primary-text-color);
}

.GPIO button:not(:disabled).StatusIndicatorRound:hover {
  border: 2px solid var(--primary-color-highlight);
}


.GPIO .StatusIndicatorRound.high  {
  color: white;
  background-color: rgb(6, 194, 0);
}


.outline-button {
  border: none;
  background-color: var(--primary-color);
  color: #fff;
  border-radius: 15px;
  margin: 5px;
  padding: 10px;
}

.outline-button:disabled {
  background-color: var(--primary-color-highlight);
}

/* normal Checkboxes to small for this design */
input[type="checkbox"] {
  -webkit-appearance:none;
  appearance: none;
    display: flex;
        align-items: center;
    justify-content: center;
  width:25px;

  height:25px;
  background:white;
  border-radius:5px;
  border:2px solid #3f3f3f;


}
input[type='checkbox']:checked {
  background: var(--primary-color);
}
input[type="checkbox"]:checked:before {
  content: "\2716";
  display: block;
  text-align: center;
  color: #fff;
  font-weight: bold;
  line-height: 25px;

}

/* IMPROVE */
.tooltip {
  position: relative;
  display: inline-block;
}

.tooltip .tooltiptext {
  visibility: hidden;
  width: 120px;
  background-color: rgb(0, 0, 0);
  color: #fff;
  text-align: center;
  padding: 5px 0;
  border-radius: 6px;
  top: -10px;
  right: 105%;
  position: absolute;
  z-index: 1;
}

.tooltip:hover .tooltiptext.visible {
  visibility: visible;
}

#systeminfo h4 {
  margin-bottom: 0;
}