* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', sans-serif;
}

body {
  background: linear-gradient(to bottom right, #e6f0ff, #f0f7ff);
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  transition: background 0.5s ease;
}

.container {
  text-align: center;
  padding: 2rem;
  animation: fadeIn 1s ease-in-out;
}

h1 {
  font-size: 2rem;
  margin-bottom: 20px;
  color: #333;
}

.calculator {
  background: white;
  padding: 2rem;
  border-radius: 15px;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.calculator:hover {
  transform: scale(1.03);
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.15);
}

input {
  padding: 10px;
  width: 80%;
  margin-bottom: 1rem;
  border: 2px solid #ccc;
  border-radius: 10px;
  font-size: 1rem;
}

input:focus {
  border-color: #0077cc;
  outline: none;
}

button {
  padding: 10px 20px;
  background-color: #0077cc;
  color: white;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.3s ease, transform 0.2s ease;
}

button:hover {
  background-color: #005fa3;
  transform: translateY(-2px);
}

.result-box {
  margin-top: 1.5rem;
  font-size: 1.2rem;
  color: #222;
  min-height: 24px;
}

/* Dark mode */
.theme-toggle {
  position: absolute;
  top: 20px;
  right: 20px;
  background: #333;
  color: #fff;
  border: none;
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
}

.theme-toggle:hover {
  background: #222;
}

body.dark {
  background: linear-gradient(to bottom right, #1e1e2f, #263447);
  color: #eee;
}

body.dark h1,
body.dark .result-box {
  color: #fff;
}

body.dark .calculator {
  background: #2e3a4b;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.05);
}

body.dark input {
  background: #444;
  color: #fff;
  border-color: #666;
}

body.dark button {
  background-color: #4a90e2;
}

body.dark button:hover {
  background-color: #357abd;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  } to {
    opacity: 1;
    transform: translateY(0);
  }
}

.zoom-in {
  animation: zoomIn 0.6s ease;
}

@keyframes zoomIn {
  from {
    transform: scale(0.8);
    opacity: 0;
  } to {
    transform: scale(1);
    opacity: 1;
  }
}
