/* Calculator specific styles */

.calculator {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  max-width: 400px;
  margin: 0 auto 24px;
}

.display {
  padding: 24px;
  background: var(--color-bg);
  text-align: right;
}

.history {
  font-size: 0.75rem;
  color: var(--color-text-secondary);
  min-height: 1.2em;
  margin-bottom: 4px;
}

.expression {
  font-size: 1rem;
  color: var(--color-text-secondary);
  min-height: 1.4em;
  margin-bottom: 8px;
  font-family: var(--font-mono);
}

.result {
  font-size: 2.5rem;
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--color-text);
  word-break: break-all;
}

.mode-tabs {
  display: flex;
  border-bottom: 1px solid var(--color-border);
}

.mode-btn {
  flex: 1;
  padding: 10px;
  border: none;
  background: var(--color-surface);
  color: var(--color-text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.mode-btn:hover {
  background: var(--color-bg);
}

.mode-btn.active {
  background: var(--color-accent);
  color: #fff;
}

.keypad {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1px;
  background: var(--color-border);
  padding: 1px;
}

.key {
  padding: 20px;
  border: none;
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 1.25rem;
  cursor: pointer;
  transition: background-color var(--transition);
}

.key:hover {
  background: var(--color-bg);
}

.key:active {
  background: #e5e7eb;
}

.key.num {
  font-weight: 500;
}

.key.op {
  background: #f3f4f6;
  color: var(--color-accent);
  font-weight: 600;
}

.key.op:hover {
  background: #e5e7eb;
}

.key.func {
  background: #f9fafb;
  color: var(--color-text-secondary);
  font-size: 0.9375rem;
}

.key.func:hover {
  background: #f3f4f6;
}

.key.eq {
  background: var(--color-accent);
  color: #fff;
  font-weight: 600;
}

.key.eq:hover {
  background: #1d4ed8;
}

.history-panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  max-width: 400px;
  margin: 0 auto;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border);
}

.panel-title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.btn-clear-history {
  padding: 4px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text-secondary);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-clear-history:hover {
  background: var(--color-bg);
  border-color: var(--color-accent);
}

.history-list {
  max-height: 200px;
  overflow-y: auto;
}

.history-item {
  display: flex;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  cursor: pointer;
}

.history-item:last-child {
  border-bottom: none;
}

.history-item:hover {
  background: var(--color-bg);
}

.history-item .expr {
  color: var(--color-text-secondary);
}

.history-item .res {
  font-weight: 600;
}

.history-list:empty::after {
  content: 'No history';
  display: block;
  padding: 24px 16px;
  text-align: center;
  color: var(--color-text-secondary);
  font-size: 0.875rem;
}
