@import url('https://fonts.googleapis.com/css2?family=Inter:wght@100;200;300;400;500;600;700;800;900&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff; /* Text color changed to white */
  font-family: "Inter", sans-serif;
  background-color: #d0ffed; /* Dark background color */
  overflow: hidden;
}

.wrapper {
  height: 100vh;
  width: 100%;
  overflow: hidden;
  display: flex;
  position: relative;
}

@media (min-width:768px) {
  .wrapper {
      height: 50rem;
      width: 25rem;
      border-radius: 40px;
      border: 10px solid #2e2e2e;
  }
}

.calculator {
  background-color: #ffffff; /* Darker background color */
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.6); /* Increased shadow intensity */
  width: 100%;
  height: 100%;
  max-width: 400px;
  overflow: hidden;
  position: absolute;
}

.dark-mode .calculator {
  background-color: black; /* Dark mode background color */
  color: #fff; /* Dark mode text color */
}

.mode-toggle {
  position: relative;
  top: -6px;
  right: 10px;
}

.mode-toggle input[type="checkbox"] {
  display: none;
}

.mode-label {
  display: inline-block;
  width: 40px;
  height: 20px;
  background-color: #ddd;
  border-radius: 20px;
  padding: 15px 32px;
  position: relative;
  cursor: pointer;
}

.mode-label::after {
  content: '';
  display: block;
  width: 19px;
  height: 19px;
  background-color: #fff;
  border-radius: 50%;
  position: absolute;
  top: 6px;
  left: 6px;
  transition: 0.3s ease-in-out;
}

.mode-toggle input[type="checkbox"]:checked + .mode-label {
  background-color: #555; /* Darker background color when toggled */
}

.mode-toggle input[type="checkbox"]:checked + .mode-label::after {
  left: calc(100% - 24px);
}

.screen {
  background-color: #cde8ff;
  border: 1px solid #ccc;
  padding: 15px;
  height: calc(100% / 3); /* Set height to one-third of the parent height */
  margin-bottom: 20px;
  text-align: right;
  border-radius: 20px; /* Increased border radius for smoother appearance */
  font-size: 1.6rem;
  color: #555;
  position: relative;
  box-shadow: 10px 10px 30px rgb(60 174 186 / 31%), -10px -10px 30px rgb(52 19 19 / 9%); /* Adjusted box shadow for neumorphism effect */
}

.screen::before {
  content: "";
  position: absolute;
  top: -10px;
  right: -10px;
  border-top: 10px solid transparent;
  border-left: 10px solid #444; /* Slightly lighter border color */
}

.buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
}

.btn {
  background-color: #ffe3f1;
  border: none;
  padding: 20px;
  border-radius: 20px; /* Increased border radius for smoother appearance */
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1.4rem;
  box-shadow: 10px 10px 30px rgb(0 0 0 / 36%), -10px -10px 30px rgb(0 0 0 / 5%); /* Adjusted box shadow for neumorphism effect */
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn:hover {
  transform: translate(4px, 4px); /* Apply subtle hover effect */
  box-shadow: 6px 6px 20px rgba(0, 0, 0, 0.1), /* Adjusted box shadow for neumorphism effect */
              -6px -6px 20px rgba(255, 255, 255, 0.5); /* Adjusted box shadow for neumorphism effect */
}

.btn:active {
  transform: translate(1px, 1px); /* Apply subtle click effect */
  box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.1), /* Adjusted box shadow for neumorphism effect */
              -2px -2px 10px rgba(255, 255, 255, 0.5); /* Adjusted box shadow for neumorphism effect */
}

.btn.operator {
  background-color: #ff6961; /* Red color for operators */
  color: #fff;
  border-color: transparent;
}

.btn.operator:hover {
  background-color: #ff8c85;
}

.btn.operator:active {
  background-color: #ff5247;
}

.btn.equal {
  background-color: #77dd77; /* Green color for equal sign */
  color: #fff;
  border-color: transparent;
}

.btn.equal:hover {
  background-color: #8fe08f;
}

.btn.equal:active {
  background-color: #5dc45d;
}

.btn.clear, #back {
  background-color: #a9a9a9; /* Lighter gray color for clear button */
  color: #fff;
  border-color: transparent;
}

.btn.clear:hover {
  background-color: #bfbfbf;
}

.btn.clear:active {
  background-color: #949494;
}

.btn.mode-toggle {
  background-color: #444; /* Darker background color */
  color: #fff;
  border-color: transparent;
}

.btn.mode-toggle:hover {
  background-color: #555; /* Darker background color on hover */
}

.btn.mode-toggle:active {
  background-color: #333; /* Dark background color on click */
}
