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

/* ===== Background ===== */
body {
  font-family: "Poppins", sans-serif;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100vh;
  background: radial-gradient(circle at center, #0a0a0a, #010101 80%);
  color: #fff;
  padding: 20px;
  transition: 0.4s ease;
}

/* ===== Calculator Box ===== */
.calculator {
  width: 100%;
  max-width: 340px;
  padding: 20px;
  border-radius: 20px;
  background: rgba(20, 20, 20, 0.8);
  box-shadow: 0 0 30px rgba(0, 255, 200, 0.15);
  text-align: center;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(0, 255, 200, 0.2);
  transition: 0.4s;
}

.calculator:hover {
  box-shadow: 0 0 50px rgba(0, 255, 200, 0.25);
}

h1 {
  font-size: 1.5em;
  color: #00ffcc;
  margin-bottom: 15px;
  text-shadow: 0 0 10px #00ffcc;
}

input {
  width: 100%;
  height: 60px;
  font-size: 1.6em;
  text-align: right;
  padding: 10px;
  border: none;
  outline: none;
  border-radius: 10px;
  background: rgba(10, 10, 10, 0.8);
  color: #00ffee;
  margin-bottom: 15px;
  box-shadow: inset 0 0 10px rgba(0, 255, 204, 0.3);
}

/* ===== Buttons ===== */
.buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

button {
  padding: 16px;
  font-size: 1.2em;
  font-weight: 600;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: 0.25s ease;
  color: white;
  text-shadow: 0 0 5px rgba(255, 255, 255, 0.3);
}

button:active {
  transform: scale(0.95);
}

.number {
  background: #1b1f27;
  color: #00ffcc;
  box-shadow: 0 0 10px rgba(0, 255, 204, 0.2);
}
.number:hover { background: #232836; }

.operator {
  background: #ff0099;
  box-shadow: 0 0 15px rgba(255, 0, 153, 0.4);
}
.operator:hover { background: #ff33aa; }

.equal {
  background: #00ff88;
  color: #000;
  box-shadow: 0 0 15px rgba(0, 255, 136, 0.4);
}
.equal:hover { background: #00ffaa; }

.clear {
  background: #ff4444;
  box-shadow: 0 0 15px rgba(255, 68, 68, 0.4);
}
.clear:hover { background: #ff6666; }

.delete {
  background: #5555ff;
  box-shadow: 0 0 15px rgba(85, 85, 255, 0.4);
}
.delete:hover { background: #7777ff; }

.zero { grid-column: span 2; }

/* ===== Light Mode ===== */
body.light-mode {
  background: radial-gradient(circle at center, #f9f9f9, #dcdcdc 80%);
  color: #111;
}
body.light-mode .calculator {
  background: #fff;
  border-color: rgba(0, 0, 0, 0.1);
  box-shadow: 0 0 25px rgba(0, 0, 0, 0.2);
}
body.light-mode input {
  background: #f3f3f3;
  color: #111;
  box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.1);
}
body.light-mode h1 {
  color: #111;
  text-shadow: none;
}

/* ===== Toggle Switch ===== */
.theme-toggle {
  position: absolute;
  top: 20px;
  right: 20px;
}
.switch {
  width: 50px;
  height: 25px;
  background: #333;
  border-radius: 25px;
  position: relative;
  display: block;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(0, 255, 204, 0.4);
}
.switch::after {
  content: "";
  width: 21px;
  height: 21px;
  background: #00ffcc;
  border-radius: 50%;
  position: absolute;
  top: 2px;
  left: 3px;
  transition: 0.3s ease;
}
#modeSwitch:checked + .switch {
  background: #ccc;
}
#modeSwitch:checked + .switch::after {
  left: 26px;
  background: #333;
}

/* ===== Footer ===== */
footer {
  margin-top: 20px;
  font-size: 0.9em;
  color: #00ffee;
  text-shadow: 0 0 5px #00ffee;
  letter-spacing: 0.5px;
}
footer a {
  color: #ff00cc;
  text-decoration: none;
  font-weight: bold;
  text-shadow: 0 0 5px #ff00cc;
}
footer a:hover {
  color: #00ff99;
  text-shadow: 0 0 10px #00ff99;
}
.heart {
  color: #ff0055;
  text-shadow: 0 0 5px #ff0055;
  animation: pulse 1.3s infinite alternate;
}
@keyframes pulse {
  from { transform: scale(1); opacity: 0.8; }
  to { transform: scale(1.2); opacity: 1; }
}

/* Responsive */
@media (max-width: 400px) {
  .calculator { max-width: 290px; padding: 15px; }
  h1 { font-size: 1.3em; }
  input { height: 50px; font-size: 1.4em; }
  button { font-size: 1em; padding: 14px; }
}
