* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-primary: #111827;
  --bg-secondary: #1f2937;
  --bg-tertiary: #374151;
  --border-color: #4b5563;
  --text-primary: #fff;
  --text-secondary: #e5e7eb;
  --text-tertiary: #d1d5db;
  --accent-color: #60a5fa;
  --shadow: rgba(0, 0, 0, 0.5);
}

@media (prefers-color-scheme: light) {
  :root {
    --bg-primary: #f3f4f6;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f9fafb;
    --border-color: #e5e7eb;
    --text-primary: #111827;
    --text-secondary: #374151;
    --text-tertiary: #4b5563;
    --accent-color: #2563eb;
    --shadow: rgba(0, 0, 0, 0.1);
  }
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
  width: 100%;
  max-width: 48rem;
}

.card {
  background-color: var(--bg-secondary);
  border-radius: 0.5rem;
  box-shadow: 0 25px 50px -12px var(--shadow);
  padding: 2rem;
  transition: background-color 0.3s ease;
}

h1 {
  font-size: 1.875rem;
  font-weight: bold;
  text-align: center;
  margin-bottom: 2rem;
}

h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-icon {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
}

.section {
  margin-bottom: 2rem;
}

.input-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.input-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-tertiary);
  margin-bottom: 0.5rem;
}

input[type="number"] {
  width: 100%;
  padding: 0.5rem 1rem;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  color: var(--text-primary);
  font-size: 1rem;
  transition: all 0.3s ease;
}

input[type="number"]:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
}

button {
  flex: 1;
  min-width: 50px;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-icon {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
}

button:active {
  transform: translateY(0);
}

.btn-add {
  background-color: #16a34a;
}

.btn-add:hover {
  background-color: #15803d;
}

.btn-subtract {
  background-color: #dc2626;
}

.btn-subtract:hover {
  background-color: #b91c1c;
}

.btn-work {
  background-color: #2563eb;
}

.btn-work:hover {
  background-color: #1d4ed8;
}

.btn-current {
  background-color: #7c3aed;
}

.btn-current:hover {
  background-color: #6d28d9;
}

.result {
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  padding: 1.5rem;
  transition: all 0.3s ease;
}

.result-value {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--accent-color);
}

@media (max-width: 768px) {
  .input-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  button {
    min-width: 100%;
  }

  h1 {
    font-size: 1.5rem;
  }
}

