@import url("https://fonts.googleapis.com/css2?family=Kanit: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 {
  --background-color: #0e1217;
  --background-light: #1c1f26;
  --smooth-out-bezier: cubic-bezier(0.2, 0.8, 0.3, 0.95);
  font-size: 18px;
}

.font-kanit.font-kanit {
  font-family: "kanit";
}

body {
  background-color: var(--background-color);
  color: white;
  margin: 0;
  padding: 0;
}

.navbar {
  background-color: var(--background-light);
  position: absolute;
  top: 2.5%;
  left: 15px;
  height: 94%;
  width: 2.5%;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 0.5rem;
  padding-top: 20px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 10px;
}

.navbar #calculator-icon {
  color: white;
  padding-top: 5px;
}

#calculator-icon-link {
  display: flex;
  justify-content: center;
  align-items: center;
}

.navbar .divider {
  width: 70%;
  height: 1px;
}

.small-icon-container {
  margin: 0 auto;
  text-decoration: none;
  color: white;
}

.small-icon {
  width: 13px;
  filter: invert(1);
}

#binary-one#binary-one {
  width: 10.5px;
}

#i-icon {
  width: 11px;
}

header {
  display: flex;
  justify-content: center;
  align-items: center;
}

.logo {
  width: 60px;
  margin-right: 10px;
  filter: invert(50%) sepia(61%) saturate(404%) hue-rotate(72deg)
    brightness(100%) contrast(86%);
}

h1 {
  text-align: center;
  font-size: 3rem;
}

.grid-container {
  display: grid;
  grid-template-columns: repeat(2, 50%);
}

.calculator {
  width: 72%;
  padding: 2%;
  aspect-ratio: 1/1;
  margin: 0 auto;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 1rem;
}

.divider {
  width: 95%;
  height: 2px;
  margin: 1rem auto;
  border-radius: 1rem;
  background-color: rgba(255, 255, 255, 0.3);
}

.calculator #result,
.calculator #previous-num {
  display: block;
  height: 5rem;
  font-size: 3rem;
  text-align: right;
  padding-right: 5%;
  overflow: hidden;
  white-space: nowrap;
}

.calculator #result {
  height: 6rem;
}

.grid-btn {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: repeat(4, 21.3%);
  gap: 5%;
  grid-template-rows: repeat(5, 15%);
}

.numbers-btn-container {
  grid-column: 1/4;
  grid-row: 2/6;
  display: grid;
  grid-template-columns: repeat(3, 30%);
  grid-template-rows: repeat(4, 21.5%);
  gap: 5%;
}

.btn {
  font-size: 3rem;
  font-family: kanit;
  background-color: var(--background-light);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 0.5rem;
  &:hover {
    cursor: pointer;
  }
}

#btn-0 {
  grid-column: 1/3;
}

#btn-dot {
  grid-column: 3/4;
}

.operation-btn-container {
  grid-row: 1/6;
  display: grid;
  grid-template-rows: repeat(5, 16%);
  gap: 5%;
}

.history-container {
  width: 80%;
  margin: 0 auto;
}

.history-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.history-header h3 {
  font-size: 2.5rem;
  margin: 0;
  padding: 0;
}

.history-btn {
  font-size: 1rem;
  background-color: var(--background-color);
  color: white;
  padding: 0.2rem 0.3rem;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 0.3rem;
  transition: all 300ms var(--smooth-out-bezier);
  &:hover {
    cursor: pointer;
  }
}

@media (prefers-reduced-motion: no-preference) {
  #clear-history-btn:hover {
    scale: 1.15;
    border: 2px solid rgba(255, 0, 0, 0.5);
  }
}

#history-content {
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 40px;
}

.history-calculation {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--background-light);
  border-radius: 0.5rem;
  padding: 0.5rem;
  padding-left: 0.7rem;
  padding-bottom: 0.7rem;
}

.history-calculation h4 {
  margin: 0;
  font-size: 1.5rem;
  color: rgb(255, 156, 98);
}

.history-calculation p {
  color: rgba(255, 255, 255, 0.7);
  margin: 0;
}

.history-calculation img {
  width: 30px;
  margin-right: 5px;
  position: relative;
  top: 2px;
  &:hover {
    cursor: pointer;
    filter: invert(0.5) sepia(1) saturate(90);
    opacity: 0.7;
  }
}

.btn {
  display: flex;
  justify-content: center;
  align-items: center;
}
