:root {
  --primary: #4f46e5;
  --accent: #9333ea;
  --text-light: #333;
  --text-dark: #eee;
  --bg-light: #ffffffdd;
  --bg-dark: #1e1e1eaa;
}

body {
  margin: 0;
  font-family: "Segoe UI", sans-serif;
  background: linear-gradient(135deg, #2b2b52, #4f46e5, #9333ea, #ec4899);
  background-size: 400% 400%;
  animation: gradientBG 10s ease infinite;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}

@keyframes gradientBG {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.calculator-container {
  background: var(--bg-light);
  backdrop-filter: blur(15px);
  border-radius: 16px;
  padding: 30px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
  max-width: 400px;
  width: 90%;
  text-align: center;
  transition: background 0.3s ease;
}

body.dark-mode .calculator-container {
  background: var(--bg-dark);
  color: var(--text-dark);
}

.theme-toggle {
  text-align: right;
  margin-bottom: 10px;
}

.theme-toggle button {
  background: transparent;
  border: none;
  font-size: 1.5em;
  cursor: pointer;
  color: var(--primary);
}

h1 {
  color: var(--primary);
  margin-bottom: 20px;
}

input {
  width: 100%;
  padding: 12px;
  margin: 10px 0;
  border: none;
  border-radius: 10px;
  font-size: 1em;
  background: #f3f4f6;
  color: var(--text-light);
}

body.dark-mode input {
  background: #2e2e2e;
  color: var(--text-dark);
}

button {
  width: 100%;
  padding: 12px;
  font-size: 1.1em;
  margin-top: 10px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
}

button:hover {
  background: var(--accent);
  transform: scale(1.05);
}

#resultBox {
  margin-top: 20px;
  font-size: 1.2em;
  color: var(--primary);
}

body.dark-mode #resultBox {
  color: #ffd;
}
