/* style.css */
.rec-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.rec-header {
    text-align: center;
    margin-bottom: 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.rec-header h2 {
    margin: 0 0 10px 0;
    font-size: 2.2em;
    color: white; /* Added white color for main heading */
}

.rec-header p {
    margin: 0;
    opacity: 0.9;
    font-size: 1.1em;
}

.rec-form {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.rec-form-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e9ecef;
}

.rec-form-section:last-child {
    border-bottom: none;
}

.rec-form-section h3 {
    color: #495057;
    margin-bottom: 15px;
    font-size: 1.3em;
    border-left: 4px solid #667eea;
    padding-left: 10px;
}

.rec-input-group {
    margin-bottom: 15px;
}

.rec-input-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #495057;
}

.rec-input-group input,
.rec-input-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 5px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.rec-input-group input:focus,
.rec-input-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.rec-input-hint {
    font-size: 0.8em;
    color: #6c757d;
    margin-top: 5px;
    font-style: italic;
}

.rec-form-buttons {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.rec-calculate-btn, .rec-reset-btn {
    padding: 15px 30px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0 10px;
}

.rec-calculate-btn {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
}

.rec-calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.rec-reset-btn {
    background: #6c757d;
    color: white;
}

.rec-reset-btn:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.rec-loading {
    text-align: center;
    padding: 40px;
}

.rec-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.rec-results {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.rec-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e9ecef;
}

.rec-results-header h3 {
    color: white; /* Added white color for secondary heading */
    margin: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 15px 25px;
    border-radius: 8px;
    font-size: 1.4em;
}

.rec-risk-score {
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 1.1em;
}

.rec-risk-score.good { background: #d4edda; color: #155724; }
.rec-risk-score.warning { background: #fff3cd; color: #856404; }
.rec-risk-score.danger { background: #f8d7da; color: #721c24; }

.rec-key-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.rec-metric-card {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    transition: transform 0.3s ease;
}

.rec-metric-card:hover {
    transform: translateY(-2px);
}

.rec-metric-card.good {
    border-left-color: #28a745;
    background: linear-gradient(135deg, #d4edda, #f8f9fa);
}

.rec-metric-card.warning {
    border-left-color: #ffc107;
    background: linear-gradient(135deg, #fff3cd, #f8f9fa);
}

.rec-metric-card.danger {
    border-left-color: #dc3545;
    background: linear-gradient(135deg, #f8d7da, #f8f9fa);
}

.rec-metric-value {
    font-size: 1.8em;
    font-weight: bold;
    margin: 10px 0;
    color: #212529;
}

.rec-metric-label {
    font-size: 0.9em;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.rec-metric-description {
    font-size: 0.85em;
    color: #495057;
    margin-top: 5px;
}

/* Updated section classes to match new structure */
.rec-expense-summary,
.rec-investment-summary {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
}

.rec-expense-summary h4,
.rec-investment-summary h4 {
    color: #495057;
    margin-bottom: 15px;
    border-left: 4px solid #667eea;
    padding-left: 10px;
}

.rec-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 10px;
}

.rec-summary-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #dee2e6;
}

.rec-summary-item span:first-child {
    font-weight: 600;
    color: #495057;
}

.rec-summary-item span:last-child {
    color: #212529;
    text-align: right;
    font-family: 'Courier New', monospace;
}

.rec-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.rec-metrics-grid h4 {
    grid-column: 1 / -1;
    color: #495057;
    margin-bottom: 15px;
    border-left: 4px solid #667eea;
    padding-left: 10px;
}

.rec-charts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.rec-chart-container {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    height: 400px;
}

.rec-chart-container canvas {
    width: 100% !important;
    height: 100% !important;
}

.rec-alert {
    padding: 15px;
    border-radius: 5px;
    margin: 15px 0;
    border-left: 4px solid;
}

.rec-alert.info {
    background: #d1ecf1;
    border-left-color: #17a2b8;
    color: #0c5460;
}

.rec-alert.warning {
    background: #fff3cd;
    border-left-color: #ffc107;
    color: #856404;
}

.rec-alert.danger {
    background: #f8d7da;
    border-left-color: #dc3545;
    color: #721c24;
}

.input-error {
    border-color: #dc3545 !important;
    background-color: #f8d7da;
}

.error-message {
    color: #dc3545;
    font-size: 0.8em;
    margin-top: 5px;
}

/* Removed unused CSS classes */
/* .rec-mortgage-summary - REMOVED */
/* .rec-financial-ratios - REMOVED */
/* .rec-new-metrics - REMOVED */

@media (max-width: 768px) {
    .rec-container {
        padding: 10px;
    }
    
    .rec-charts {
        grid-template-columns: 1fr;
    }
    
    .rec-chart-container {
        min-width: 100%;
        height: 300px;
    }
    
    .rec-key-metrics,
    .rec-metrics-grid {
        grid-template-columns: 1fr;
    }
    
    .rec-results-header {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .rec-summary-grid {
        grid-template-columns: 1fr;
    }
    
    .rec-summary-item {
        flex-direction: column;
    }
    
    .rec-summary-item span:last-child {
        text-align: left;
        margin-top: 5px;
    }
    
    .rec-form-buttons {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
    
    .rec-calculate-btn, .rec-reset-btn {
        margin: 0;
        width: 100%;
    }
    
    .rec-results-header h3 {
        font-size: 1.2em;
        padding: 12px 20px;
    }
}