:root {
  --primary-color: #0d6efd;
  --function-color: #6c5ce7;
  --bg-gradient: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  --card-bg: rgba(255, 255, 255, 0.9);
  --btn-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  --btn-hover-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}

body {
  background: var(--bg-gradient);
  min-height: 100vh;
  display: flex;
  align-items: center;
  font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  padding: 20px 0;
}

.calculator-card {
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 24px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: transform 0.3s ease;
}

.calculator-card:hover {
  transform: translateY(-5px);
}

.display-container {
  background: #1a1a2e;
  padding: 10px 18px 14px;
  border-radius: 16px;
  margin-bottom: 16px;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.3);
  min-height: 80px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.display-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.mode-indicator {
  font-size: 12px;
  font-weight: 700;
  color: #6c5ce7;
  letter-spacing: 1px;
  font-family: 'Courier New', monospace;
}

.shift-indicator {
  font-size: 12px;
  font-weight: 700;
  color: #e67e22;
  letter-spacing: 1px;
  font-family: 'Courier New', monospace;
}

#result {
  text-align: right;
  font-size: 32px;
  font-weight: 600;
  height: auto;
  border: none;
  background: transparent;
  padding: 0;
  color: #e0e0e0;
  box-shadow: none;
  width: 100%;
  font-family: 'Courier New', monospace;
  letter-spacing: 1px;
}

.btn-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.calculator .btn {
  height: 50px;
  border-radius: 12px;
  font-size: 18px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.18s ease;
  border: none;
  box-shadow: var(--btn-shadow);
  cursor: pointer;
  padding: 0 4px;
  line-height: 1.1;
}

.calculator .btn:hover  { transform: translateY(-2px); box-shadow: var(--btn-hover-shadow); }
.calculator .btn:active { transform: translateY(0); }

.btn-light    { background: #ffffff; color: #495057; }
.btn-light:hover { background: #f1f3f5; }

.btn-operator { background: #e7f1ff; color: var(--primary-color); }
.btn-operator:hover { background: #cfe2ff; }

.btn-action   { background: #fff5f5; color: #fa5252; font-size: 15px; }
.btn-action:hover { background: #ffe3e3; }

.btn-function { background: #f0efff; color: var(--function-color); }
.btn-function:hover { background: #e4e2ff; }

.btn-shift    { background: #fff3e0; color: #e67e22; font-size: 12px; font-weight: 700; letter-spacing: 0.5px; }
.btn-shift:hover { background: #ffe0b2; }
.btn-shift.active { background: #e67e22; color: #fff; }

.btn-equals   { background: var(--primary-color); color: white; font-size: 22px; }
.btn-equals:hover { background: #0b5ed7; color: white; }

.group-header {
  color: #495057;
  font-weight: 700;
  letter-spacing: 2px;
  margin-bottom: 20px;
  text-transform: uppercase;
  font-size: 1.2rem;
}
