/**
 * Financial Analysis CSS
 * 재무분석 Agent 전용 스타일시트
 */

/* 파일 업로드 영역 */
.file-upload-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.upload-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

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

.upload-button:active {
    background-color: #004085;
}

.upload-button svg {
    flex-shrink: 0;
}

.file-info {
    margin: 0;
    font-size: 12px;
    color: #6c757d;
}

/* 분석 결과 스타일 */
.analysis-result {
    line-height: 1.6;
}

.analysis-result h1 {
    font-size: 24px;
    font-weight: bold;
    margin: 20px 0 10px 0;
    color: #333;
    border-bottom: 2px solid #007bff;
    padding-bottom: 8px;
}

.analysis-result h2 {
    font-size: 20px;
    font-weight: bold;
    margin: 16px 0 8px 0;
    color: #444;
}

.analysis-result h3 {
    font-size: 18px;
    font-weight: bold;
    margin: 12px 0 6px 0;
    color: #555;
}

.analysis-result p {
    margin: 8px 0;
}

.analysis-result ul {
    margin: 8px 0;
    padding-left: 20px;
}

.analysis-result li {
    margin: 4px 0;
}

.analysis-result hr {
    border: none;
    border-top: 1px solid #e0e0e0;
    margin: 20px 0;
}

.analysis-result strong {
    font-weight: 600;
    color: #333;
}

.analysis-result em {
    font-style: italic;
    color: #666;
}

/* 재무 테이블 스타일 */
.financial-table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    background-color: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.financial-table thead {
    background-color: #007bff;
    color: white;
}

.financial-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #0056b3;
}

.financial-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #e0e0e0;
}

.financial-table tbody tr:hover {
    background-color: #f8f9fa;
}

.financial-table tbody tr:last-child td {
    border-bottom: none;
}

/* 테이블 내 숫자 정렬 */
.financial-table td:nth-child(2),
.financial-table th:nth-child(2) {
    text-align: right;
}

/* 테이블 내 평가 아이콘 */
.financial-table td:last-child {
    font-weight: 500;
}

/* 코드 블록 스타일 */
.analysis-result pre {
    background-color: #f4f4f4;
    padding: 12px;
    border-radius: 4px;
    overflow-x: auto;
    margin: 12px 0;
}

.analysis-result code {
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
}

/* 메시지 박스 스타일 개선 */
.message.bot-message .analysis-result {
    max-width: 100%;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .financial-table {
        font-size: 14px;
    }
    
    .financial-table th,
    .financial-table td {
        padding: 8px;
    }
    
    .analysis-result h1 {
        font-size: 20px;
    }
    
    .analysis-result h2 {
        font-size: 18px;
    }
    
    .analysis-result h3 {
        font-size: 16px;
    }
    
    .upload-button {
        padding: 10px 20px;
        font-size: 14px;
    }
}

/* 로딩 애니메이션 */
.message.loading .message-text::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% {
        content: '.';
    }
    40% {
        content: '..';
    }
    60%, 100% {
        content: '...';
    }
}

/* 성공/오류 메시지 스타일 */
.message-text:has(✅) {
    color: #28a745;
    font-weight: 500;
}

.message-text:has(❌) {
    color: #dc3545;
    font-weight: 500;
}

/* 재무 데이터 하이라이트 */
.analysis-result table tr:nth-child(even) {
    background-color: #f9f9f9;
}

/* 평가 결과 색상 */
.analysis-result td:contains('✅') {
    color: #28a745;
}

.analysis-result td:contains('⚠️') {
    color: #ffc107;
}

.analysis-result td:contains('❌') {
    color: #dc3545;
}

