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

body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100vh;
  gap: 15px;
  font-family: "Montserrat", sans-serif;
}

.container {
  max-width: 900px;
}

.calculate {
  width: 350px;
  display: flex;
  flex-direction: column;
  padding: 20px;
  gap: 15px;
  background-color: black;
  border-radius: 15px;
  position: relative;
  overflow: hidden;
}

.history-icon {
  color: rgb(141, 122, 27);
  font-size: 1.3rem;
  cursor: pointer;
}

.history-icon:hover {
  color: rgb(176, 176, 111);
}

.history-panel {
  display: none;
  flex-direction: column;
  position: absolute;
  background-color: rgba(20, 20, 20, 0.95);
  bottom: 0;
  left: 0;
  height: 70%;
  width: 100%;
  border-radius: 15px;
  justify-content: space-between;
  padding: 16px;
  z-index: 10;
}

.history-panel.active {
  display: flex;
  animation: slide 0.3s ease-in-out forwards;
}

.history-panel-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  padding: 10px;
  font-size: 1.4rem;
  font-weight: 650;
}

.history-panel-header span:first-child {
  color: aliceblue;
}
.history-panel-header span:nth-child(2) {
  cursor: pointer;
  color: rgb(255, 0, 0);
}

#history-list {
  flex: 1; /* THÊM dòng này: Tự động chiếm hết khoảng trống ở giữa */
  overflow-y: auto; /* THÊM dòng này: Nếu dài quá thì hiện thanh cuộn */
  margin-bottom: 10px;
}

#history-list li {
  display: flex;
  justify-content: space-between;
  padding: 10px;
  border-bottom: 1px solid #333;
  color: white;
  font-weight: 400;
  font-size: 1.2rem;
}

.no-History {
  width: 100%;
  color: aliceblue;
  font-size: 1.2rem;
  font-weight: 400;
  font-style: italic;
}

.delete {
  cursor: pointer;
}

/* Tùy chỉnh thanh cuộn cho Webkit (Chrome, Edge, Safari) */
#history-list::-webkit-scrollbar {
  width: 5px; /* Chiều rộng thanh cuộn nhỏ lại */
}

#history-list::-webkit-scrollbar-track {
  background: transparent; /* Nền thanh cuộn trong suốt */
}

#history-list::-webkit-scrollbar-thumb {
  background: #555; /* Màu thanh cuộn xám tối */
  border-radius: 10px; /* Bo tròn */
}

#history-list::-webkit-scrollbar-thumb:hover {
  background: #888; /* Sáng lên khi di chuột vào */
}

.clear-history-btn {
  width: 100%;
  border-radius: 25px;
  height: 40px;
  font-size: 1rem;
  background-color: #454343;
}

#display {
  height: 120px;
  padding-top: 30px;
  background-color: transparent;
  border: none;
  color: aliceblue;
  font-size: 3rem;
  font-weight: 400;
  text-align: right;
}

.buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
}

button {
  width: 100%;
  height: 65px;
  font-size: 16px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  color: aliceblue;
  background-color: rgb(87, 87, 87);
  font-weight: 400;
  font-size: 1.3rem;
}

.action-btn {
  color: black;
  background-color: rgb(154, 153, 153);
}

.calculate-btn {
  background-color: rgb(220, 189, 19);
}

.btn-zero {
  grid-column: span 2;
  border-radius: 30px;
}

@keyframes slide {
  0% {
    opacity: 0;
    transform: translateY(50px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}
