:root {
  --primary-color: #afc1d6;
  --secondary-color: #91a6bc;
  --tertiary-color: #121212;
  --light-grey-color: #909090;
  --grey-color: #444;
  --dark-grey-color: #212121;
  --success-color: #34c759;
  --danger-color: #ff3b30;
  --grey-primary-color: #7d95a8;
}

body {
  background-color: var(--tertiary-color);
  color: var(--primary-color);
  font-family: Arial, sans-serif;
  padding: 2rem;
  display: flex;
  justify-content: center;
}

.dashboard {
  width: 56.5rem;
  border: .1rem solid var(--grey-color);
  display: flex;
  flex-direction: column;
  gap: .1rem;
  background-color: var(--grey-color);
}

.panel {
  background-color: var(--dark-grey-color);
  padding: 1rem;
  display: flex;
}

.btn {
  background: none;
  color: inherit;

  &:hover {
    cursor: pointer;
  }

  &[disabled] {
    color: var(--grey-color);
  }
}

/* --- Top Row Indicators --- */
.top-row {
  gap: 1.25rem;
}

.indicator {
  border-radius: .3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--light-grey-color);
}

.alert-success,
.btn.alert-success {
  color: var(--success-color);
  border-color:  var(--success-color);;
}

.alert-danger,
.btn.alert-danger {
  color: var(--danger-color);
  border-color:  var(--danger-color);;
}

/* --- Gauges --- */
.gauges-row {
  justify-content: space-around;
}

.gauge {
  width: 17rem;
  height: 17rem;
  background: radial-gradient(circle, var(--grey-color) 0%, var(--dark-grey-color) 100%);
  border-radius: 50%;
  border: .2rem solid var(--grey-color);
  position: relative;
  text-align: center;
}

.gauge-label {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 2.5rem;
  margin-left: -1.25rem;
  margin-top: -0.5rem;
  font-size: .8rem;
  line-height: 1rem;
  z-index: 5;
}

.gauge-center {
  width: 1.25rem;
  height: 1.25rem;
  background-color: var(--primary-color);
  border-radius: 50%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.needle {
  width: .3rem;
  height: 6.2rem;
  background-color: var(--secondary-color);
  position: absolute;
  bottom: 50%;
  left: calc(50% - 0.15rem);
  transform-origin: bottom center;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
}

.gauge-value {
  position: relative;
  top: 78%;
}

/* --- Data Row & Slider --- */
.middle-row {
  justify-content: space-between;
  align-items: center;

  .item {
    display: flex;
    flex-direction: column;
    align-items: center;

    .value {
      margin-top: .5rem
    }
  }
}

.slider {
  width: 300px;
  text-align: center;

  .input-range {
    width: 100%;
    accent-color: var(--primary-color);
  }

  .labels {
    display: flex;
    justify-content: space-between;
    font-size: 1rem;
    color: var(--primary-color);
  }
}

/* --- Bottom Buttons --- */
.bottom-row {
  justify-content: space-between;
}

.charging-btn {
  border-radius: 50%;
  width: 3.75rem;
  height: 3.75rem;
  padding: 0;
}

[popovertarget="gear-selection"] {
  anchor-name: --gear;
}

#gear-selection {
  position: relative;
  position-anchor: --gear;
  position-area: bottom;
  background: var(--primary-color);
  border-radius: .3rem;
}

fieldset {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: .1rem;

  label {
    padding: .7rem;

    &:hover {
      background: var(--secondary-color)
    }

    &:has(input[type="radio"]:checked) {
      background-color: var(--grey-primary-color);
    }
  }
}

input[type="radio"] {
    display: none;
}
