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

* {
  font-family: "Orbitron", sans-serif;
  --primary-color: #f3b519;
  --secondary-color: gray;
  --primary-text-color: #444;
  --secondary-text-color: whitesmoke;
  --toggle-background-color: #e8e8e8;

  --box-shadow-calculate: inset 0 -0.0625em 0.0625em 0.125em rgb(0 0 0 / 0.1),
    inset 0 -0.125em 0.0625em rgb(243, 181, 25),
    inset 0 0.1875em 0.0625em rgb(255 255 255 / 0.3),
    0 0.125em 0.125em rgb(0 0 0 / 0.5);

  --box-shadow: inset 0 -0.0625em 0.0625em 0.125em rgb(0 0 0 / 0.1),
    inset 0 -0.125em 0.0625em rgb(0 0 0 / 0.2),
    inset 0 0.1875em 0.0625em rgb(255 255 255 / 0.3),
    0 0.125em 0.125em rgb(0 0 0 / 0.5);

  --box-shadow-active: inset 0 -0.03125em 0.03125em 0.0625em rgb(0 0 0 / 0.2),
    inset 0 -0.0625em 0.03125em rgb(0 0 0 / 0.3),
    inset 0 0.09375em 0.03125em rgb(255 255 255 / 0.2),
    0 0.0625em 0.0625em rgb(0 0 0 / 0.3);
}

body {
  overflow: hidden;
}

.main {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  height: 100vh;
}

.divider {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  margin: 0;
  width: 45px;
  transform: rotate(270deg);
  gap: 1rem;
}

.results {
  display: flex;
  min-width: 30%;
  width: fit-content;
  height: 500px;
  color: var(--primary-text-color);
  flex-direction: column;
  font-size: 2rem;
  padding-left: 1rem;
  margin-top: 0;
  scrollbar-width: none;
  overflow-y: scroll;
  gap: 1rem;
}

.results-list {
  display: flex;
  flex-direction: column-reverse;
  height: fit-content;
  list-style: none;
  padding: 0;
  margin: 0;
}

.results-list li {
  padding: 0.5rem 2rem;
  white-space: nowrap;
  overflow: hidden;
  max-width: fit-content;
  color: var(--primary-text-color);
}

.results-list li:last-child {
  border-right: 0.1em solid var(--primary-text-color);
  animation: typing 3.5s steps(26, end) forwards,
    blink-caret 0.75s step-end infinite;
}

@keyframes typing {
  from {
    width: 0ch;
  }
  to {
    width: 26ch;
  }
}

@keyframes blink-caret {
  0%,
  100% {
    border-right-color: transparent;
  }
  50% {
    border-right-color: var(--primary-text-color);
  }
}

.divider p {
  text-align: center;
  font-size: 0.8em;
  color: var(--secondary-color);
  letter-spacing: 0.1em;
  margin: 0;
  padding-top: 3rem;
  transform-origin: center;
  white-space: nowrap;
}

hr {
  background-color: var(--secondary-color);
  width: 500px;

  margin: 0;
}

.calculator {
  background: #f0f0f0;
  width: 300px;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  justify-content: start;
  align-items: center;
  box-shadow: var(--box-shadow);
  padding: 20px;
  color: #333;
  border: 1px solid #ccc;
}

.calculator__display {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 150px;
  border-radius: 5px;
  display: flex;
  justify-content: center;
  align-items: center;
}

#display,
#display_result {
  width: 90%;
  height: 80%;
  border: none;
  color: var(--primary-text-color);
  background: transparent;
  font-size: 2em;
  text-align: right;
  padding: 10px;
  outline: none;
  transition: font-size 0.2s ease;
}

#display_result {
  margin-top: 10px;
  font-size: 1.3em;
  color: dimgray;
}

.logo {
  display: flex;
  width: 100%;
  height: 50px;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
}

h5 {
  margin: 0;
  padding: 0;
  font-size: 1.2em;
  letter-spacing: 0.08em;
  color: dimgray;
}

.calculator__keys {
  width: 100%;
  height: 200px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.number {
  background: var(--secondary-color);
  color: var(--secondary-text-color);
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.1s ease-in-out;
  box-shadow: var(--box-shadow);
}

.number:active {
  transform: translateY(2px);
  box-shadow: var(--box-shadow-active);
}

.process {
  background: var(--primary-color);
  border: none;
  color: var(--primary-text-color);
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.1s ease-in-out;
  box-shadow: var(--box-shadow);
}

.process:active {
  transform: translateY(2px);
  box-shadow: var(--box-shadow-active);
}

#null {
  grid-column: span 2;
  background: var(--secondary-color);
  color: var(--secondary-text-color);
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.1s ease-in-out;
  box-shadow: var(--box-shadow);
}

#null:active {
  transform: translateY(2px);
  box-shadow: var(--box-shadow-active);
}

.calculate {
  grid-column: 4;
  grid-row: 4 / 6;
  background: var(--primary-color);
  border: none;
  color: dimgray;
  font-size: 1.4rem;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.1s ease-in-out;
  box-shadow: var(--box-shadow-calculate);
}

.calculate:active {
  transform: translateY(2px);
  box-shadow: var(--box-shadow-active);
}

.toggle-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  border-radius: 0.5em;
  padding: 0.1em;
  margin: 0.3em 0;
  background-image: linear-gradient(
    to bottom,
    #d5d5d5,
    var(--toggle-background-color)
  );
  box-shadow: 0 1px 1px rgb(255 255 255 / 0.6);
  font-size: 1.5em;
}

.toggle-checkbox {
  appearance: none;
  position: absolute;
  z-index: 1;
  border-radius: inherit;
  width: 100%;
  height: 100%;
  font: inherit;
  opacity: 0;
  cursor: pointer;
}

.toggle-container {
  display: flex;
  align-items: center;
  position: relative;
  border-radius: 0.375em;
  width: 2em;
  height: 1em;
  background-color: var(--toggle-background-color);
  box-shadow: inset 0 0 0.05em 0.1em rgb(255 255 255 / 0.2),
    inset 0 0.05em 0.1em rgb(0 0 0 / 0.4);
  transition: background-color 0.4s linear;
}

.toggle-checkbox:checked + .toggle-container {
  background-color: #abbfa2;
}

.toggle-button {
  display: flex;
  justify-content: center;
  align-items: center;
  position: absolute;
  left: 0.05em;
  border-radius: 0.2em;
  width: 1em;
  height: 1em;
  background-color: var(--toggle-background-color);
  box-shadow: var(--box-shadow);
  transition: left 0.4s;
}

.toggle-checkbox:checked + .toggle-container > .toggle-button {
  left: 1em;
}
