:root {
  --bg-color: #f4f4f4;
  --calc-bg: #fff;
  --text-color: #000;
  --button-bg: #f0f0f0;
  --button-hover: #e0e0e0;
  --equal-bg: #007bff;
  --equal-hover: #0069d9;
}

body.dark {
  --bg-color: #1e1e1e;
  --calc-bg: #2a2a2a;
  --text-color: #fff;
  --button-bg: #3b3b3b;
  --button-hover: #4a4a4a;
  --equal-bg: #0d6efd;
  --equal-hover: #0b5ed7;
}

* {
  box-sizing: border-box;
  font-family: Arial, sans-serif;
}

body {
  background: var(--bg-color);
  color: var(--text-color);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100vh;
  transition: background 0.3s, color 0.3s;
}

.theme-toggle {
  position: absolute;
  top: 20px;
  right: 20px;
}

.theme-toggle button {
  background: var(--calc-bg);
  border: 1px solid #ccc;
  border-radius: 50%;
  font-size: 1.2rem;
  width: 40px;
  height: 40px;
  cursor: pointer;
  transition: background 0.2s;
}

.theme-toggle button:hover {
  background: var(--button-hover);
}

.calculator {
  background: var(--calc-bg);
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  transition: background 0.3s;
}

#display {
  width: 100%;
  height: 50px;
  margin-bottom: 10px;
  font-size: 1.2rem;
  text-align: right;
  padding: 0 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: var(--calc-bg);
  color: var(--text-color);
}

.buttons {
  display: grid;
  grid-template-columns: repeat(4, 60px);
  gap: 10px;
}

button {
  height: 50px;
  font-size: 1rem;
  border: none;
  border-radius: 6px;
  background: var(--button-bg);
  color: var(--text-color);
  cursor: pointer;
  transition: background 0.2s;
}

button:hover {
  background: var(--button-hover);
}

#equal {
  grid-column: span 2;
  background: var(--equal-bg);
  color: #fff;
}

#equal:hover {
  background: var(--equal-hover);
}
.history {
  margin-top: 20px;
  margin-bottom: 5%;
  width: 260px;
  background: var(--calc-bg);
  border-radius: 8px;
  padding: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  transition: background 0.3s;
}

.history h3 {
  margin: 0 0 8px 0;
  font-size: 1rem;
  text-align: center;
  color: var(--text-color);
}

#history-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-color);
}

#history-list li {
  border-top: 1px solid #ccc;
  padding: 4px 0;
  text-align: right;
}

body.dark #history-list li {
  border-top: 1px solid #444;
}

