body {
  background-color: #121212;
  color: white;
  font-family: Arial, sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  margin: 0;
  text-rendering: optimizeLegibility;
}

.calculator {
  position: absolute;  
  width: 320px;
  background-color: #1e1e1e;
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.display {
  background-color: #1a1a1a;
  color: #00e6e6;
  font-size: 2em;
  padding: 10px;
  border-radius: 10px;
  text-align: right;
  height: 50px;
  overflow: hidden;
  overflow-x: auto; 
  white-space: nowrap; 
  scrollbar-width: thin; 
  scrollbar-color: #00e6e6 #1a1a1a;
  user-select: none;
}

.buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: 20px;
}

.button {
  background-color: #2c2c2c;
  color: white;
  font-size: 1.2rem;
  border-radius: 10px;
  padding: 15px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  user-select: none;
  touch-action: manipulation;
}

.button:hover {
  background-color: #00e6e6;
  color: #121212;
}

.button:active {
  transform: scale(1.05);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.753);
}

.button.clear {
  background: #ff4d4d;
  color: #fff;
}

.button:hover {
  background-color: #00e6e6;
  color: #121212;
}


.button.equals {
  background: #ffffff;
  color: #000;
}

.history {
  grid-column: span 4;
  text-align: center;
  background-color: #121212;
  color: #00e6e6;
  padding: 10px;
  font-size: 1rem;
  cursor: pointer;
}

.history:hover {
  background-color: #00e6e6;
  color: #121212;
}

.history-list {
  background-color: #000000;
  color: white;
  padding: 10px;
  max-height: 70px;
  overflow-y: auto;
  border-top: 1px solid #00e6e6;
  scrollbar-width: thin;
  scrollbar-color: #00e6e6 #1a1a1a;
}

.history-list::-webkit-scrollbar {
  width: 6px;
}

.history-list::-webkit-scrollbar-track {
  background: #1a1a1a;
}

.history-list::-webkit-scrollbar-thumb {
  background: #00e6e6;
  border-radius: 10px;
}

.history-list::-webkit-scrollbar-thumb:hover {
  background: #00b3b3;
}

.history-item {
  margin-bottom: 5px;
  font-size: 1rem;
}

.hidden {
  display: none;
}

/* Manual Button */
.button.manual {
  background-color: transparent;
  color: #00e6e6;
  font-size: 1rem;
  position: absolute;
  top: 20px;
  right: 10px;
  border: none;
  cursor: pointer;
  user-select: none;
  z-index: 9999;
  transition: color 0.3s ease;
}

.button.manual:hover {
  color: #ffcc00;
}

/* Modal Background (blurred effect behind the modal) */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5); /* Semi-transparent dark background */
  backdrop-filter: blur(20px); /* Blur effect for background */
  z-index: 999; /* Behind the modal */
  pointer-events: none; /* Allow clicks to pass through to the content behind */
  opacity: 0; /* Start with zero opacity */
  transition: opacity 0.3s ease, backdrop-filter 0.3s ease; /* Fade in/out and blur transition */
}

/* Modal Content (transparent background) */
.modal-content {
  padding: 20px;
  border-radius: 10px;
  width: 80%;
  max-width: 500px;
  color: #ffffff;
  font-size: 1.2rem;
  text-align: left;
  z-index: 1000;
  position: fixed; /* Fixed position to keep modal on top */
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%); /* Center the modal */
  display: none; /* Hidden by default */
  background: transparent; /* No background for content */
  border: none; /* No border */
  
}

/* Modal Heading */
.modal h2 {
  font-size: 1.5rem;
  margin-bottom: 15px;
  font-weight: bold;
}


/* Modal Scrollable Content */
.modal-content p {
  overflow-y: auto;
  max-height: 300px;
  padding: 10px;
  scrollbar-width: thin;
  scrollbar-color: #000000 #6d6c6c;
}

/* For Webkit Browsers */
.modal-content::-webkit-scrollbar {
  width: 6px;
}

.modal-content::-webkit-scrollbar-thumb {
  background: #ffffff;
  border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
  background: #ffffff;
}



.bottom-strip {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background-color: #333;
  color: #fff;
  text-align: center;
  padding: 10px 0;
  font-family: Arial, sans-serif;
  font-size: 14px;
  user-select: none;
}

