/* ============================================================
   GRATUITY CALCULATOR STYLES
   Tradesala ToolSpot | Glassmorphism & Visual Formula Styling
   ============================================================ */

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

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

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

/* ── Result Visual Split (Chart & Formulas Side-by-Side) ── */
.results-visuals {
  display: grid;
  grid-template-columns: 1.1fr 1.3fr;
  gap: 24px;
  align-items: flex-start;
}

@media (max-width: 900px) {
  .results-visuals {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}

/* ── Doughnut Chart Visuals ── */
.chart-container-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 20px;
}

body.light .chart-container-wrap {
  background: rgba(0, 0, 0, 0.01);
  border-color: rgba(0, 0, 0, 0.04);
}

.chart-box {
  position: relative;
  width: 100%;
  height: 200px;
}

.chart-center-val {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: 'Outfit', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-1);
  text-align: center;
  pointer-events: none;
  width: 80%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chart-labels {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.chart-label-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-2);
}

.color-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── Formula Containers ── */
.formula-info-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 20px;
  height: 100%;
  display: flex;
  flex-direction: column;
}

body.light .formula-info-box {
  background: rgba(0, 0, 0, 0.01);
  border-color: rgba(0, 0, 0, 0.04);
}

.formula-info-box .panel-subtitle {
  font-family: 'Outfit', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 6px;
}

body.light .formula-info-box .panel-subtitle {
  border-color: rgba(0, 0, 0, 0.05);
}

.formula-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: formulaFade 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes formulaFade {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.formula-rule {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.4;
  margin: 0;
}

.formula-rule strong {
  color: var(--text-1);
  font-weight: 600;
}

.math-expr {
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--emerald, #10b981);
  background: rgba(16, 185, 129, 0.05);
  border: 1px solid rgba(16, 185, 129, 0.1);
  padding: 10px 14px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
}

body.light .math-expr {
  color: #047857;
  background: rgba(4, 120, 87, 0.04);
  border-color: rgba(4, 120, 87, 0.08);
}

.expr-lhs {
  font-weight: 700;
  white-space: nowrap;
}

.expr-frac {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  font-size: 0.95em;
  line-height: 1;
  vertical-align: middle;
  white-space: nowrap;
}

.expr-num, .expr-denom {
  white-space: nowrap;
}

.expr-denom {
  border-top: 1px solid currentColor;
  padding-top: 4px;
  margin-top: 4px;
  width: 100%;
  text-align: center;
}

.formula-footnote {
  font-size: 11px;
  color: var(--text-3);
  line-height: 1.4;
}

/* ── Switch Toggles ── */
.toggle-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  padding: 16px;
}

body.light .toggle-group {
  background: rgba(0, 0, 0, 0.005);
  border-color: rgba(0, 0, 0, 0.03);
}

.toggle-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.toggle-label {
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-1);
}

.toggle-desc {
  font-size: 11px;
  color: var(--text-3);
  line-height: 1.4;
}

.switch-toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

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

.switch-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.1);
  transition: .3s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

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

.switch-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: var(--text-2);
  transition: .3s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 50%;
}

body.light .switch-slider:before {
  background-color: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

input:checked + .switch-slider {
  background-color: var(--emerald, #10b981);
  border-color: rgba(16, 185, 129, 0.2);
}

body.light input:checked + .switch-slider {
  background-color: #059669;
}

input:checked + .switch-slider:before {
  transform: translateX(20px);
  background-color: white;
}

/* ── Gold Status Accent (For Taxable portion info if needed) ── */
.kpi-card.gold {
  border: 1px solid rgba(245, 158, 11, 0.15);
  background: radial-gradient(120% 120% at 50% 10%, rgba(245, 158, 11, 0.04) 0%, rgba(0, 0, 0, 0) 100%), rgba(255, 255, 255, 0.01);
}

body.light .kpi-card.gold {
  border-color: rgba(217, 119, 6, 0.15);
  background: radial-gradient(120% 120% at 50% 10%, rgba(217, 119, 6, 0.03) 0%, rgba(0, 0, 0, 0) 100%), rgba(255, 255, 255, 0.4);
}

.kpi-card.gold .kpi-val {
  color: var(--gold, #f59e0b);
}

body.light .kpi-card.gold .kpi-val {
  color: #d97706;
}

/* ── Status Card details ── */
.status-card {
  padding: 14px 18px;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.status-card.warning {
  border-color: rgba(239, 68, 68, 0.15) !important;
  background: rgba(239, 68, 68, 0.02) !important;
}

body.light .status-card.warning {
  border-color: rgba(220, 38, 38, 0.15) !important;
  background: rgba(220, 38, 38, 0.02) !important;
}

.status-card.success {
  border-color: rgba(16, 185, 129, 0.15) !important;
  background: rgba(16, 185, 129, 0.02) !important;
}

body.light .status-card.success {
  border-color: rgba(5, 150, 105, 0.12) !important;
  background: rgba(5, 150, 105, 0.02) !important;
}

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

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

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

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

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

/* ── Premium Select ── */
.premium-select {
  width: 100%;
  appearance: none;
  background-color: rgba(255, 255, 255, 0.05);
  background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%239CA3AF%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
  background-repeat: no-repeat;
  background-position: right 12px top 50%;
  background-size: 10px auto;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-2);
  padding: 10px 32px 10px 12px;
  border-radius: 10px;
  font-family: 'Figtree', sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  outline: none;
  cursor: pointer;
  transition: all 0.3s;
  margin-top: 8px;
}
.premium-select:focus {
  border-color: rgba(255, 255, 255, 0.3);
  background-color: rgba(255, 255, 255, 0.08);
}
body.light .premium-select {
  background-color: #f9fafb;
  border-color: #d1d5db;
  color: #374151;
  background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%234B5563%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
}
body.light .premium-select:focus {
  border-color: #9ca3af;
  background-color: #ffffff;
}
.premium-select option {
  background: #1f2937;
  color: #fff;
}
body.light .premium-select option {
  background: #fff;
  color: #374151;
}

/* ── Future Milestones Projections ── */
.section-subtitle {
  font-family: 'Outfit', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 4px;
  display: flex;
  flex-direction: column;
}
.subtitle-desc {
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--text-3);
  margin-top: 2px;
}
.comparison-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.02);
}
body.light .comparison-table-wrap {
  border-color: rgba(0, 0, 0, 0.08);
  background: rgba(0, 0, 0, 0.01);
}
.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.compare-table th, .compare-table td {
  padding: 12px 16px;
  text-align: right;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
body.light .compare-table th, body.light .compare-table td {
  border-bottom-color: rgba(0, 0, 0, 0.06);
}
.compare-table th:first-child, .compare-table td:first-child {
  text-align: left;
  font-weight: 600;
  color: var(--text-2);
}
body.light .compare-table th:first-child, body.light .compare-table td:first-child {
  color: #4b5563;
}
.compare-table th {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding-bottom: 14px;
  color: var(--text-3);
  font-weight: 700;
}
.compare-table tbody tr:last-child td {
  border-bottom: none;
}
.compare-table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}
body.light .compare-table tbody tr:hover td {
  background: rgba(0, 0, 0, 0.02);
}
.compare-table td:nth-child(2) {
  font-weight: 700;
  color: var(--text-1);
}
.compare-table td:nth-child(3) {
  color: var(--gratuity-c1, #10b981);
}
.compare-table td:nth-child(4) {
  color: var(--gratuity-c2, #f59e0b);
}
