/* APR Calculator Specific Styles */

/* Helper Text */
.helper-text {
  color: #6b7280;
  font-size: 0.875rem;
  margin-top: 0.5rem;
  line-height: 1.5;
}

/* Fee Section */
.fee-section {
  margin-top: 2rem;
  padding: 1.5rem;
  background: #f9fafb;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
}

.fee-section h4 {
  margin: 0 0 1rem 0;
  font-size: 1.125rem;
  color: #1f2937;
}

.fee-input-group {
  margin-bottom: 1.5rem;
}

.fee-input-group label {
  display: block;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.5rem;
}

.fee-inputs {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.fee-inputs input[type="text"],
.fee-inputs input[type="number"] {
  flex: 1;
  padding: 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 1rem;
}

.fee-divider {
  color: #9ca3af;
  font-weight: 600;
  font-size: 0.875rem;
}

.percent-input {
  position: relative;
  flex: 1;
}

.percent-input input {
  width: 100%;
  padding-right: 2rem;
}

.percent-input span {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: #6b7280;
  font-weight: 600;
  pointer-events: none;
}

/* Comparison Toggle */
.comparison-toggle {
  margin: 2rem 0;
  padding: 1rem;
  background: #eff6ff;
  border-radius: 8px;
  border: 1px solid #bfdbfe;
}

.toggle-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  font-weight: 600;
  color: #1e40af;
}

.toggle-label input[type="checkbox"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
}

/* APR Results */
.apr-card {
  background: white;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  padding: 2rem;
  margin-bottom: 2rem;
}

.apr-card.winner {
  border-color: #10b981;
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15);
}

.apr-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid #e5e7eb;
}

.apr-header h3 {
  margin: 0;
  font-size: 1.5rem;
  color: #1f2937;
}

.winner-badge {
  background: #10b981;
  color: white;
  padding: 0.375rem 0.75rem;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 700;
}

.apr-value-large {
  text-align: center;
  margin: 1.5rem 0;
}

.apr-value-large .label {
  font-size: 0.875rem;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.apr-value-large .value {
  font-size: 3rem;
  font-weight: 700;
  color: #1f2937;
  line-height: 1;
}

.apr-comparison-inline {
  background: #f9fafb;
  padding: 1rem;
  border-radius: 8px;
  margin: 1.5rem 0;
}

.comparison-row {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
}

.comparison-row.highlight {
  font-weight: 700;
  color: #dc2626;
  border-top: 1px solid #e5e7eb;
  margin-top: 0.5rem;
  padding-top: 1rem;
}

.apr-details {
  margin-top: 1.5rem;
}

.detail-item {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid #f3f4f6;
}

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

.detail-label {
  color: #6b7280;
  font-size: 0.9375rem;
}

.detail-value {
  font-weight: 700;
  color: #1f2937;
  font-size: 1rem;
}

.fee-breakdown {
  margin-top: 1.5rem;
  padding: 1rem;
  background: #fef3c7;
  border-radius: 8px;
  border: 1px solid #fbbf24;
}

.fee-breakdown h4 {
  margin: 0 0 0.75rem 0;
  font-size: 0.875rem;
  color: #92400e;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.fee-row {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  font-size: 0.875rem;
}

/* Comparison Grid */
.comparison-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

@media (max-width: 768px) {
  .comparison-grid {
    grid-template-columns: 1fr;
  }
}

/* Comparison Insight */
.comparison-insight {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border-color: #10b981;
}

/* Detail Box for APR vs Rate */
.detail-box {
  margin-top: 1.5rem;
}

.comparison-table {
  background: white;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
}

.table-row {
  display: grid;
  grid-template-columns: 200px 100px 1fr;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #f3f4f6;
}

.table-row:last-child {
  border-bottom: none;
}

.table-row.highlight {
  background: #fef3c7;
  font-weight: 700;
}

.table-cell.label {
  font-weight: 600;
  color: #374151;
}

.table-cell.value {
  font-weight: 700;
  color: #1f2937;
  text-align: right;
}

.table-cell.explanation {
  color: #6b7280;
  font-size: 0.875rem;
}

@media (max-width: 640px) {
  .table-row {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }

  .table-cell.value {
    text-align: left;
  }
}

/* True Cost Breakdown */
.cost-breakdown-card {
  background: white;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  padding: 2rem;
}

.cost-summary {
  text-align: center;
  margin-bottom: 2rem;
}

.cost-item-large .cost-label {
  font-size: 0.875rem;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.cost-item-large .cost-value {
  font-size: 2.5rem;
  font-weight: 700;
  color: #dc2626;
  line-height: 1;
}

.cost-details {
  margin: 2rem 0;
}

.cost-row {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid #f3f4f6;
}

.cost-row:last-child {
  border-bottom: none;
}

.cost-row.total {
  border-top: 2px solid #1f2937;
  margin-top: 0.5rem;
  padding-top: 1rem;
  font-weight: 700;
  font-size: 1.125rem;
}

.cost-row .cost-label {
  color: #6b7280;
}

.cost-row .cost-value {
  font-weight: 700;
  color: #1f2937;
}

.cost-row.total .cost-label,
.cost-row.total .cost-value {
  color: #1f2937;
}

/* Cost Visual Bar */
.cost-visual {
  margin: 2rem 0;
}

.cost-bar {
  display: flex;
  height: 60px;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 1rem;
}

.cost-segment {
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 0.875rem;
  transition: all 0.3s ease;
}

.cost-segment:hover {
  opacity: 0.9;
}

.cost-segment.principal {
  background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
}

.cost-segment.interest {
  background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
}

.cost-segment.fees {
  background: linear-gradient(135deg, #ef4444 0%, #f87171 100%);
}

.cost-legend {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.legend-color {
  width: 20px;
  height: 20px;
  border-radius: 4px;
}

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

.legend-color.interest {
  background: #f59e0b;
}

.legend-color.fees {
  background: #ef4444;
}

.cost-insight {
  margin-top: 1.5rem;
  padding: 1rem;
  background: #eff6ff;
  border-left: 4px solid #3b82f6;
  border-radius: 4px;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: #1e40af;
}

/* No-icon insight card */
.insight-card.no-icon {
  display: block;
}

.insight-card.no-icon .insight-content {
  width: 100%;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .fee-inputs {
    flex-direction: column;
  }

  .fee-divider {
    display: none;
  }

  .apr-value-large .value {
    font-size: 2rem;
  }

  .cost-item-large .cost-value {
    font-size: 1.75rem;
  }

  .cost-segment span {
    display: none;
  }
}

@media (max-width: 640px) {
  .apr-card {
    padding: 1.5rem;
  }

  .cost-breakdown-card {
    padding: 1.5rem;
  }

  .cost-bar {
    height: 40px;
  }

  .cost-legend {
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
  }
}
