/* style.css for SimpleCalc */

/* Root & Theme Variables */
:root {
  --bg-page: #f0f2f5;
  --bg-calc: #ffffff;
  --bg-toggle: #e6e6e6;
  --bg-btn: #e6e6e6;
  --bg-btn-hover: #d0d0d0;
  --bg-equals: #4caf50;
  --color-text: #333;
  --color-title: #333;
  --color-btn-text: #333;
  --color-equals-text: #fff;
  --bg-history: #fafafa;
}

/* Dark Mode Overrides */
body.dark {
  --bg-page: #1e1e1e;
  --bg-calc: #2a2a2a;
  --bg-toggle: #333;
  --bg-btn: #333;
  --bg-btn-hover: #555;
  --bg-history: #2a2a2a;
  --color-text: #f0f0f0;
  --color-title: #f0f0f0;
}

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

body {
  background: var(--bg-page);
  color: var(--color-text);
  font-family: 'Inter', sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  transition: background 0.3s ease, color 0.3s ease;
}

/* Calculator Wrapper */
.calculator-wrapper {
  background: var(--bg-calc);
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  max-width: 360px;
  width: 100%;
}

.title {
  text-align: center;
  font-size: 1.8rem;
  color: var(--color-title);
  margin-bottom: 8px;
}

/* Toggle Controls */
.toggle-controls {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}

.toggle-controls button {
  background: var(--bg-toggle);
  border: none;
  border-radius: 6px;
  padding: 6px 10px;
  margin: 0 4px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s ease;
}

.toggle-controls button:hover {
  background: var(--bg-btn-hover);
}

/* Layout */
.calc-layout {
  display: flex;
}

.main-calc {
  flex: 2;
}

.history {
  flex: 1;
  background: var(--bg-history);
  margin-left: 12px;
  padding: 10px;
  border-radius: 8px;
  font-size: 0.85rem;
  max-height: 300px;
  overflow-y: auto;
}

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

/* Buttons Grid */
.button-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.calc-btn {
  background: var(--bg-btn);
  border: none;
  border-radius: 6px;
  padding: 14px 0;
  font-size: 1.1rem;
  color: var(--color-btn-text);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
}

.calc-btn:hover {
  background: var(--bg-btn-hover);
  transform: scale(1.02);
}

.calc-btn:active {
  transform: scale(0.98);
}

.equals-button {
  background: var(--bg-equals);
  color: var(--color-equals-text);
  font-size: 1rem;
}

/* Scientific Mode Hidden by Default */
.sci-only {
  display: none;
}

.scientific .sci-only {
  display: inline-block;
}

/* Responsive */
@media (max-width: 480px) {
  .calculator-wrapper {
    padding: 16px;
    max-width: 95vw;
  }
  .button-grid {
    gap: 6px;
  }
  .calc-btn {
    padding: 10px 0;
    font-size: 1rem;
  }
}
