/*===============================
  Fonts
================================*/
@font-face {
  font-family: "digi";
  src: url(./DS-DIGI.TTF);
}

/*===============================
  Global Styles
================================*/
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  outline: 0;
  border: 0;
  text-decoration: none;
}

::selection {
  background: transparent;
}

body {
  min-height: 100vh;
  width: 100%;
  background: linear-gradient(135deg, #ffffff, #ededed);
  display: grid;
  place-content: center;
  font-family: "digi";
}

/* Preloader */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 1500;
  background: #000;
  width: 100vw;
  height: 100vh;
  display: grid;
  place-content: center;
  transition: opacity 0.4s ease-in-out;
}

.preloader .loading {
  color: #333;
  font-size: 3em;
  font-family: Arial, Helvetica, sans-serif;
  font-weight: 600;
  animation: loadingAnimation 1.5s infinite;
}

@keyframes loadingAnimation {
  0% {
    transform: scale(1);
    opacity: 0.5;
  }
  50% {
    transform: scale(1.1);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 0.5;
  }
}

/*===============================
  Calculator Container
================================*/
.calculator {
  display: flex;
  align-items: center;
  height: calc(1.3 * 29.7em);
  width: calc(1.3 * 15.11em);
  position: relative;
}

.calculator-case {
  position: absolute;
  inset: 0;
  height: 100%;
  width: auto;
}

.calculator-body {
  z-index: 100;
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/*===============================
  Display
================================*/

.mode-display {
  position: absolute;
  top: 6.7rem;
  right: 3rem;
  font-weight: 600;
  font-size: 12px;
}

.display-input {
  position: absolute;
  top: 8rem;
  left: 2.4rem;
  width: calc(0.49 * 15.11em);
  font-family: "digi";
  font-size: 2rem;
  background: transparent;
  pointer-events: none;
  transition: opacity 0.3s;
  align-self: center;
}

/*===============================
  Button Area 0 (Top Row)
================================*/
.buttonarea0 {
  z-index: 100;
  display: grid;
  position: absolute;
  top: 13.5rem;
  margin-inline: 42px;
  grid-template-columns: 1fr 1fr 3fr 1fr 1fr;
  gap: 15px 9px;
  align-items: center;
}

.button3 {
  background-color: #9d9d9d;
  color: #9d9d9d;
  box-shadow: 0px 1px 4px rgba(0, 0, 0, 0.854);
  border-radius: 10rem;
  height: 20.2px;
  width: 27px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(0.1rem, 4vw, 0.7rem);
  font-weight: bold;
  font-family: "Arial";
}

.button3:nth-child(1) {
  transform: translateY(-0.8em) rotate(5deg);
}

.button3:nth-child(2) {
  transform: translateY(-0.3em) rotate(5deg);
}

.button3:nth-child(4) {
  transform: translateY(-0.3em) rotate(-5deg);
}

.button3:nth-child(5) {
  transform: translateY(-0.8em) rotate(-5deg);
}

/*===============================
  Replay Button
================================*/
#replay {
  background: #9d9d9d;
  height: 70px;
  width: 5.5em;
  display: flex;
  align-items: center;
  justify-content: space-around;
  border-radius: 60%;
}

#replay span {
  opacity: 0.7;
}

#left-arrow,
#right-arrow {
  font-size: 7px;
}

/*===============================
  Button Area 1
================================*/
.buttonarea1 {
  z-index: 100;
  display: grid;
  position: absolute;
  top: 17.2rem;
  margin-inline: 22px;
  row-gap: 15px;
  align-items: center;
}

.buttonarea1-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  column-gap: 9px;
}

.buttonarea1-row:first-child {
  grid-template-columns: 1fr 1fr 2fr 1fr 1fr;
}

.button1 {
  background-color: #2a3c4a;
  color: white;
  box-shadow: 0px 1px 4px rgba(0, 0, 0, 0.854);
  border-radius: 5px;
  height: 23.2px;
  width: 31.8333333px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(0.1rem, 4vw, 0.8rem);
  font-weight: bold;
  font-family: "Arial";
}

.font-shrink {
  font-size: clamp(0.05rem, 4vw, 0.45rem) !important;
}

#empty-div {
  height: 23.2px;
  width: 62.8333333px;
}

/*===============================
  Button Area 2 (Bottom Row)
================================*/
.buttonarea2 {
  z-index: 100;
  display: grid;
  position: absolute;
  bottom: 2.3rem;
  margin-inline: 22px;
  grid-template-columns: repeat(5, 1fr);
  gap: 15px 9px;
  align-items: center;
}

.button2 {
  background-color: rgb(157, 157, 157);
  color: white;
  box-shadow: 0px 1px 4px rgba(0, 0, 0, 0.854);
  border-radius: 5px 5px 25% 25%;
  height: 25px;
  width: 40px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(0.2rem, 4vw, 1rem);
  font-weight: bold;
  font-family: "Arial";
}

/*===============================
  Common Button Active States
================================*/
.button1:active,
.button2:active,
.button3:active {
  box-shadow: 0px 1px 4px rgba(0, 0, 0, 0.854) inset;
}
.button1:active,
.button2:active {
  transform: scale(0.97);
}

/*===============================
  Special Buttons
================================*/
.remove-btn {
  background-color: rgb(150, 68, 68);
}

.popup {
  padding: 4em 2.5rem;
  background: #414d5b;
  background: #000;
  position: absolute;
  min-height: 100%;
  z-index: 1000;
  display: none;
  flex-direction: column;
  gap: 4rem;
}
.popup h1 {
  color: white;
  font-size: 1.3rem;
  font-family: Arial, Helvetica, sans-serif;
  margin-bottom: 2rem;
}

.constants-popup {
  /* position: absolute; */
  /* min-height: 100vh; */
  inset: 0;
  /* width: 400px; */
  /* display: flex; */
  /* justify-content: center; */
}
.constants-container {
  width: 80%;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem 15px;
  /* align-items: center; */
  /* justify-content: center; */
}
.memory-container {
  width: 80%;
  display: grid;
  /* grid-template-columns: repeat(, 1fr); */
  gap: 2rem 15px;

  /* align-items: center; */
  /* justify-content: center; */
}

.memory-column {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.memory-row-1 {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.memory-row-title {
  color: white;
  font-weight: 600;
  font-size: 1rem;
  font-family: Arial, Helvetica, sans-serif;
}

.memory-row-input {
  font-size: 0.8rem;
  color: white;
  height: 2rem;
  width: 6rem;
  background: transparent;
  /* border: none; */
  outline: 2px solid white;
  font-family: Arial, Helvetica, sans-serif;
  color: #fff;
  text-align: center;
}

.memory-buttons {
  display: flex;
  gap: 2rem;
}

.memory-button {
  background: #000;
  color: white;
  cursor: pointer;
}
.constants-container button,
.memory-container button {
  position: relative;
  transform: scale(1.2);
  /* box-shadow: none; */
  background: #000;
}

.constants-container button:hover::after {
  content: attr(title);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background-color: #333;
  color: white;
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 12px;
  white-space: nowrap;
  z-index: 1000;
  margin-bottom: 5px;
  font-family: Arial, sans-serif;
}

.constants-container button:hover::before {
  content: "";
  position: absolute;
  bottom: calc(100% - 5px);
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid #333;
  z-index: 1000;
}

.copy {
  position: absolute;
  bottom: 1rem;
  position: fixed;
  right: 2rem;
  color: #333;
  font-family: Arial, Helvetica, sans-serif;
  font-weight: 500;
}

@media (max-width: 1024px) {
  .popup {
    visibility: hidden;
  }
}
