@import url("https://fonts.googleapis.com/css2?family=Spartan:wght@700&display=swap");

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  width: 100vw;
  height: 100vh;
}

.container {
  --t1-mainbackground: hsl(222, 26%, 31%);
  --t1-toggle-keypad-background: hsl(223, 31%, 20%);
  --t1-screen-background: hsl(224, 36%, 15%);
  --t1-key-blue-background: hsl(225, 21%, 49%);
  --t1-key-blue-shadow: hsl(224, 28%, 35%);

  --t1-key-orange-background-toggle: hsl(6, 63%, 50%);
  --t1-key-red-shadow: hsl(6, 70%, 34%);

  --t1-key-white-background: hsl(30, 25%, 89%);
  --t1-key-white-shadow: hsl(28, 16%, 65%);

  --t1-text-blue: hsl(221, 14%, 31%);
  --t1-text-display: white;
  --t1-text-white: white;
}

main {
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  font-family: "Spartan", sans-serif;
  background-color: var(--t1-mainbackground); /*themeable*/
  padding: 10px;
}

.compound-toggle {
  display: grid;
  grid-template-columns: 142px 80px 26px 26px 26px;
  grid-template-rows: 15px 30px;
}

.item {
  color: var(--t1-text-white);
  font-size: 0.6rem;
}

.item-label {
  font-size: 0.5rem;
  text-align: right;
  text-transform: uppercase;
  grid-column: 2 / 3;
  grid-row: 2 / -1;
  margin-top: 6px;
  margin-right: 0.5rem;
}

.item-1 {
  grid-column: 3 / 4;
  grid-row: 1 / 2;
  text-align: center;
}

.item-2 {
  grid-column: 4 / 5;
  grid-row: 1 / 2;
  text-align: center;
}

.item-3 {
  grid-column: 5 / -1;
  grid-row: 1 / 2;
  text-align: center;
}

.item-title {
  color: var(--t1-text-white);
  font-size: 0.8rem;
  grid-column: 1 / 2;
  grid-row: 2 / -1;
  text-align: left;
  margin-top: 3px;
}

.top {
  width: 300px;
  font-size: 50px;
  color: white;
  display: flex;
  flex-direction: row;
  justify-content: center;
}

/**************Three State Toggle Radio************/

.wrapper {
  margin: 0 0;
  grid-column: 3 / -1;
  grid-row: 2 / -1;
}

.toggle_radio {
  position: relative;
  background: var(--t1-toggle-keypad-background); /*themeable*/
  margin: 0 auto;
  overflow: hidden;
  padding: 0 0;
  border-radius: 50px;
  position: relative;
  height: 26px;
  width: 78px;
}

.toggle_radio > * {
  float: left;
}

.toggle_radio input[type="radio"] {
  display: none;
  /*position: fixed;*/
}

.toggle_radio label {
  color: rgba(255, 255, 255, 0); /* alpha 0; invisible */
  z-index: 0;
  display: block;
  width: 20px;
  height: 20px;
  margin: 3px 3px;
  border-radius: 50px;
  cursor: pointer;
  z-index: 1;
  text-align: center;
}

.toggle_option_slider {
  /*display: none;*/
  /*background: red;*/
  background: var(--t1-key-orange-background-toggle); /*themeable*/
  width: 20px;
  height: 20px;
  position: absolute;
  top: 3px;
  border-radius: 50%;
  transition: all 0.4s ease;
}

#first_toggle:checked ~ .toggle_option_slider {
  left: 3px;
}

#second_toggle:checked ~ .toggle_option_slider {
  left: 29px;
}

#third_toggle:checked ~ .toggle_option_slider {
  left: 55px;
}

/***********************************************/

/************Display****************************/

.display {
  background-color: var(--t1-screen-background); /*themeable*/
  color: var(--t1-text-display);
  font-size: 1.5rem;
  width: 300px;
  height: 40px;
  text-align: end;
  line-height: 35px;
  padding: 5px;
  overflow: hidden;
  border-radius: 3px 3px;
}

/************Calculator Keys********************/

.bottom {
  margin-top: 1rem;
  background-color: var(--t1-toggle-keypad-background); /*themeable*/
  border-radius: 3px;

  width: 300px;
  padding: 1%;
}
.compound-btns-container {
  margin: 0 auto;
  width: 90%;
  height: 90%;
  display: grid;
  gap: 0.5em;
  grid-template-areas:
    "del sign percent divide"
    "seven eight nine multiply "
    "four five six minus"
    "one two three plus"
    "zero zero dot equal";
}

.btns {
  color: var(--t1-text-blue);
  font-size: 1rem;
  background-color: var(--t1-key-white-background); /*themeable*/
  text-align: center;
  padding: 0.5rem;
  width: auto;
  height: auto;
  border-radius: 3px;
  box-shadow: 0px 1px var(--t1-key-white-shadow); /*themeable*/
}

#btns-sign {
  grid-area: sign;
}

#btns-percent {
  grid-area: percent;
}

#btns-7 {
  grid-area: seven;
}

#btns-8 {
  grid-area: eight;
}

#btns-9 {
  grid-area: nine;
}

#btns-del {
  color: var(--t1-text-white);
  background-color: var(--t1-key-blue-background); /*themeable*/
  box-shadow: 0px 1px var(--t1-key-blue-shadow);
  grid-area: del;
}

#btns-4 {
  grid-area: four;
}

#btns-5 {
  grid-area: five;
}

#btns-6 {
  grid-area: six;
}

#btns-plus {
  background: var(--t1-key-orange-background-toggle); /*themeable*/
  grid-area: plus;
}

#btns-one {
  grid-area: one;
}

#btns-two {
  grid-area: two;
}

#btns-three {
  grid-area: three;
}

#btns-minus {
  background: var(--t1-key-orange-background-toggle); /*themeable*/
  grid-area: minus;
}

#btns-dot {
  grid-area: dot;
}

#btns-0 {
  grid-area: zero;
}

#btns-divide {
  background: var(--t1-key-orange-background-toggle); /*themeable*/
  grid-area: divide;
}

#btns-multiply {
  background: var(--t1-key-orange-background-toggle); /*themeable*/
  grid-area: multiply;
}

#btns-reset {
  color: var(--t1-text-white);
  grid-area: reset;
  background-color: var(--t1-key-blue-background); /*themeable*/
  box-shadow: 0px 1px var(--t1-key-blue-shadow);
}

#btns-equal {
  background: var(--t1-key-orange-background-toggle); /*themeable*/
  box-shadow: 0px 1px var(--t1-key-red-shadow);
  grid-area: equal;
}

.container[data-theme="three"] #btns-equal {
  /* using descendant combinator selector */
  color: black;
}

.attribution {
  font-size: 11px;
  text-align: center;
}

.attribution a {
  color: hsl(228, 45%, 44%);
}
