/* ============================================================
   NPS / EPS CALCULATOR STYLES
   Tradesala ToolSpot | Emerald Green Theme
   ============================================================ */

.container {
  /* Dark mode: emerald green */
  --tool-red: #10b981;
  --tool-red-soft: rgba(16, 185, 129, 0.12);
  --ret-c1: #10b981;
  --ret-c2: #047857;
}

body.light .container {
  /* Light mode: deep mint/emerald */
  --tool-red: #059669;
  --tool-red-soft: rgba(5, 150, 105, 0.12);
  --ret-c1: #059669;
  --ret-c2: #064e3b;
}

/* ── Glow Lines ── */
.kpi-card.emerald::before {
  background: linear-gradient(90deg, #10b981, #6ee7b7) !important;
}

.kpi-card.emerald-deep::before {
  background: linear-gradient(90deg, #047857, #10b981) !important;
}

/* ── KPI Spanning Utility ── */
.kpi-span-full {
  grid-column: 1 / -1;
}

/* ── Mode Toggle ── */
.mode-toggle {
  background: rgba(255, 255, 255, 0.04);
  padding: 4px;
  border-radius: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-bottom: 28px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.mode-btn {
  background: transparent;
  border: none;
  padding: 8px;
  color: var(--text-3);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.mode-btn.active {
  background: var(--tool-red);
  color: #fff;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

body.light .mode-toggle {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.06);
}

body.light .mode-btn { color: #666; }
body.light .mode-btn.active { color: #fff; }

/* ── Toggle Switch ── */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.switch input { opacity: 0; width: 0; height: 0; }

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: rgba(255, 255, 255, 0.1);
  transition: .4s;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
}

input:checked + .slider { background-color: var(--tool-red); }
input:checked + .slider:before { transform: translateX(20px); }
.slider.round { border-radius: 34px; }
.slider.round:before { border-radius: 50%; }

body.light .slider {
  background: rgba(0, 0, 0, 0.1);
  border-color: rgba(0, 0, 0, 0.1);
}

/* ── Hide/Show Tab Panels ── */
.calculator-inputs,
.calculator-results {
  display: none;
  opacity: 0;
  transform: translateY(12px) scale(0.99);
}

.calculator-inputs.active,
.calculator-results.active {
  display: block;
  animation: slideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.calculator-inputs.fade-out,
.calculator-results.fade-out {
  display: block;
  animation: slideOut 0.15s ease-in forwards;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes slideOut {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(-8px) scale(0.99);
  }
}

/* ── EPS Formula Detail ── */
.formula-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 20px;
  padding: 24px;
  margin-top: 16px;
}

body.light .formula-box {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.06);
}

.math-expr {
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: 'Outfit', sans-serif;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--tool-red);
  margin: 20px 0;
  gap: 10px;
}

.expr-frac {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  font-size: 1.05rem;
}

.expr-denom {
  border-top: 2px solid var(--tool-red);
  width: 100%;
  text-align: center;
  padding-top: 4px;
  margin-top: 4px;
}

.formula-notes {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 16px;
  padding-left: 20px;
  line-height: 1.7;
}

.formula-notes li {
  margin-bottom: 10px;
}

.formula-notes strong {
  color: var(--text-2);
}

body.light .formula-notes strong {
  color: #334155;
}

/* ── EPS Status Message ── */
.status-card {
  background: rgba(255, 255, 255, 0.01) !important;
  border: 1px dashed rgba(255, 255, 255, 0.15) !important;
  padding: 16px 20px !important;
}

body.light .status-card {
  background: rgba(0, 0, 0, 0.01) !important;
  border-color: rgba(0, 0, 0, 0.15) !important;
}

.status-msg {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  line-height: 1.5;
}

body.light .status-msg {
  color: #334155;
}

.status-title {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-3);
  margin-right: 8px;
  display: inline-block;
}

body.light .status-title {
  color: #64748b;
}

.status-msg.success {
  color: #34d399;
}

body.light .status-msg.success {
  color: #059669;
}

.status-msg.warning {
  color: #fbbf24;
}

body.light .status-msg.warning {
  color: #d97706;
}

/* ── Inflation Adjusted Sub-Value ── */
.kpi-real-val {
  font-size: 11px;
  font-weight: 700;
  color: #34d399;
  background: rgba(52, 211, 153, 0.1);
  padding: 3px 8px;
  border-radius: 6px;
  display: inline-block;
  margin-bottom: 8px;
}

body.light .kpi-real-val {
  color: #059669;
  background: rgba(5, 150, 105, 0.08);
}

/* Responsive adjustments */
@media (max-width: 640px) {
  .mode-toggle {
    margin-bottom: 20px;
  }
  .kpi-span-full {
    grid-column: span 1 !important;
  }
}
