/* ===== Loan Calculator Specific Styles ===== */

/* Term Input Group */
.term-input-group {
    display: flex;
    gap: var(--spacing-sm);
}

.term-input-group input {
    flex: 1;
}

.term-input-group select {
    width: 100px;
}

/* Payment Summary */
.payment-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

.summary-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-fast);
}

.summary-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.summary-card.primary {
    background: linear-gradient(135deg, var(--primary-coral) 0%, #dc2626 100%);
    color: white;
}

.summary-card.primary .summary-label {
    color: rgba(255, 255, 255, 0.9);
}

.summary-card.primary .summary-value {
    color: white;
}

.summary-label {
    display: block;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.summary-value {
    display: block;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Savings Display */
.savings-display {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    border: 2px solid #34d399;
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
}

.savings-display h4 {
    color: var(--text-primary);
    margin-bottom: var(--spacing-lg);
}

.savings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-lg);
}

.savings-item {
    text-align: center;
}

.savings-label {
    display: block;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-sm);
}

.savings-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--success-green);
}

/* Chart Container */
.chart-container {
    background: white;
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
    box-shadow: var(--shadow-sm);
}

.chart-container h4 {
    margin-bottom: var(--spacing-lg);
    color: var(--text-primary);
}

#loan-chart {
    max-height: 300px;
}

/* Amortization Table */
.amortization-table {
    background: white;
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
    box-shadow: var(--shadow-sm);
}

.amortization-table h4 {
    margin-bottom: var(--spacing-lg);
    color: var(--text-primary);
}

.table-controls {
    display: flex;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.view-toggle {
    background: var(--primary-coral);
    color: white;
    border: none;
    padding: var(--spacing-sm) var(--spacing-lg);
    border-radius: var(--radius-md);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.view-toggle:hover {
    background: #dc2626;
}

.table-wrapper {
    overflow-x: auto;
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
}

#amortization-table {
    width: 100%;
    border-collapse: collapse;
}

#amortization-table thead {
    background: var(--background-light);
    position: sticky;
    top: 0;
    z-index: 10;
}

#amortization-table th {
    padding: var(--spacing-md);
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-light);
}

#amortization-table td {
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--border-light);
    color: var(--text-secondary);
}

#amortization-table tbody tr:hover {
    background: var(--background-light);
}

/* Comparison Section */
.comparison-section {
    background: var(--background-light);
    padding: var(--spacing-3xl) 0;
}

.comparison-tool {
    background: white;
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    margin-top: var(--spacing-xl);
    box-shadow: var(--shadow-sm);
}

.comparison-inputs {
    margin-bottom: var(--spacing-xl);
}

.comparison-row label {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-weight: 500;
}

.comparison-row input {
    width: 150px;
    padding: var(--spacing-sm);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
}

.comparison-table {
    overflow-x: auto;
}

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

.comparison-table th {
    background: var(--background-light);
    padding: var(--spacing-md);
    text-align: center;
    font-weight: 600;
    border: 1px solid var(--border-light);
}

.comparison-table td {
    padding: var(--spacing-md);
    text-align: center;
    border: 1px solid var(--border-light);
}

.comparison-table tbody tr:hover {
    background: var(--background-light);
}

/* Responsive Design */
@media (max-width: 768px) {
    .payment-summary {
        grid-template-columns: 1fr;
    }
    
    .savings-grid {
        grid-template-columns: 1fr;
    }
    
    .table-controls {
        flex-direction: column;
    }
    
    .table-controls button {
        width: 100%;
    }
    
    .comparison-table {
        font-size: 0.875rem;
    }
}

@media (max-width: 480px) {
    .summary-value {
        font-size: 1.5rem;
    }
    
    .term-input-group {
        flex-direction: column;
    }
    
    .term-input-group select {
        width: 100%;
    }
}