body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 20px;
    background-color: #f5f5f5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

h1, h2, h3, h4 {
    color: #333;
    margin-bottom: 15px;
}

h1 {
    text-align: center;
    margin: 0 0 20px 0;
    font-size: 24px;
}

.upload-section {
    text-align: center;
    padding: 15px;
    border: 2px dashed #ccc;
    border-radius: 8px;
    margin-bottom: 20px;
    transition: border-color 0.3s ease;
    background-color: #f8f9fa;
}

.upload-section:hover {
    border-color: #666;
}

.upload-section p {
    margin: 5px 0 0 0;
    font-size: 14px;
    color: #666;
}

.results-section {
    display: none;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.charts-section {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin: 20px 0;
}

.chart-container {
    background-color: #fff;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    height: 300px;
}

.credit-score-container {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 20px;
    align-items: center;
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
}

.credit-interpretation {
    padding: 15px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.credit-interpretation h4 {
    margin: 0 0 10px 0;
    color: #495057;
}

.credit-interpretation p {
    margin: 0;
    line-height: 1.8;
    font-size: 14px;
}

.ratios-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.metric-card, .ratio-card {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.metric-card h3, .ratio-card h4 {
    margin: 0 0 8px 0;
    color: #495057;
    font-size: 14px;
}

.metric-card p, .ratio-card p {
    margin: 0;
    font-size: 16px;
    font-weight: bold;
    color: #007bff;
}

.analysis-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.health-assessment, .risk-factors, .recommendations {
    background-color: #fff;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.health-assessment h3, .risk-factors h3, .recommendations h3 {
    color: #495057;
    margin-top: 0;
    font-size: 16px;
}

.risk-factors ul, .recommendations ul {
    margin: 0;
    padding-left: 20px;
}

.risk-factors li, .recommendations li {
    margin-bottom: 8px;
    color: #495057;
    font-size: 14px;
}

.credit-score {
    text-align: center;
    padding: 15px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.score-display {
    display: flex;
    flex-direction: column;
    align-items: center;
}

#scoreValue {
    font-size: 36px;
    font-weight: bold;
    color: #007bff;
    margin-bottom: 5px;
}

.score-scale {
    color: #6c757d;
    font-size: 12px;
}

.loading {
    display: none;
    text-align: center;
    margin: 20px 0;
    color: #007bff;
    font-weight: bold;
}

.error-message {
    color: #dc3545;
    text-align: center;
    margin: 20px 0;
    display: none;
    padding: 10px;
    background-color: #f8d7da;
    border-radius: 4px;
}

button {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

button:hover {
    background-color: #0056b3;
}

#fileInput {
    display: none;
}

.chat-section {
    margin-top: 20px;
    padding: 15px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.chat-messages {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 15px;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 4px;
}

.chat-message {
    margin-bottom: 10px;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
}

.user-message {
    background-color: #007bff;
    color: white;
    margin-left: 20%;
    border-radius: 12px 12px 0 12px;
}

.assistant-message {
    background-color: #e9ecef;
    color: #212529;
    margin-right: 20%;
    border-radius: 12px 12px 12px 0;
}

.chat-input-container {
    display: flex;
    gap: 10px;
}

#questionInput {
    flex-grow: 1;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
}

#questionInput:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.typing-indicator {
    display: none;
    color: #6c757d;
    font-style: italic;
    margin: 8px 0;
    font-size: 14px;
}

.message-time {
    font-size: 11px;
    color: rgba(108, 117, 125, 0.8);
    margin-top: 4px;
}

.debug-section {
    display: none;
}

@media (max-width: 768px) {
    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .charts-section,
    .analysis-grid {
        grid-template-columns: 1fr;
    }
    
    .credit-score-container {
        grid-template-columns: 1fr;
    }
}