/* Calculator styles: credit-card-payoff */

/* ====================================
   Credit Card Payoff - Debt Destruction Command Center
   Two-step "Attack Plan + Freedom Timeline" design
   ==================================== */

/* Dashboard-specific layout */
.vareoncalc-ccpayoff-dashboard {
  width: 100%;
}

.ccpayoff-section {
  gap: 12px;
}

.ccpayoff-section .ccpayoff-strategy-switch {
  margin-bottom: 0;
}

/* Wider card for CC payoff dashboard */
.vareoncalc-card:has(.vareoncalc-ccpayoff-dashboard) {
  max-width: 800px;
}

/* Strategy Switch Toggle */
.ccpayoff-strategy-switch {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.strategy-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 7px 10px;
  background: transparent;
  border: 1px solid var(--sc-card-border, #e5e7eb);
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: var(--sc-muted-text, #6b7280);
  transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}

.strategy-btn:hover {
  border-color: var(--sc-text, #374151);
  background: var(--sc-input-bg, #f3f4f6);
  color: var(--sc-text, #374151);
}

.strategy-btn--active {
  border-color: var(--sc-accent, #3b82f6);
  background: rgba(59, 130, 246, 0.08);
  color: var(--sc-accent, #3b82f6);
}

.strategy-icon {
  display: none;
}

.strategy-label {
  font-weight: 600;
  white-space: nowrap;
}

#payment-field label {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
}

.ccpayoff-payment-min {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  font-weight: 500;
  color: var(--sc-muted-text, #6b7280);
}

/* Result Panel */
.vareoncalc-ccpayoff-result {
  display: flex;
  flex-direction: column;
  background: var(--sc-input-bg, #f9fafb);
  border: 1px solid var(--sc-card-border, #e5e7eb);
  border-radius: 12px;
  overflow: hidden;
  min-height: 380px;
}

/* Placeholder state */
.ccpayoff-result__placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  flex: 1;
  padding: var(--sc-card-padding);
  color: var(--sc-muted-text, #6b7280);
}

.ccpayoff-result__placeholder .placeholder-icon {
  font-size: 52px;
  opacity: 0.4;
  margin-bottom: 12px;
}

.ccpayoff-result__placeholder .placeholder-text {
  font-size: 14px;
  opacity: 0.7;
  max-width: 200px;
}

/* Results content container */
.ccpayoff-result__content {
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* Error state */
.ccpayoff-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  flex: 1;
  padding: var(--sc-card-padding);
  color: #dc2626;
}

.ccpayoff-error .error-icon {
  font-size: 40px;
  margin-bottom: 12px;
}

.ccpayoff-error .error-text {
  font-size: 14px;
  line-height: 1.5;
  max-width: 260px;
}

/* ---- Hero: two-column layout ---- */
.ccpayoff-hero {
  display: flex;
  gap: 1px;
  background: var(--sc-card-border, #e5e7eb);
  border-bottom: 1px solid var(--sc-card-border, #e5e7eb);
}

.ccpayoff-hero__breakdown,
.ccpayoff-hero__timeline {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 12px;
  background: var(--sc-card-bg, #ffffff);
}

.ccpayoff-hero__title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--sc-muted-text, #6b7280);
  margin-bottom: 12px;
  text-align: center;
}

/* ---- SVG Donut ---- */
.ccpayoff-donut {
  width: 130px;
  height: 130px;
  margin: 0 auto;
}

.ccpayoff-donut__svg {
  width: 100%;
  height: 100%;
}

.ccpayoff-donut__track {
  stroke: var(--sc-card-border, #e5e7eb);
}

.ccpayoff-donut__segment {
  transition: stroke-dasharray 0.5s ease-out, stroke-dashoffset 0.5s ease-out;
}

.ccpayoff-donut__segment--principal {
  stroke: #3b82f6;
}

.ccpayoff-donut__segment--interest {
  stroke: #ef4444;
}

.ccpayoff-donut__label {
  font-size: 10px;
  fill: var(--sc-muted-text, #6b7280);
  font-weight: 600;
}

.ccpayoff-donut__value {
  font-size: 12px;
  font-weight: 800;
  fill: var(--sc-text, #1f2937);
}

/* Donut legend */
.ccpayoff-donut__legend {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.ccpayoff-donut__legend .legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
}

.ccpayoff-donut__legend .legend-color {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}

.ccpayoff-donut__legend .legend-item--principal .legend-color {
  background: #3b82f6;
}

.ccpayoff-donut__legend .legend-item--interest .legend-color {
  background: #ef4444;
}

.ccpayoff-donut__legend .legend-label {
  color: var(--sc-muted-text, #6b7280);
  font-weight: 600;
}

.ccpayoff-donut__legend .legend-amount {
  font-weight: 700;
  color: var(--sc-text, #1f2937);
  white-space: nowrap;
}

/* ---- Timeline column ---- */
.ccpayoff-hero__timeline {
  justify-content: center;
  text-align: center;
}

.ccpayoff-months {
  font-size: 32px;
  font-weight: 800;
  line-height: 1.15;
  color: var(--sc-text, #1f2937);
  font-variant-numeric: tabular-nums;
}

.ccpayoff-date {
  font-size: 13px;
  color: var(--sc-muted-text, #6b7280);
  margin-top: 6px;
}

.ccpayoff-date strong {
  color: var(--sc-text, #1f2937);
  font-weight: 700;
}

/* Long payoff warning */
.ccpayoff-warning {
  margin: 12px 16px 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #92400e;
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
}

/* ---- Summary Stats ---- */
.ccpayoff-summary {
  display: flex;
  gap: 10px;
  margin: 14px 16px;
}

.ccpayoff-stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 10px;
  border-radius: 10px;
  background: var(--sc-card-bg, #ffffff);
  border: 1px solid var(--sc-card-border, #e5e7eb);
}

.ccpayoff-stat .stat-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--sc-muted-text, #6b7280);
  margin-bottom: 4px;
}

.ccpayoff-stat .stat-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--sc-text, #1f2937);
  white-space: nowrap;
}

/* ---- Payment Schedule ---- */
.ccpayoff-schedule {
  margin: 0 16px 18px;
}

.ccpayoff-schedule-header {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 10px 12px;
  margin: 0;
  border: 1px solid var(--sc-card-border, #e5e7eb);
  border-radius: 8px;
  background: var(--sc-card-bg, #ffffff);
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  color: var(--sc-text, #1f2937);
}

.ccpayoff-schedule-header:hover {
  background: var(--sc-input-bg, #f9fafb);
}

.ccpayoff-schedule-chevron {
  flex-shrink: 0;
  color: var(--sc-muted-text, #6b7280);
  transition: transform 0.2s ease;
}

.ccpayoff-schedule-header[aria-expanded="true"] .ccpayoff-schedule-chevron {
  transform: rotate(180deg);
}

.ccpayoff-schedule-label {
  font-size: 12px;
  font-weight: 700;
}

.ccpayoff-schedule-body {
  margin-top: 8px;
}

.ccpayoff-schedule-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.ccpayoff-schedule-per-page {
  font-size: 11px;
  font-weight: 600;
  color: var(--sc-muted-text, #6b7280);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ccpayoff-schedule-pagination {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.ccpayoff-schedule-page-info {
  font-size: 12px;
  font-weight: 600;
  color: var(--sc-text, #1f2937);
  min-width: 82px;
  text-align: center;
}

.ccpayoff-schedule-page-btn {
  border: 1px solid var(--sc-card-border, #e5e7eb);
  background: var(--sc-card-bg, #ffffff);
  color: var(--sc-text, #1f2937);
  font-size: 12px;
  font-weight: 600;
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
}

.ccpayoff-schedule-page-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.ccpayoff-schedule-table {
  border: 1px solid var(--sc-card-border, #e5e7eb);
  border-radius: 8px;
  overflow: auto;
  background: var(--sc-card-bg, #ffffff);
}

.ccpayoff-schedule-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.ccpayoff-schedule-table th {
  text-align: left;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 8px 10px;
  color: var(--sc-muted-text, #6b7280);
  background: var(--sc-input-bg, #f9fafb);
}

.ccpayoff-schedule-table td {
  padding: 8px 10px;
  border-top: 1px solid var(--sc-card-border, #e5e7eb);
  font-variant-numeric: tabular-nums;
}

.ccpayoff-schedule-table td:first-child,
.ccpayoff-schedule-table th:first-child {
  text-align: left;
}

.ccpayoff-schedule-table td:not(:first-child),
.ccpayoff-schedule-table th:not(:first-child) {
  text-align: right;
}

/* ---- Dark Theme ---- */
.vareoncalc-root[data-theme="dark"] .strategy-btn,
.vareoncalc-root.theme-dark .strategy-btn {
  border-color: var(--sc-card-border, #374151);
  color: var(--sc-muted-text, #9ca3af);
}

.vareoncalc-root[data-theme="dark"] .strategy-btn:hover,
.vareoncalc-root.theme-dark .strategy-btn:hover {
  background: var(--sc-input-bg, #374151);
  border-color: var(--sc-text, #e5e7eb);
  color: var(--sc-text, #e5e7eb);
}

.vareoncalc-root[data-theme="dark"] .strategy-btn--active,
.vareoncalc-root.theme-dark .strategy-btn--active {
  background: rgba(59, 130, 246, 0.2);
  border-color: var(--sc-accent, #60a5fa);
  color: var(--sc-accent, #60a5fa);
}

.vareoncalc-root[data-theme="dark"] .vareoncalc-ccpayoff-result,
.vareoncalc-root.theme-dark .vareoncalc-ccpayoff-result {
  background: var(--sc-input-bg, #1f2937);
}

.vareoncalc-root[data-theme="dark"] .ccpayoff-hero__breakdown,
.vareoncalc-root[data-theme="dark"] .ccpayoff-hero__timeline,
.vareoncalc-root.theme-dark .ccpayoff-hero__breakdown,
.vareoncalc-root.theme-dark .ccpayoff-hero__timeline {
  background: var(--sc-card-bg, #111827);
}

.vareoncalc-root[data-theme="dark"] .ccpayoff-hero,
.vareoncalc-root.theme-dark .ccpayoff-hero {
  background: var(--sc-card-border, #374151);
}

.vareoncalc-root[data-theme="dark"] .ccpayoff-donut__track,
.vareoncalc-root.theme-dark .ccpayoff-donut__track {
  stroke: var(--sc-card-border, #374151);
}

.vareoncalc-root[data-theme="dark"] .ccpayoff-donut__value,
.vareoncalc-root.theme-dark .ccpayoff-donut__value {
  fill: var(--sc-text, #e5e7eb);
}

.vareoncalc-root[data-theme="dark"] .ccpayoff-warning,
.vareoncalc-root.theme-dark .ccpayoff-warning {
  background: rgba(245, 158, 11, 0.18);
  border-color: rgba(245, 158, 11, 0.4);
  color: #fbbf24;
}

.vareoncalc-root[data-theme="dark"] .ccpayoff-schedule-header,
.vareoncalc-root.theme-dark .ccpayoff-schedule-header {
  background: var(--sc-card-bg, #111827);
  border-color: var(--sc-card-border, #374151);
  color: var(--sc-text, #e5e7eb);
}

.vareoncalc-root[data-theme="dark"] .ccpayoff-schedule-header:hover,
.vareoncalc-root.theme-dark .ccpayoff-schedule-header:hover {
  background: var(--sc-input-bg, #1f2937);
}

.vareoncalc-root[data-theme="dark"] .ccpayoff-schedule-page-btn,
.vareoncalc-root.theme-dark .ccpayoff-schedule-page-btn {
  background: var(--sc-card-bg, #111827);
  border-color: var(--sc-card-border, #374151);
  color: var(--sc-text, #e5e7eb);
}

.vareoncalc-root[data-theme="dark"] .ccpayoff-schedule-table,
.vareoncalc-root.theme-dark .ccpayoff-schedule-table {
  background: var(--sc-card-bg, #111827);
  border-color: var(--sc-card-border, #374151);
}

.vareoncalc-root[data-theme="dark"] .ccpayoff-schedule-table th,
.vareoncalc-root.theme-dark .ccpayoff-schedule-table th {
  background: var(--sc-input-bg, #1f2937);
}

/* ---- Responsive ---- */
@media (max-width: 720px) {
  .vareoncalc-ccpayoff-result {
    min-height: auto;
  }
}

@media (max-width: 480px) {
  .ccpayoff-hero {
    flex-direction: column;
  }

  .ccpayoff-months {
    font-size: 26px;
  }

  .ccpayoff-stat .stat-value {
    font-size: 17px;
  }

  .ccpayoff-summary {
    gap: 8px;
  }
}

@media (max-width: 410px) {
  .ccpayoff-strategy-switch {
    flex-direction: column;
  }

  .strategy-btn {
    width: 100%;
  }

  .ccpayoff-summary {
    margin: 12px var(--sc-card-padding);
  }

  .ccpayoff-schedule {
    margin-left: var(--sc-card-padding);
    margin-right: var(--sc-card-padding);
  }

  .ccpayoff-stat .stat-value {
    font-size: 15px;
  }

  .ccpayoff-stat .stat-label {
    font-size: 10px;
  }

  .ccpayoff-donut {
    width: 110px;
    height: 110px;
  }
}

@media (max-width: 360px) {
  .ccpayoff-months {
    font-size: 22px;
  }

  .ccpayoff-stat .stat-value {
    font-size: 14px;
  }

  .ccpayoff-summary {
    flex-direction: column;
  }
}

@container vareoncalc (max-width: 720px) {
  .vareoncalc-ccpayoff-result {
    min-height: auto;
  }
}

@container vareoncalc (max-width: 480px) {
  .ccpayoff-hero {
    flex-direction: column;
  }

  .ccpayoff-months {
    font-size: 26px;
  }

  .ccpayoff-stat .stat-value {
    font-size: 17px;
  }

  .ccpayoff-summary {
    gap: 8px;
  }
}

@container vareoncalc (max-width: 410px) {
  .ccpayoff-strategy-switch {
    flex-direction: column;
  }

  .strategy-btn {
    width: 100%;
  }

  .ccpayoff-summary {
    margin: 12px var(--sc-card-padding);
  }

  .ccpayoff-schedule {
    margin-left: var(--sc-card-padding);
    margin-right: var(--sc-card-padding);
  }

  .ccpayoff-stat .stat-value {
    font-size: 15px;
  }

  .ccpayoff-stat .stat-label {
    font-size: 10px;
  }

  .ccpayoff-donut {
    width: 110px;
    height: 110px;
  }
}

@container vareoncalc (max-width: 360px) {
  .ccpayoff-months {
    font-size: 22px;
  }

  .ccpayoff-stat .stat-value {
    font-size: 14px;
  }

  .ccpayoff-summary {
    flex-direction: column;
  }
}
