@import url("https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap");

:root {
  --ffPoppins: "Poppins", sans-serif;
  --backgroundColor: #000;
  --fontColor: #fff;

  --numbersBgColor: #333333;
  --operatorsBgColor: #ff9f0a;
  --otherButtonsColor: #a5a5a5;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: var(--ffPoppins);
}
/*  */
/*  */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 60px;
  display: flex;
  align-items: center;
  padding: 12px;
}

.historyIcon {
  height: 48px;
  aspect-ratio: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}
svg {
  height: 24px;
  fill: var(--fontColor);
}

/*  */
/*  */
body {
  background: var(--backgroundColor);
  color: var(--fontColor);
}

.calculatorSection {
  height: 100dvh;
}
.calculatorContainer {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: end;
}
/*  */
.inputCnt {
  padding: 12px;
  display: flex;
  flex-direction: column;
  font-size: 3em;
  text-align: right;
}
.currentExpressionContainer {
  all: unset;
  text-wrap: nowrap;
}
.resultContainer {
  text-wrap: nowrap;
  max-width: 100%;
  overflow: auto;
}
/*  */
.buttonsCnt {
  padding: 12px;
}
.basicButton {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.basicButton .button {
  aspect-ratio: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 2em;
  border-radius: 50%;
  background: var(--numbersBgColor);
  font-weight: 500;
  cursor: pointer;
  user-select: none;

  -webkit-tap-highlight-color: transparent;
}
.basicButton .button:active {
  transition: 0.1s ease;
  opacity: 0.75;
}
.zeroButton {
  grid-column: 1/3;
  aspect-ratio: initial !important;
  border-radius: 48px !important;
  justify-content: left !important;
  padding-left: 24px;
}
.otherButton {
  background: var(--otherButtonsColor) !important;
  color: initial;
}

.operatorButton {
  background: var(--operatorsBgColor) !important;
  font-size: 1.5em;
}
/*  */
/* History Section Stylings */
.historySection {
  position: fixed;
  top: 0;
  width: 100%;
  height: 100vh;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(24px);
  transition: 0.2s ease;
  transform: translateX(-100%);
  padding: 18px;
}
.historySectionActive {
  transform: translate(0);
  overflow: auto;
}
.historySection h2 {
  margin: 12px 0;
}
.historyContainer {
  padding: 6px;
}
.historyDiv {
  margin: 16px 0;
  padding: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}
.historyDiv:nth-last-child(1) {
  margin-bottom: 48px;
}
.historyExpression {
  color: #aaaaaa;
  text-wrap: wrap;
  line-break: anywhere;
}
.historyResult {
  font-size: 1.75em;
}

.closeHistoryCnt {
  position: absolute;
  height: 48px;
  aspect-ratio: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  top: 24px;
  right: 16px;
  background: gray;
  border-radius: 50%;
}

/*  */
/*  */
/*  */
/*  */
/*  */
/*  */
/*  */
/*  */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.no-historyClass {
  height: calc(100vh - 120px);
  display: flex;
  justify-content: center;
  align-items: center;
}
.clearHistoryCnt {
  position: absolute;
  background: red;
  padding: 6px 24px;
  right: 24px;
  transform: translateY(-36px);
  border-radius: 6px;
  cursor: pointer;
}
@media (min-width: 720px) {
  .historySection {
    max-width: 45%;
    background: linear-gradient(to right, rgb(30, 30, 30), rgb(0, 0, 0));
  }
  .historySection::-webkit-scrollbar {
    display: none;
  }

  .closeHistoryCnt {
    display: none;
  }
  .calculatorSection {
    max-width: 55%;
    margin-left: auto;
  }
  .basicButton {
    gap: 4px;
  }
  .basicButton .button {
    aspect-ratio: unset;
    border-radius: 6px;
    height: 65px;
  }
}
@media (max-height: 480px) {
  * {
    display: none;
  }
}
