/* Financing Payment Calculator Specific Styles */

/* Payment Analysis Display */
.payment-analysis {
    background: linear-gradient(135deg, #f0fdf4, #ecfdf5);
    border-radius: 12px;
    padding: 24px;
    margin: 20px 0;
    border: 2px solid #10b981;
}

.payment-header {
    text-align: center;
    margin-bottom: 20px;
}

.payment-title {
    font-size: 20px;
    font-weight: 600;
    color: #059669;
    margin-bottom: 8px;
}

.payment-subtitle {
    font-size: 14px;
    color: #064e3b;
}

.payment-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.payment-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    border: 2px solid #e2e8f0;
    text-align: center;
    transition: all 0.3s ease;
}

.payment-card:hover {
    border-color: #10b981;
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.15);
    transform: translateY(-2px);
}

.payment-card.primary {
    border-color: #10b981;
    background: linear-gradient(135deg, #f0fdf4, #ecfdf5);
}

.payment-card.secondary {
    border-color: #3b82f6;
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
}

.payment-card.warning {
    border-color: #f59e0b;
    background: linear-gradient(135deg, #fefbf3, #fef3c7);
}

.payment-card.danger {
    border-color: #ef4444;
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
}

.payment-breakdown {
    margin: 20px 0;
    padding: 16px;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.breakdown-chart {
    display: flex;
    height: 40px;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 12px;
}

.breakdown-segment {
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.breakdown-segment:hover {
    filter: brightness(1.1);
    transform: scaleY(1.05);
}

.segment-principal {
    background: #2563eb;
}

.segment-interest {
    background: #dc2626;
}

.segment-fees {
    background: #f59e0b;
}

.breakdown-legend {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    justify-content: center;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #64748b;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

.schedule-table {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-top: 16px;
}

.schedule-table table {
    width: 100%;
    border-collapse: collapse;
}

.schedule-table th,
.schedule-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #f1f5f9;
}

.schedule-table th {
    background: #f8fafc;
    font-weight: 600;
    color: #374151;
    position: sticky;
    top: 0;
    z-index: 1;
}

.schedule-table tr:hover {
    background: #f8fafc;
}

.schedule-table .payment-number {
    font-weight: 500;
    color: #2563eb;
}

.schedule-table .amount {
    font-family: 'Roboto Mono', monospace;
    font-weight: 500;
}

.comparison-table {
    overflow-x: auto;
    margin-top: 16px;
}

.comparison-table table {
    width: 100%;
    min-width: 600px;
    border-collapse: collapse;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}

.comparison-table th,
.comparison-table td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid #f1f5f9;
}

.comparison-table th {
    background: #2563eb;
    color: white;
    font-weight: 600;
}

.comparison-table tr:nth-child(even) {
    background: #f8fafc;
}

.comparison-table .best-option {
    background: #dcfce7 !important;
    border-left: 4px solid #10b981;
}

.comparison-table .best-badge {
    display: inline-block;
    background: #10b981;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.affordability-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.metric-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.metric-label {
    font-weight: 500;
    color: #374151;
    font-size: 14px;
}

.metric-value {
    font-weight: 600;
    color: #1e293b;
    font-size: 16px;
}

.metric-value.excellent {
    color: #10b981;
}

.metric-value.good {
    color: #059669;
}

.metric-value.fair {
    color: #f59e0b;
}

.metric-value.poor {
    color: #ef4444;
}

.metric-value.danger {
    color: #dc2626;
}

.financing-tips {
    space-y: 16px;
}

.tip-item {
    padding: 16px;
    background: #f1f5f9;
    border-radius: 6px;
    margin-bottom: 12px;
    border-left: 4px solid #2563eb;
}

.tip-item strong {
    color: #1e293b;
    display: block;
    margin-bottom: 4px;
    font-size: 14px;
}

.tip-item p {
    color: #64748b;
    font-size: 13px;
    line-height: 1.4;
    margin: 0;
}

.rate-list {
    space-y: 12px;
}

.rate-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
}

.rate-type {
    font-weight: 500;
    color: #374151;
    font-size: 13px;
}

.rate-range {
    font-weight: 600;
    color: #2563eb;
    font-size: 13px;
    font-family: 'Roboto Mono', monospace;
}

/* Promotional Details Styling */
#promotionalDetails {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 8px;
    padding: 16px;
    margin-top: 16px;
}

#promotionalDetails .form-label {
    color: #92400e;
    font-weight: 600;
}

/* Payment Amount Highlighting */
.primary-result .result-value {
    font-size: 3rem;
    font-weight: 700;
    background: linear-gradient(135deg, #10b981, #059669);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.primary-result .result-value.high-payment {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Responsive Design */
@media (max-width: 768px) {
    .breakdown-legend {
        justify-content: flex-start;
    }
    
    .affordability-metrics {
        grid-template-columns: 1fr;
    }
    
    .metric-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .schedule-table {
        font-size: 14px;
    }
    
    .schedule-table th,
    .schedule-table td {
        padding: 8px;
    }
}

/* Animation for payment reveal */
@keyframes paymentReveal {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.primary-result.animate .result-value {
    animation: paymentReveal 0.6s ease-out;
}

/* Loading states */
.schedule-table.loading {
    opacity: 0.6;
    pointer-events: none;
}

.schedule-table.loading::after {
    content: "Calculating payment schedule...";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.9);
    padding: 16px 24px;
    border-radius: 8px;
    font-weight: 500;
    color: #374151;
}
