:root {
  --bg: #f4f6f8;
  --text: #333;
  --card-bg: #fff;
  --btn-bg: linear-gradient(to right, #4facfe, #00f2fe);
  --btn-hover: linear-gradient(to right, #00f2fe, #4facfe);
  --success: #2a9d8f;
  --error: #e63946;
}

body.dark {
  --bg: #121212;
  --text: #f0f0f0;
  --card-bg: #1e1e1e;
  --btn-bg: linear-gradient(to right, #333, #555);
  --btn-hover: linear-gradient(to right, #444, #222);
  --success: #81c784;
  --error: #ef5350;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", sans-serif;
  margin: 0;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.calculator-card {
  background: var(--card-bg);
  padding: 30px;
  border-radius: 14px;
  width: 100%;
  max-width: 480px;
  text-align: center;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

input,
select,
button {
  width: 100%;
  padding: 12px;
  margin-top: 10px;
  font-size: 16px;
  box-sizing: border-box;
  border-radius: 8px;
  border: 1px solid #ccc;
}

button {
  background: var(--btn-bg);
  color: white;
  font-weight: bold;
  border: none;
  cursor: pointer;
}

button:hover {
  background: var(--btn-hover);
}

.theme-toggle {
  background: transparent;
  border: none;
  font-size: 20px;
  cursor: pointer;
}

.result {
  margin-top: 20px;
  font-size: 18px;
  font-weight: bold;
  color: var(--success);
  min-height: 24px;
}

ul#historyList {
  list-style: none;
  padding-left: 0;
  margin-top: 10px;
  text-align: left;
}

ul#historyList li {
  background: #eee;
  padding: 8px;
  border-radius: 6px;
  margin-bottom: 5px;
  color: #333;
}

body.dark ul#historyList li {
  background: #2b2b2b;
  color: #ccc;
}
