/* 채팅 메시지 내 인라인 선택 파일 리스트: 한 줄 + 가로 스크롤 */
/* 채팅 인라인 파일 스크롤 래퍼: 가로 스크롤 보장 */

/* selected-files-inline 제거 */


/* 트리맵 툴팁 위치 보정: 컨테이너 기준 고정 */
/* 툴팁은 ApexCharts 고정 위치 계산을 사용하되, 시각적 오프셋은 JS fixed 옵션으로 제어 */
.apexcharts-tooltip { position: absolute !important; }

/* 트리맵 툴팁: JS에서 고정/기본 위치를 사용. 추가 transform 오프셋 제거 */
/* 작업 상태 리스트 */
.job-list {
    margin: 6px 10px;
    padding: 6px;
    background: #1a1a2e;
    border: 1px solid #3a3a4a;
    border-radius: 6px;
}

.job-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 6px 8px;
    border-radius: 6px;
    background: #20203a;
    border: 1px solid #34344a;
    margin-bottom: 6px;
}
.job-actions {
    display: flex;
    gap: 6px;
    margin-top: 4px;
}
.job-btn {
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid #3a3a4a;
    background: #2a2a3a;
    color: #e0e6ed;
    cursor: pointer;
}
.job-btn:hover { background: #3a3a4a; }
.job-btn.retry { border-color: #00b894; color: #d4fff5; }
.job-btn.delete { border-color: #ff6b6b; color: #ffd4d4; }

.job-item.job-active { border-left: 4px solid #00d4aa; }
.job-item.job-failed { border-left: 4px solid #ff6b6b; }
.job-item.job-completed { border-left: 4px solid #7ddc6f; }

.job-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.78rem;
}

.job-file { color: #e0e6ed; }
.job-status { color: #aab3c5; }

.job-progress {
    height: 6px;
    background: #2a2a3a;
    border-radius: 4px;
    overflow: hidden;
}
.job-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #00d4aa, #00b894);
    width: 0%;
    transition: width 0.3s ease;
}

.job-message {
    font-size: 0.7rem;
    color: #aab3c5;
}
/* 전역 스타일 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* CSS 변수 정의 - 다크모드 기본값 */
:root {
    --chart-text-color: #e0e6ed;
    --chart-border-color: #3a3a4a;
}

/* 차트 전용 CSS 변수 - 전체 UI 테마는 변경하지 않음 */

body {
    margin: 0;
    padding: 0;
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, 'Helvetica Neue', 'Segoe UI', 'Apple SD Gothic Neo', 'Noto Sans KR', 'Malgun Gothic', 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', sans-serif;
    background: #0f0f23;
    color: #e0e6ed;
    overflow-x: auto;  /* 가로 스크롤 허용 */
    overflow-y: hidden;  /* 세로 스크롤 유지 정책은 기존과 동일 */
    height: 100vh;     /* 정확한 뷰포트 높이 */
}

/* 메인 레이아웃 - 중복 제거됨, 하단에 통합된 스타일 사용 */

/* 패널 공통 스타일 */
.left-panel,
.center-panel,
.right-panel {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

/* 왼쪽 패널 - 기존 스타일 (하단 통합 스타일로 대체됨) */
/*
.left-panel {
    width: 350px;
    min-width: 250px;
    background: #1a1a2e;
    border-right: 1px solid #3a3a4a;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
*/

/* 중앙 패널 - 기존 스타일 (하단 통합 스타일로 대체됨) */
/*
.center-panel {
    flex: 1;
    min-width: 400px;
    background: #0f0f23;
    flex-shrink: 1;
    min-height: 0;
}
*/

/* 오른쪽 패널 - 기존 스타일 (하단 통합 스타일로 대체됨) */
/*
.right-panel {
    width: 700px;
    min-width: 400px;
    max-width: 1000px;
    background: #1a1a2e;
    border-left: 1px solid #3a3a4a;
    flex-shrink: 0;
}
*/

/* 분석 파일 목록 섹션 */
.analysis-files-section {
    flex: 1;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #1a1a2e;
    border-radius: 6px;
    border: 1px solid #3a3a4a;
    margin-bottom: 10px;
}

/* 저장된 분석 결과 섹션 */
.saved-results-section {
    flex: 1;
    min-height: 200px;
    max-height: none;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #1a1a2e;
    border-radius: 6px;
    border: 1px solid #3a3a4a;
}

/* 리사이즈 핸들 */
.resize-handle {
    width: 6px;
    background: #3a3a4a;
    cursor: col-resize;
    position: relative;
    transition: background-color 0.2s;
    z-index: 1000;
    user-select: none;
}

.resize-handle:hover {
    background: #00d4aa;
}

.resize-handle:active {
    background: #00b894;
}

.resize-handle::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 2px;
    height: 20px;
    background: #666;
    border-radius: 1px;
    pointer-events: none;
}

.resize-handle:hover::after {
    background: #fff;
}

/* 세로 리사이즈 핸들 */
.vertical-resize-handle {
    height: 6px;
    background: #3a3a4a;
    cursor: row-resize;
    position: relative;
    transition: background-color 0.2s;
    z-index: 900; /* 오버레이/모달보다 낮게 */
    margin: 4px 0;  /* 마진 축소 */
    flex-shrink: 0;
    user-select: none;
}

.vertical-resize-handle:hover {
    background: #00d4aa;
}

.vertical-resize-handle:active {
    background: #00b894;
}

.vertical-resize-handle::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 2px;
    background: #666;
    border-radius: 1px;
    pointer-events: none;
}

.vertical-resize-handle:hover::after {
    background: #fff;
}

/* 분석 파일 목록 */
.analysis-files-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    border-bottom: 1px solid #3a3a4a;
    background: #0f0f23;
    border-radius: 6px 6px 0 0;
    flex-shrink: 0;
}

.analysis-files-title {
    font-size: 0.8rem;
    font-weight: 500;
    color: #e0e6ed;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.analysis-actions {
    display: flex;
    gap: 4px;
    align-items: center;
}

.analysis-action-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #e0e6ed;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0.2px;
    min-height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.analysis-action-btn:hover {
    background: rgba(0, 212, 170, 0.2);
    border-color: rgba(0, 212, 170, 0.4);
    color: #00d4aa;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 212, 170, 0.2);
}

.analysis-action-btn:active {
    transform: translateY(0);
}

/* 선택 삭제 버튼 - 빨간색 테마 */
#delete-selected-btn {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    border: 1px solid #c0392b;
    color: #ffffff;
    font-weight: 600;
}

#delete-selected-btn:hover {
    background: linear-gradient(135deg, #c0392b 0%, #a93226 100%);
    border-color: #a93226;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.25);
    transform: translateY(-1px);
}

#delete-selected-btn:disabled {
    background: #3a3a4a;
    border-color: #3a3a4a;
    color: #8a8a9a;
    cursor: not-allowed;
    box-shadow: none;
}

/* 파일 미리보기 버튼 */
.preview-btn {
    background: none;
    border: none;
    color: #8a8a9a;
    padding: 0;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: 6px;
    display: inline-block;
    vertical-align: middle;
}

.preview-btn:hover {
    color: #00d4aa;
    transform: scale(1.1);
}

/* 파일 미리보기 모달 */
.file-preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        backdrop-filter: blur(0px);
    }

    to {
        opacity: 1;
        backdrop-filter: blur(8px);
    }
}

@keyframes modalContentFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }

    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.file-preview-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.8) 0%, rgba(26, 26, 46, 0.9) 100%);
}

.file-preview-content {
    position: relative;
    background: linear-gradient(135deg, #1a1a2e 0%, #2a2a3a 100%);
    border: 1px solid #4a4a5a;
    border-radius: 16px;
    width: 85%;
    max-width: 900px;
    height: 85vh;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px) scale(0.95);
        opacity: 0;
    }

    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.file-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #4a4a5a;
    background: linear-gradient(135deg, #2a2a3a 0%, #3a3a4a 100%);
    flex-shrink: 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.file-preview-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #00d4aa;
    text-shadow: 0 2px 10px rgba(0, 212, 170, 0.3);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.file-preview-title::before {
    content: '📄';
    font-size: 1.2rem;
}

.file-preview-close-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #8a8a9a;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 8px;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.file-preview-close-btn:hover {
    background: rgba(231, 76, 60, 0.2);
    border-color: rgba(231, 76, 60, 0.4);
    color: #e74c3c;
    transform: scale(1.1);
}

.file-preview-body {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0; /* 내부 스크롤 영역이 제대로 확장되도록 */
    background: #1a1a2e;
}

.file-preview-text {
    flex: 1;
    overflow-y: auto;
    overflow-x: auto; /* 가로 스크롤 허용 */
    padding: 24px;
    color: #e0e6ed;
    font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    white-space: pre; /* 줄바꿈 강제하지 않음 */
    word-wrap: normal; /* 단어 단위 줄바꿈 비활성화 */
    background: linear-gradient(135deg, #0f0f23 0%, #1a1a2e 100%);
}

.file-preview-text::-webkit-scrollbar {
    width: 8px;
}

.file-preview-text::-webkit-scrollbar-track {
    background: #2a2a3a;
    border-radius: 4px;
}

.file-preview-text::-webkit-scrollbar-thumb {
    background: #4a4a5a;
    border-radius: 4px;
}

.file-preview-text::-webkit-scrollbar-thumb:hover {
    background: #5a5a6a;
}

/* 파일 미리보기 액션 버튼 영역 */
.file-preview-actions {
    display: flex;
    gap: 8px;
    margin-left: auto;
    margin-right: 8px;
}

.file-preview-action-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #cfd6e4;
    font-size: 0.85rem;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.file-preview-action-btn:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.25);
}

.file-preview-action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 편집기 스타일 */
.file-preview-editor {
    display: block;
    width: 100%;
    flex: 1; /* 모달 본문 높이를 꽉 채움 */
    height: auto;
    min-height: 0; /* flex 컨테이너에서 축소 가능 */
    resize: none;
    border: none;
    outline: none;
    background: #0f0f23;
    color: #e0e6ed;
    font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    padding: 24px;
    box-sizing: border-box;
    overflow: auto;
    white-space: pre; /* 가로 스크롤 허용 */
}

.analysis-files-list {
    flex: 1;
    width: 100%;
    min-width: 0;
    overflow-y: auto;
    padding: 10px;
    min-height: 100px;
    height: 0;
    /* flex-grow가 제대로 작동하도록 설정 */
}

.analysis-files-list::-webkit-scrollbar {
    width: 6px;
}

.analysis-files-list::-webkit-scrollbar-track {
    background: #2a2a3a;
    border-radius: 3px;
}

.analysis-files-list::-webkit-scrollbar-thumb {
    background: #4a4a5a;
    border-radius: 3px;
}

.analysis-files-list::-webkit-scrollbar-thumb:hover {
    background: #5a5a6a;
}

/* 중앙 패널 */
.center-panel {
    flex: 1;
    min-width: 400px;
    background: #0f0f23;
    flex-shrink: 1;
}

/* 오른쪽 패널 */
.right-panel {
    width: 700px;
    min-width: 400px;
    max-width: 1000px;
    background: #1a1a2e;
    border-left: 1px solid #3a3a4a;
    flex-shrink: 0;
    min-height: 0;
}

/* 리사이즈 핸들 */
.resize-handle {
    width: 6px;
    background: #3a3a4a;
    cursor: col-resize;
    position: relative;
    transition: background-color 0.2s;
    z-index: 1000;
    user-select: none;
}

.resize-handle:hover {
    background: #00d4aa;
}

.resize-handle:active {
    background: #00b894;
}

.resize-handle::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 2px;
    height: 20px;
    background: #666;
    border-radius: 1px;
    pointer-events: none;
}

.resize-handle:hover::after {
    background: #fff;
}

/* 세로 리사이즈 핸들 */
.vertical-resize-handle {
    height: 6px;
    background: #3a3a4a;
    cursor: row-resize;
    position: relative;
    transition: background-color 0.2s;
    z-index: 2000;
    margin: 8px 0;
    flex-shrink: 0;
    user-select: none;
}

.vertical-resize-handle:hover {
    background: #00d4aa;
}

.vertical-resize-handle:active {
    background: #00b894;
}

.vertical-resize-handle::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 2px;
    background: #666;
    border-radius: 1px;
    pointer-events: none;
}

.vertical-resize-handle:hover::after {
    background: #fff;
}

/* 패널 헤더는 공통 스타일을 상속받습니다 */
.panel-header {
    flex-shrink: 0;
    height: 60px;
    display: flex;
    align-items: center;
    padding: 0 20px;
    border-bottom: 1px solid #3a3a4a;
    background: #1a1a2e;
}

/* 업로드 섹션 */
.upload-section {
    background: #1a1a2e;
    border-radius: 8px;
    border: 1px solid #3a3a4a;
    padding: 12px;
    margin-bottom: 12px;
    /* 여백 줄임 */
}

.upload-header h3 {
    margin: 0 0 12px 0;
    font-size: 0.9rem;
    color: #e0e6ed;
    font-weight: 500;
}

.upload-options {
    display: flex;
    gap: 10px;
    margin-bottom: 8px;
}

.upload-option {
    flex: 1;
}

.upload-btn {
    display: block;
    width: 100%;
    padding: 10px 15px;
    border: 2px dashed #4a4a5a;
    border-radius: 6px;
    background: #0f0f23;
    color: #e0e6ed;
    font-size: 0.85rem;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.upload-btn:hover {
    border-color: #00d4aa;
    background: #1a2e2a;
    color: #00d4aa;
}

.upload-btn.csv-upload {
    border-color: #667eea;
}

.upload-btn.csv-upload:hover {
    border-color: #00d4aa;
    background: #1a2e2a;
}

.upload-btn.excel-upload {
    border-color: #764ba2;
}

.upload-btn.excel-upload:hover {
    border-color: #00d4aa;
    background: #1a2e2a;
}

.upload-hint {
    font-size: 0.75rem;
    color: #8a8a9a;
    text-align: center;
    margin-top: 8px;
}

/* 삭제 섹션 */
.delete-section {
    background: #1a1a2e;
    border-radius: 8px;
    border: 1px solid #3a3a4a;
    padding: 10px;
    margin-bottom: 12px;
}

.delete-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    gap: 10px;
}

.delete-title {
    font-size: 0.85rem;
    font-weight: 500;
    color: #e0e6ed;
    margin: 0;
    flex-shrink: 0;
}

.selected-files-container {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.selected-files-list {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 4px 0;
    max-height: 32px;
}

.selected-files-list::-webkit-scrollbar {
    height: 4px;
}

.selected-files-list::-webkit-scrollbar-track {
    background: #1a1a2e;
    border-radius: 2px;
}

.selected-files-list::-webkit-scrollbar-thumb {
    background: #3a3a4a;
    border-radius: 2px;
}

.selected-files-list::-webkit-scrollbar-thumb:hover {
    background: #4a4a5a;
}

.selected-file-tag {
    display: flex;
    align-items: center;
    gap: 4px;
    background: #2a2a3a;
    border: 1px solid #4a4a5a;
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 0.7rem;
    color: #e0e6ed;
    white-space: nowrap;
    flex-shrink: 0;
    max-width: 120px;
    overflow: hidden;
}

.selected-file-tag .file-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.remove-btn {
    background: none;
    border: none;
    color: #8a8a9a;
    cursor: pointer;
    font-size: 0.6rem;
    padding: 0;
    margin-left: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.remove-btn:hover {
    background: #3a3a4a;
    color: #ff6b6b;
}

.delete-btn {
    background: #3a1a1a;
    border: 1px solid #5a2a2a;
    color: #ff6b6b;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
}

.delete-btn:hover {
    background: #4a2a2a;
    border-color: #6a3a3a;
}

.delete-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 저장된 분석 결과의 버튼 스타일 - 컴팩트하고 심플하게 */
.saved-result-item .replay-btn,
.saved-result-item .delete-btn {
    padding: 2px 6px;
    font-size: 0.6rem;
    border: 1px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    font-weight: 500;
    min-width: 40px;
    text-align: center;
    flex-shrink: 0;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: auto;
}

.saved-result-item .replay-btn {
    background: rgba(0, 212, 170, 0.2);
    color: #00d4aa;
    border-color: rgba(0, 212, 170, 0.3);
}

.saved-result-item .replay-btn:hover {
    background: rgba(0, 212, 170, 0.3);
    border-color: #00d4aa;
    color: #fff;
}

.saved-result-item .delete-btn {
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
    border-color: rgba(231, 76, 60, 0.3);
}

.saved-result-item .delete-btn:hover {
    background: rgba(231, 76, 60, 0.3);
    border-color: #e74c3c;
    color: #fff;
}

/* CSV 파일 목록 섹션 */
.csv-files-section {
    flex: 1;
    padding: 0 20px 20px;
    display: flex;
    flex-direction: column;
    min-height: 0;
    /* 플렉스 아이템이 축소될 수 있도록 */
}

/* 기존 섹션 헤더 스타일 (사용하지 않음) */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    flex-shrink: 0;
}

.section-title {
    font-size: 0.85rem;
    font-weight: 500;
    color: #e0e6ed;
    margin: 0;
}

.file-actions {
    display: flex;
    gap: 6px;
}

.action-btn {
    background: #2a2a3a;
    border: 1px solid #4a4a5a;
    color: #e0e6ed;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-btn:hover {
    background: #3a3a4a;
    border-color: #00d4aa;
}

.action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* CSV 파일 리스트 */
.csv-files-list {
    max-height: 400px;
    /* 높이 증가 */
    overflow-y: auto;
    padding: 10px;
    background: #1a1a2e;
    border-radius: 8px;
    border: 1px solid #3a3a4a;
}

.csv-file-item {
    background: #0f0f23;
    border: 1px solid #3a3a4a;
    border-radius: 6px;
    padding: 10px;
    margin-bottom: 8px;
    transition: all 0.2s ease;
}

.csv-file-item:hover {
    border-color: #00d4aa;
    background: #1a2e2a;
}

.csv-file-item:last-child {
    margin-bottom: 0;
}

.file-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.file-info {
    flex: 1;
    min-width: 0;
}

.file-name {
    display: block;
    font-weight: 500;
    color: #e0e6ed;
    font-size: 0.85rem;
    margin-bottom: 2px;
    width: 100%;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-meta {
    display: block;
    font-size: 0.7rem;
    color: #8a8a9a;
}

.file-actions {
    flex-shrink: 0;
    order: -1;
    /* 체크박스를 맨 앞으로 */
}

/* 체크박스 스타일 */
.checkbox-container {
    display: inline-block;
    position: relative;
    cursor: pointer;
    user-select: none;
    padding: 4px;
}

.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    height: 20px;
    width: 20px;
    background: linear-gradient(135deg, #2a2a3a 0%, #3a3a4a 100%);
    border: 2px solid #4a4a5a;
    border-radius: 6px;
    transition: all 0.3s ease;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.checkbox-container:hover input~.checkmark {
    border-color: #00d4aa;
    background: linear-gradient(135deg, rgba(0, 212, 170, 0.1) 0%, rgba(0, 212, 170, 0.2) 100%);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 212, 170, 0.2);
}

.checkbox-container input:checked~.checkmark {
    background: linear-gradient(135deg, #00d4aa 0%, #00b894 100%);
    border-color: #00d4aa;
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(0, 212, 170, 0.4);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 6px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 3px 3px 0;
    transform: rotate(45deg);
    animation: checkmarkSlide 0.3s ease;
}

@keyframes checkmarkSlide {
    0% {
        opacity: 0;
        transform: rotate(45deg) scale(0.5);
    }

    100% {
        opacity: 1;
        transform: rotate(45deg) scale(1);
    }
}

.checkbox-container input:checked~.checkmark:after {
    display: block;
}

.sheets-list {
    padding: 10px;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    /* 플렉스 아이템이 축소될 수 있도록 */
}

.sheets-list::-webkit-scrollbar {
    width: 4px;
}

.sheets-list::-webkit-scrollbar-track {
    background: #1a1a2e;
    border-radius: 2px;
}

.sheets-list::-webkit-scrollbar-thumb {
    background: #3a3a4a;
    border-radius: 2px;
}

.sheets-list::-webkit-scrollbar-thumb:hover {
    background: #4a4a5a;
}

/* CSV 파일 아이템 */
.csv-file-item {
    display: flex;
    align-items: center;
    padding: 10px;
    margin-bottom: 6px;
    background: #0f0f23;
    border-radius: 6px;
    border: 1px solid #3a3a4a;
    transition: all 0.2s ease;
    cursor: pointer;
}

.csv-file-item:hover {
    background: #1a1a2e;
    border-color: #00d4aa;
}

.csv-file-item.selected {
    background: #1a2e2a;
    border-color: #00d4aa;
    box-shadow: 0 0 0 1px #00d4aa;
}

.csv-file-item input[type="checkbox"] {
    margin-right: 12px;
    width: 18px;
    height: 18px;
    accent-color: #00d4aa;
}

.csv-file-content {
    flex: 1;
}

.csv-file-name {
    font-size: 0.85rem;
    color: #e0e6ed;
    font-weight: 500;
    margin-bottom: 2px;
}

.csv-file-info {
    font-size: 0.75rem;
    color: #8a8a9a;
    display: flex;
    gap: 15px;
}

.csv-file-size {
    color: #00d4aa;
}

/* 선택된 파일 정보 - 제거됨 (delete-section에 통합) */

/* 섹션 헤더 */
.info-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 14px;
    font-weight: 600;
    color: #00d4aa;
}

.clear-btn {
    background: none;
    border: none;
    color: #ff6b6b;
    cursor: pointer;
    font-size: 16px;
    padding: 2px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.clear-btn:hover {
    background-color: rgba(255, 107, 107, 0.1);
}

.selected-files-list {
    max-height: 200px;
    overflow-y: auto;
}

/* 선택된 파일 태그 */
.selected-file-tag {
    display: inline-flex;
    align-items: center;
    background: #2a2a3e;
    border: 1px solid #4a4a5a;
    border-radius: 4px;
    padding: 4px 8px;
    margin: 2px;
    font-size: 0.75rem;
    color: #e0e6ed;
    max-width: 200px;
}

.selected-file-tag .file-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-right: 6px;
}

.selected-file-tag .remove-btn {
    background: none;
    border: none;
    color: #ff6b6b;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    padding: 0;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.selected-file-tag .remove-btn:hover {
    background: #ff6b6b;
    color: #fff;
}

/* 저장된 분석 결과 */
.saved-results-section {
    background: #1a1a2e;
    border-radius: 6px;
    border: 1px solid #3a3a4a;
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex: 1;  /* 분석 파일보다 적은 공간 차지 */
    min-height: 150px;  /* 최소 높이 설정 */
}

.saved-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid #3a3a4a;
    background: #0f0f23;
    border-radius: 6px 6px 0 0;
    flex-shrink: 0;
}

.saved-results-title {
    font-size: 0.85rem;
    font-weight: 500;
    color: #e0e6ed;
    margin: 0;
}

.refresh-btn {
    background: #2a2a3a;
    border: 1px solid #4a4a5a;
    color: #e0e6ed;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 0.65rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.refresh-btn:hover {
    background: #3a3a4a;
    border-color: #00d4aa;
}

.saved-results-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    min-height: 0;  /* 최소 높이를 0으로 설정하여 유연하게 조정 */
    height: 0;
    /* flex-grow가 제대로 작동하도록 설정 */
}

.saved-results-list::-webkit-scrollbar {
    width: 6px;
}

.saved-results-list::-webkit-scrollbar-track {
    background: #2a2a3a;
    border-radius: 3px;
}

.saved-results-list::-webkit-scrollbar-thumb {
    background: #4a4a5a;
    border-radius: 3px;
}

.saved-results-list::-webkit-scrollbar-thumb:hover {
    background: #5a5a6a;
}

.saved-result-item {
    padding: 8px 10px;
    border-bottom: 1px solid #3a3a4a;
    transition: background-color 0.2s;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.saved-result-item:last-child {
    border-bottom: none;
}

.saved-result-item:hover {
    background: #2a2a3e;
}

.result-header {
    width: 100%;
}

.result-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: 100%;
}

.result-file {
    font-size: 0.65rem;
    color: #8a8a9a;
    font-weight: 400;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.result-question {
    font-size: 0.75rem;
    color: #e0e6ed;
    font-weight: 500;
    line-height: 1.2;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 2px;
}

.result-analysis {
    font-size: 0.7rem;
    color: #a0a6b0;
    line-height: 1.3;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 2px;
    font-weight: 400;
}

.result-meta {
    display: flex;
    gap: 8px;
    font-size: 0.6rem;
    color: #8a8a9a;
    flex-wrap: wrap;
}

.result-user {
    color: #00d4aa;
    font-weight: 500;
}

.result-actions {
    display: flex;
    gap: 4px;
    justify-content: flex-end;
    width: 100%;
    margin-top: 2px;
}



.no-results {
    padding: 20px;
    text-align: center;
    color: #8a8a9a;
    font-size: 0.8rem;
}

/* 중앙 패널: 채팅 */
/* 채팅 헤더는 공통 스타일을 상속받습니다 */

.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
    min-height: 500px;
}

.chat-window {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 20px;
    padding-right: 10px;
    min-height: 300px;
}

.chat-window::-webkit-scrollbar {
    width: 8px;
}

.chat-window::-webkit-scrollbar-track {
    background: #1a1a2e;
    border-radius: 4px;
}

.chat-window::-webkit-scrollbar-thumb {
    background: #3a3a4a;
    border-radius: 4px;
}

.chat-window::-webkit-scrollbar-thumb:hover {
    background: #4a4a5a;
}

.user-message,
.ai-message {
    margin-bottom: 10px;
    animation: fadeInUp 0.3s ease;
}

.user-message {
    text-align: right;
}

.ai-message {
    text-align: left;
}

.message-content {
    display: inline-block;
    max-width: 100%; /* 가로 스크롤 영역 표시 위해 확장 */
    padding: 8px 12px;
    border-radius: 8px;
    line-height: 1.4;
    word-wrap: break-word;
    font-size: 13px;
}

.user-message .message-content {
    background: linear-gradient(135deg, #00d4aa 0%, #00b894 100%);
    color: #fff;
    border-bottom-right-radius: 4px;
}

/* 저장된 분석 결과 요청 시 Golden 색상 */
.user-message.saved-result-request .message-content {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #2c2c2c;
    border-bottom-right-radius: 4px;
}

.ai-message .message-content {
    background: #2a2a3a;
    color: #e0e6ed;
    border-bottom-left-radius: 4px;
}

.chat-input-area {
    margin-top: auto;
    padding: 20px;
    background: linear-gradient(135deg, #1a1a2e 0%, #2a2a3a 100%);
    border-top: 1px solid #3a3a4a;
}

.input-group {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    max-width: 100%;
}

.question-input {
    flex: 1;
    min-height: 48px;
    max-height: 120px;
    padding: 14px 16px;
    background: #0f0f23;
    border: 2px solid #3a3a4a;
    border-radius: 12px;
    color: #e0e6ed;
    font-size: 0.9rem;
    line-height: 1.4;
    resize: vertical;
    transition: all 0.3s ease;
    font-family: inherit;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.question-input:focus {
    outline: none;
    border-color: #00d4aa;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1), 0 0 0 3px rgba(0, 212, 170, 0.15);
    background: #1a1a2e;
}

.question-input::placeholder {
    color: #8a8a9a;
    font-style: italic;
}

.send-button {
    padding: 14px 24px;
    background: linear-gradient(135deg, #00d4aa 0%, #00b894 100%);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 212, 170, 0.3);
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 120px;
    justify-content: center;
    height: 48px;
    flex-shrink: 0;
}

.send-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 212, 170, 0.4);
    background: linear-gradient(135deg, #00e6b8 0%, #00d4aa 100%);
}

.send-button:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(0, 212, 170, 0.3);
}

.send-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    background: linear-gradient(135deg, #4a4a5a 0%, #3a3a4a 100%);
}

.question-input:disabled {
    background: #2a2a3a;
    color: #8a8a9a;
    cursor: not-allowed;
    opacity: 0.6;
}

.refresh-btn:disabled {
    background: #3a3a4a;
    color: #8a8a9a;
    cursor: not-allowed;
    opacity: 0.6;
}

.send-icon {
    font-size: 1.1rem;
}

/* 우측 패널: 데이터 시각화 */

.chart-header {
    padding: 20px;
    background: linear-gradient(135deg, #2a2a3a 0%, #3a3a4a 100%);
    border-bottom: 1px solid #4a4a5a;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.chart-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #00d4aa;
    text-align: center;
    text-shadow: 0 2px 10px rgba(0, 212, 170, 0.3);
}

.chart-icon {
    margin-right: 10px;
    font-size: 1.6rem;
}

/* 탭 네비게이션 */
.tab-navigation {
    display: flex;
    background: #2a2a3a;
    border-bottom: 1px solid #4a4a5a;
}

.tab-btn {
    flex: 1;
    padding: 15px 20px;
    background: transparent;
    border: none;
    color: #8a8a9a;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-bottom: 3px solid transparent;
}

.tab-btn:hover {
    background: #3a3a4a;
    color: #e0e6ed;
}

.tab-btn.active {
    background: #1e1e2e;
    color: #00d4aa;
    border-bottom-color: #00d4aa;
}

.tab-icon {
    font-size: 1.1rem;
}

/* 탭 컨텐츠 */
.tab-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.tab-panel {
    display: none;
    flex: 1;
    padding: 20px;
    min-height: 0;
}

.tab-panel.active {
    display: flex;
    flex-direction: column;
}

.tab-content::-webkit-scrollbar {
    width: 8px;
}

.tab-content::-webkit-scrollbar-track {
    background: #1a1a2e;
    border-radius: 4px;
}

.tab-content::-webkit-scrollbar-thumb {
    background: #3a3a4a;
    border-radius: 4px;
}

.tab-content::-webkit-scrollbar-thumb:hover {
    background: #4a4a5a;
}

.chart-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-height: 0;
    overflow-y: auto;
    padding: 20px;
    gap: 20px;
}

.chart-container::-webkit-scrollbar {
    width: 8px;
}

.chart-container::-webkit-scrollbar-track {
    background: #1a1a2e;
    border-radius: 4px;
}

.chart-container::-webkit-scrollbar-thumb {
    background: #3a3a4a;
    border-radius: 4px;
}

.chart-container::-webkit-scrollbar-thumb:hover {
    background: #4a4a5a;
}

.chart-placeholder {
    text-align: center;
    color: #8a8a9a;
    max-width: 400px;
    margin: auto;
}

/* 인사이트 컨테이너 */
.insights-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 500px;
}

.insights-placeholder {
    text-align: center;
    color: #8a8a9a;
    max-width: 400px;
    margin: auto;
}

.insights-content {
    flex: 1;
    overflow-y: auto;
    padding: 25px;
    background: #0f0f23;
    border-radius: 8px;
    border: 1px solid #3a3a4a;
    margin: 20px;
    font-size: 0.95rem;
    line-height: 1.7;
    color: #e0e6ed;
}

.insights-content p {
    margin-bottom: 15px;
    text-align: justify;
}

.insights-content p:last-child {
    margin-bottom: 0;
}

.insights-content::-webkit-scrollbar {
    width: 6px;
}

.insights-content::-webkit-scrollbar-track {
    background: #1a1a2e;
    border-radius: 3px;
}

.insights-content::-webkit-scrollbar-thumb {
    background: #3a3a4a;
    border-radius: 3px;
}

.insights-content::-webkit-scrollbar-thumb:hover {
    background: #4a4a5a;
}

.placeholder-content {
    padding: 40px 20px;
}

.placeholder-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

.placeholder-content h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
    color: #e0e6ed;
}

.placeholder-content p {
    font-size: 0.9rem;
    line-height: 1.5;
}

/* 로딩 오버레이 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 6000; /* 업로드 모달(5001)보다 위 */
    backdrop-filter: blur(5px);
}

.loading-content {
    text-align: center;
    color: #e0e6ed;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid #3a3a4a;
    border-top: 3px solid #00d4aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* 차트 래퍼 및 개별 차트 스타일 */
.chart-wrapper {
    width: 100%;
    margin-bottom: 30px;
    background: #0f0f23;
    border: 1px solid #3a3a4a;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.chart-wrapper:last-child {
    margin-bottom: 0;
}

.chart-header-wrapper {
    padding: 15px 20px;
    background: #1a1a2e;
    border-bottom: 1px solid #3a3a4a;
}

.chart-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #e0e6ed;
    margin: 0;
    text-align: center;
}

.chart {
    width: 100%;
    padding: 20px;
    background: #0f0f23;
}

.chart-error {
    padding: 40px 20px;
    text-align: center;
    color: #ff6b6b;
    background: #2a1a1a;
    border: 1px solid #4a2a2a;
    border-radius: 6px;
    font-size: 0.9rem;
}

/* 차트 헤더 (컨트롤 포함) */
.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #1a1a2e;
    border-bottom: 1px solid #3a3a4a;
}

.chart-insight {
    font-size: 0.9rem;
    color: #b0b0c0;
    margin: 8px 0 0 0;
    line-height: 1.4;
}

.chart-controls {
    display: flex;
    gap: 8px;
}

.chart-control-btn {
    background: #2a2a3a;
    border: 1px solid #4a4a5a;
    color: #e0e6ed;
    padding: 6px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chart-control-btn:hover {
    background: #3a3a4a;
    border-color: #00d4aa;
}

.chart-control-btn:active {
    transform: scale(0.95);
}

/* 차트 스타일 */
.apexcharts-canvas {
    background: transparent !important;
}

.apexcharts-tooltip {
    background: #2a2a3a !important;
    border: 1px solid #3a3a4a !important;
    color: #e0e6ed !important;
}

.apexcharts-tooltip-title {
    background: #3a3a4a !important;
    color: #e0e6ed !important;
}

/* 히트맵 툴팁: 커서 대비 살짝 왼쪽/아래로 자연스럽게 보정 */
.apexcharts-heatmap ~ .apexcharts-tooltip,
.apexcharts-heatmap + .apexcharts-tooltip {
    transform: translate(-10px, 10px) !important;
}

/* ApexCharts 다운로드 메뉴 스타일 */
.apexcharts-menu {
    background: #2a2a3a !important;
    border: 1px solid #3a3a4a !important;
    border-radius: 6px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

.apexcharts-menu-item {
    background: #2a2a3a !important;
    color: #e0e6ed !important;
    border-bottom: 1px solid #3a3a4a !important;
    padding: 8px 12px !important;
    font-size: 0.875rem !important;
    cursor: pointer !important;
    transition: background-color 0.2s ease !important;
}

.apexcharts-menu-item:hover {
    background: #3a3a4a !important;
    color: #ffffff !important;
}

.apexcharts-menu-item:last-child {
    border-bottom: none !important;
}

/* 라이트 모드에서의 ApexCharts 다운로드 메뉴 */
.light-theme .apexcharts-menu {
    background: #ffffff !important;
    border: 1px solid #d1d5db !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
}

.light-theme .apexcharts-menu-item {
    background: #ffffff !important;
    color: #374151 !important;
    border-bottom: 1px solid #e9ecef !important;
}

.light-theme .apexcharts-menu-item:hover {
    background: #f9fafb !important;
    color: #1f2937 !important;
}

/* 반응형 레이아웃 */
@media (max-width: 1600px) {
    .right-panel {
        width: 600px;  /* 중간 화면에서는 600px */
        max-width: 900px;
    }
}

@media (max-width: 1400px) {
    .left-panel {
        width: 300px;
    }

    .center-panel {
        min-width: 350px;
    }
    
    .right-panel {
        width: 500px;  /* 작은 화면에서는 500px */
        max-width: 700px;
    }
}

/* 삭제: 1200px 이하에서 콘텐츠 숨기는 미디어쿼리 */

/* 애니메이션 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 시스템 메시지 스타일 */
.system-message {
    text-align: center;
    margin: 15px 0;
}

.system-message .message-content {
    background: #2a3a2a;
    color: #4a9a4a;
    font-size: 0.9rem;
    padding: 8px 16px;
    border-radius: 20px;
    display: inline-block;
}

/* 진행 상태 메시지 */
.progress-message {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: rgba(0, 212, 170, 0.1);
    border: 1px solid rgba(0, 212, 170, 0.3);
    border-radius: 6px;
    margin: 8px 0;
    font-size: 0.85rem;
    color: #e0e6ed;
}

.progress-message.success {
    background: rgba(0, 212, 170, 0.1);
    border-color: rgba(0, 212, 170, 0.5);
}

.progress-message.error {
    background: rgba(255, 107, 107, 0.1);
    border-color: rgba(255, 107, 107, 0.5);
    color: #ff6b6b;
}

/* 진행 상태 아이콘 */
.progress-icon {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid #00d4aa;
    border-top: 2px solid transparent;
    border-radius: 50%;
    margin-right: 8px;
    animation: spin 1s linear infinite;
    flex-shrink: 0;
}

/* 완료 상태 아이콘 */
.complete-icon {
    display: inline-block;
    width: 14px;
    height: 14px;
    background: #00d4aa;
    border-radius: 50%;
    margin-right: 8px;
    position: relative;
    flex-shrink: 0;
    animation: none;
}

.complete-icon::after {
    content: "✓";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 8px;
    font-weight: bold;
    line-height: 1;
}

/* 진행 상태 텍스트 - message-content에서 직접 상속 */
.progress-text {
    flex: 1;
    margin: 0;
    font-size: inherit;
    color: inherit;
    line-height: inherit;
    font-family: inherit;
}

/* 진행 상태 시간 */
.progress-time {
    font-size: 0.75rem;
    color: #8a8a9a;
    margin-left: 8px;
}

/* 메시지 내용에서 진행 상태 아이콘 */
.message-content .progress-icon {
    width: 14px;
    height: 14px;
    border-width: 1.5px;
    margin-right: 6px;
    display: inline-block;
    vertical-align: middle;
}

.message-content .complete-icon {
    width: 14px;
    height: 14px;
    display: inline-block;
    vertical-align: middle;
}

.message-content .complete-icon::after {
    font-size: 8px;
}

.message-content .progress-text {
    display: inline-block;
    vertical-align: middle;
    font-size: inherit;
    color: inherit;
    line-height: inherit;
    font-family: inherit;
}

@keyframes successBounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-10px);
    }

    60% {
        transform: translateY(-5px);
    }
}

/* 오류 메시지 */
.error-message {
    background: #3a2a2a;
    color: #ff6b6b;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 15px;
    animation: errorShake 0.5s ease;
}

@keyframes errorShake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

/* 추천 질문 영역 */
.recommendations-area {
    padding: 8px 15px;
    border-top: 1px solid #3a3a4a;
    background: #1a1a2e;
}

.recommendations-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.recommendations-title {
    font-size: 11px;
    font-weight: 600;
    color: #e0e6ed;
}

.recommendations-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 20px;
    background: linear-gradient(135deg, #1a1a2e 0%, #2a2a3a 100%);
    border-radius: 12px;
    border: 1px solid #3a3a4a;
    margin: 10px 0;
}

.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #3a3a4a;
    border-top: 2px solid #00d4aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.recommendations-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.recommendation-btn {
    padding: 4px 8px;
    background: #16213e;
    border: 1px solid #3a3a4a;
    border-radius: 4px;
    color: #e0e6ed;
    font-size: 10px;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1.3;
    word-break: break-word;
}

.recommendation-btn:hover {
    background: #1e2a4a;
    border-color: #00d4aa;
    transform: translateY(-1px);
}

.recommendation-btn:active {
    transform: translateY(0);
}

/* 파일 목록 스타일 */
.csv-file-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(0, 212, 170, 0.2);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 8px;
    transition: all 0.2s ease;
}

.csv-file-item:hover {
    background: rgba(0, 212, 170, 0.1);
    border-color: rgba(0, 212, 170, 0.4);
}

.file-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.file-name {
    font-weight: 600;
    color: #00d4aa;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    min-width: 0;
    cursor: help;
    position: relative;
}

.file-name:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: normal;
    white-space: nowrap;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    margin-bottom: 5px;
}

.file-name:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    margin-bottom: -5px;
}

.file-sheets {
    font-size: 11px;
    color: #a0a0a0;
}

.file-actions {
    display: flex;
    align-items: center;
}

.checkbox-container {
    position: relative;
    display: inline-block;
    cursor: pointer;
}

.checkbox-container input[type="checkbox"] {
    opacity: 0;
    position: absolute;
    cursor: pointer;
}

.checkmark {
    height: 18px;
    width: 18px;
    background-color: rgba(0, 212, 170, 0.1);
    border: 2px solid rgba(0, 212, 170, 0.3);
    border-radius: 4px;
    display: inline-block;
    position: relative;
    transition: all 0.2s ease;
}

.checkbox-container:hover .checkmark {
    background-color: rgba(0, 212, 170, 0.2);
    border-color: rgba(0, 212, 170, 0.5);
}

.checkbox-container input:checked~.checkmark {
    background-color: #00d4aa;
    border-color: #00d4aa;
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 5px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-container input:checked~.checkmark:after {
    display: block;
}

.sheets-list {
    margin-top: 8px;
    padding-left: 20px;
}

.sheet-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    font-size: 12px;
    color: #c0c0c0;
}

.sheet-name {
    color: #e0e6ed;
}

.sheet-info {
    color: #a0a0a0;
    font-size: 11px;
}

/* 진행 상태 피드백 */
.progress-feedback {
    background: rgba(0, 212, 170, 0.1);
    border: 1px solid rgba(0, 212, 170, 0.3);
    border-radius: 6px;
    padding: 8px 12px;
    margin: 8px 0;
    animation: fadeInUp 0.3s ease;
}

.feedback-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.feedback-text {
    color: #00d4aa;
    font-size: 13px;
}

.feedback-time {
    color: #a0a0a0;
    font-size: 11px;
}

/* 빈 상태 스타일 */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #8a8a9a;
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

.empty-state p {
    margin: 5px 0;
    font-size: 0.9rem;
}

.empty-subtitle {
    font-size: 0.8rem !important;
    opacity: 0.7;
}

/* 스크롤바 스타일 */
.csv-files-list::-webkit-scrollbar {
    width: 6px;
}

.csv-files-list::-webkit-scrollbar-track {
    background: #1a1a2e;
    border-radius: 3px;
}

.csv-files-list::-webkit-scrollbar-thumb {
    background: #3a3a4a;
    border-radius: 3px;
}

.csv-files-list::-webkit-scrollbar-thumb:hover {
    background: #4a4a5a;
}

/* 차트 컨테이너 */
.chart-container {
    padding: 20px;
    background: #0f0f23;
    border-radius: 8px;
    border: 1px solid #3a3a4a;
    margin-bottom: 15px;
    min-height: 400px;
}

.chart-wrapper {
    background: #1a1a2e;
    border: 1px solid #3a3a4a;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.chart-wrapper:last-child {
    margin-bottom: 0;
}

.chart-wrapper.light-theme {
    background: #ffffff;
    border-color: #e1e5e9;
    color: #2c3e50;
}

.chart-header-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #3a3a4a;
    gap: 12px;
}

.light-theme .chart-header-wrapper {
    border-bottom-color: #e1e5e9;
}

.chart-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #00d4aa;
    margin: 0;
    flex: 1;
    line-height: 1.45; /* 멀티라인 가독성 향상 */
    word-break: break-word;
    white-space: pre-wrap; /* 원문 줄바꿈 유지 */
}

.light-theme .chart-title {
    color: #2c3e50;
}

.theme-toggle-btn {
    background: none;
    border: 1px solid #3a3a4a;
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #e0e6ed;
    background: #2a2a3a;
    flex-shrink: 0;
    min-width: 32px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.light-theme .theme-toggle-btn {
    border-color: #d1d5db;
    color: #374151;
    background: #f9fafb;
}

.theme-toggle-btn:hover {
    background: #3a3a4a;
    border-color: #00d4aa;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 212, 170, 0.2);
}

.light-theme .theme-toggle-btn:hover {
    background: #f3f4f6;
    border-color: #2c3e50;
    box-shadow: 0 2px 8px rgba(44, 62, 80, 0.2);
}

/* ApexCharts 컨테이너 */
#chart-render-0,
#chart-render-1,
#chart-render-2,
#chart-render-3,
#chart-render-4 {
    min-height: 300px;
}

/* Y축 라벨 텍스트 완전 표시 */
.apexcharts-yaxis-texts-g text {
    font-size: 11px !important;
    fill: var(--chart-text-color, #e0e6ed) !important;
    text-overflow: visible !important;
    overflow: visible !important;
    white-space: nowrap !important;
}

/* Y축 영역 overflow 설정 */
.apexcharts-yaxis {
    overflow: visible !important;
}

.apexcharts-yaxis-texts-g {
    overflow: visible !important;
}

/* 차트 전체 영역에서 Y축 텍스트가 잘리지 않도록 */
.apexcharts-svg {
    overflow: visible !important;
}

/* Bar 차트 전용 여백 최소화 */
.chart .apexcharts-bar .apexcharts-yaxis-texts-g {
    transform: translateX(8px) !important; /* Bar 차트 Y축 라벨을 가깝게 */
}

.chart .apexcharts-bar .apexcharts-yaxis-title {
    transform: translateX(5px) !important; /* Bar 차트 Y축 제목도 가깝게 */
}

/* Bar 차트 전체 여백 조정 */
.chart .apexcharts-bar .apexcharts-inner {
    margin-left: 0 !important; /* 왼쪽 여백 제거 */
    padding-left: 0 !important;
}

.chart .apexcharts-bar svg {
    margin-left: 0 !important;
    padding-left: 0 !important;
}

/* 바차트 X축 라벨 스마트 회전 지원 */
.apexcharts-xaxis-texts-g text {
    font-size: 11px !important;
    fill: var(--chart-text-color, #e0e6ed) !important;
}

/* 회전된 X축 라벨 위치 조정 */
.apexcharts-xaxis-texts-g text[transform*="rotate"] {
    text-anchor: end !important;
}

/* 차트 내부 서브타이틀 숨김 (차트 내부에는 타이틀만) */
.apexcharts-subtitle-text {
    display: none !important;
}

/* 범례가 차트 영역과 겹치지 않도록 여백 확보 */
.chart .apexcharts-legend {
    position: absolute !important; /* ApexCharts 계산값을 그대로 사용 */
    margin-top: 0 !important;
}

/* 차트 박스 하단 패딩으로 범례 공간 확보 */
.chart {
    padding-top: 10px;   /* 타이틀과 간격 확보 */
    padding-bottom: 52px; /* 범례 공간 확보 + 너무 멀지 않게 조정 */
}

/* 범례 아래쪽 여백 살짝 */
.apexcharts-legend {
    margin-bottom: 2px !important; /* 아래쪽 여백 살짝만 */
}

/* 차트 로딩 상태 */
.chart-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 300px;
    color: #8a8a9a;
    font-size: 0.9rem;
}

.chart-loading .progress-icon {
    margin-right: 10px;
}

/* 공통 헤더 스타일 */
.panel-header,
.chat-header {
    padding: 8px 20px;
    background: linear-gradient(135deg, #2a2a3a 0%, #3a3a4a 100%);
    border-bottom: 1px solid #4a4a5a;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chart-header {
    padding: 8px 20px;
    background: linear-gradient(135deg, #2a2a3a 0%, #3a3a4a 100%);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.panel-title,
.chat-title,
.chart-header .chart-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #00d4aa;
    text-shadow: 0 2px 10px rgba(0, 212, 170, 0.3);
    margin: 0;
    padding: 0;
    border-bottom: none;
}

/* 헤더 액션 버튼들 */
.header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.user-info-container {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: linear-gradient(135deg, rgba(0, 212, 170, 0.12) 0%, rgba(32, 201, 151, 0.08) 100%);
    border-radius: 10px;
    border: 1px solid rgba(0, 212, 170, 0.25);
    box-shadow: 0 4px 10px rgba(0, 212, 170, 0.08);
}

.user-info {
    font-size: 0.84rem;
    color: #cfeeee;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.action-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #e0e6ed;
    padding: 6px 8px;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: scale(1.05);
}

.logout-btn {
    background: rgba(231, 76, 60, 0.08);
    border: 1px solid rgba(231, 76, 60, 0.25);
    color: #ff6b6b;
    padding: 0;
    border-radius: 8px;
    font-size: 0;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 36px;
    height: 36px;
    width: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logout-btn:hover {
    background: rgba(231, 76, 60, 0.18);
    border-color: rgba(231, 76, 60, 0.45);
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(231, 76, 60, 0.2);
}

/* 로그아웃 아이콘 스타일 */
.icon-logout {
    width: 32px;
    height: 32px;
    fill: currentColor;
}

.panel-title .icon,
.chat-title .icon,
.chart-title .icon {
    margin-right: 8px;
    font-size: 1.3rem;
}

.chart-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.chart-edit-btn {
    background: none;
    border: 1px solid #3a3a4a;
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #e0e6ed;
    background: #2a2a3a;
    flex-shrink: 0;
    min-width: 32px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.light-theme .chart-edit-btn {
    border-color: #d1d5db;
    color: #374151;
    background: #f9fafb;
}

.chart-edit-btn:hover {
    background: #3a3a4a;
    border-color: #00d4aa;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 212, 170, 0.2);
}

.light-theme .chart-edit-btn:hover {
    background: #f3f4f6;
    border-color: #2c3e50;
    box-shadow: 0 2px 8px rgba(44, 62, 80, 0.2);
}

/* 차트 편집 모달 */
.chart-edit-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
}

.chart-edit-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.chart-edit-content {
    background: #1a1a2e;
    border-radius: 12px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.chart-edit-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #3a3a4a;
}

.chart-edit-header h3 {
    margin: 0;
    color: #e0e6ed;
    font-size: 1.2rem;
}

.close-btn {
    background: none;
    border: none;
    color: #8a8a9a;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.close-btn:hover {
    background: #3a3a4a;
    color: #e0e6ed;
}

.chart-edit-body {
    padding: 20px;
}

.edit-section {
    margin-bottom: 20px;
}

.edit-section label {
    display: block;
    margin-bottom: 8px;
    color: #e0e6ed;
    font-weight: 500;
    font-size: 0.9rem;
}

.edit-input {
    width: 100%;
    padding: 10px 12px;
    background: #0f0f23;
    border: 1px solid #3a3a4a;
    border-radius: 6px;
    color: #e0e6ed;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.edit-input:focus {
    outline: none;
    border-color: #00d4aa;
    box-shadow: 0 0 0 3px rgba(0, 212, 170, 0.1);
}

.edit-textarea {
    width: 100%;
    min-height: 80px;
    padding: 10px 12px;
    background: #0f0f23;
    border: 1px solid #3a3a4a;
    border-radius: 6px;
    color: #e0e6ed;
    font-size: 0.8rem;
    font-family: 'Courier New', monospace;
    resize: vertical;
    transition: all 0.3s ease;
    line-height: 1.4;
}

.edit-textarea:focus {
    outline: none;
    border-color: #00d4aa;
    box-shadow: 0 0 0 3px rgba(0, 212, 170, 0.1);
}

.edit-textarea::placeholder {
    color: #8a8a9a;
    font-style: italic;
}

.series-container {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #3a3a4a;
    border-radius: 6px;
    padding: 10px;
    background: #0f0f23;
}

.series-item {
    background: #2a2a3a;
    border: 1px solid #3a3a4a;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 10px;
}

.series-item:last-child {
    margin-bottom: 0;
}

.series-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.series-header span {
    color: #e0e6ed;
    font-weight: 500;
    font-size: 0.9rem;
}

.remove-series-btn {
    background: none;
    border: none;
    color: #ff6b6b;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.remove-series-btn:hover {
    background: rgba(255, 107, 107, 0.1);
}

.series-inputs {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.add-series-btn {
    background: #00d4aa;
    border: none;
    color: #fff;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.add-series-btn:hover {
    background: #00b894;
    transform: translateY(-1px);
}

.chart-edit-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px;
    border-top: 1px solid #3a3a4a;
}

.cancel-btn {
    background: #3a3a4a;
    border: none;
    color: #e0e6ed;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.cancel-btn:hover {
    background: #4a4a5a;
}

.apply-btn {
    background: #00d4aa;
    border: none;
    color: #fff;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.apply-btn:hover {
    background: #00b894;
    transform: translateY(-1px);
}

.data-input-container {
    margin-top: 8px;
}

.data-input-container label {
    display: block;
    margin-bottom: 4px;
    color: #e0e6ed;
    font-size: 0.8rem;
    font-weight: 500;
}

.categories-container {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #3a3a4a;
    border-radius: 6px;
    padding: 10px;
    background: #0f0f23;
    margin-bottom: 10px;
}

.category-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.category-item:last-child {
    margin-bottom: 0;
}

.category-input {
    flex: 1;
    padding: 6px 8px;
    background: #2a2a3a;
    border: 1px solid #3a3a4a;
    border-radius: 4px;
    color: #e0e6ed;
    font-size: 0.8rem;
}

.category-input:focus {
    outline: none;
    border-color: #00d4aa;
}

.remove-category-btn {
    background: none;
    border: none;
    color: #ff6b6b;
    font-size: 1rem;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.remove-category-btn:hover {
    background: rgba(255, 107, 107, 0.1);
}

.add-category-btn {
    background: #00d4aa;
    border: none;
    color: #fff;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.add-category-btn:hover {
    background: #00b894;
    transform: translateY(-1px);
}

.no-categories {
    color: #8a8a9a;
    font-size: 0.8rem;
    font-style: italic;
    text-align: center;
    padding: 20px;
}

.insights-text {
    font-size: 0.9rem;
    line-height: 1.6;
    color: #e0e6ed;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.insights-text p {
    margin-bottom: 1em;
    text-align: justify;
}

.insights-text strong {
    color: #00d4aa;
    font-weight: 600;
}

.insights-text em {
    color: #b0b0c0;
    font-style: italic;
}

.insights-text h1,
.insights-text h2,
.insights-text h3 {
    color: #00d4aa;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    font-weight: 600;
}

.insights-text ul,
.insights-text ol {
    margin-left: 1.5em;
    margin-bottom: 1em;
    padding-left: 1em;
}

.insights-text li {
    margin-bottom: 0.5em;
    line-height: 1.4;
}

.insights-text ul li {
    list-style-type: disc;
}

.insights-text ol li {
    list-style-type: decimal;
}

/* 번호 매기기 리스트 스타일 */
.insights-text .numbered-list {
    list-style-type: none;
    counter-reset: item;
    margin-bottom: 0.5em;
    line-height: 1.4;
    padding-left: 0;
}

.insights-text .numbered-list::before {
    content: counter(item) ". ";
    counter-increment: item;
    color: #00d4aa;
    font-weight: 600;
    margin-right: 0.5em;
}

/* 한글 번호 매기기 스타일 */
.insights-text li.numbered-list {
    list-style-type: none;
    padding-left: 0;
}

.insights-text li.numbered-list:before {
    content: "";
    margin-right: 0.5em;
}

/* 팔레트 선택기 스타일 */
.palette-select {
    background: #2a2a3a;
    border: 1px solid #4a4a5a;
    color: #e0e6ed;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 140px;
    margin-left: 8px;
    font-weight: 500;
}

.palette-select:hover {
    background: #3a3a4a;
    border-color: #5a5a6a;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.palette-select:focus {
    outline: none;
    border-color: #00ADB5;
    box-shadow: 0 0 0 2px rgba(0, 173, 181, 0.3);
}

.light-theme .palette-select {
    background: #ffffff;
    border-color: #d1d5db;
    color: #374151;
}

.light-theme .palette-select:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

.light-theme .palette-select:focus {
    border-color: #00ADB5;
    box-shadow: 0 0 0 2px rgba(0, 173, 181, 0.3);
}

/* 팔레트 옵션 스타일 */
.palette-select option {
    background: #2a2a3a !important;
    color: #e0e6ed !important;
    padding: 10px;
    font-weight: 500;
    border-bottom: 1px solid #3a3a4a;
}

.palette-select option:hover {
    background: #3a3a4a !important;
}

.light-theme .palette-select option {
    background: #ffffff !important;
    color: #374151 !important;
    border-bottom: 1px solid #e9ecef;
}

.light-theme .palette-select option:hover {
    background: #e9ecef !important;
    color: #374151 !important;
}

/* 추가적인 라이트 모드 팔레트 선택 스타일 강화 */
.light-theme .palette-select option:checked {
    background: #00ADB5 !important;
    color: #ffffff !important;
}

.light-theme .palette-select option:focus {
    background: #e9ecef !important;
    color: #374151 !important;
}

/* 모노크롬 토글 버튼 스타일 */
.monochrome-toggle-btn {
    background: #2a2a3a;
    border: 1px solid #4a4a5a;
    color: #e0e6ed;
    padding: 6px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
}

.monochrome-toggle-btn:hover {
    background: #3a3a4a;
    border-color: #5a5a6a;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.light-theme .monochrome-toggle-btn {
    background: #ffffff;
    border-color: #d1d5db;
    color: #374151;
}

.light-theme .monochrome-toggle-btn:hover {
    background: #f9fafb;
    border-color: #9ca3af;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 리
사이즈 핸들 개선 - 중복 방지를 위해 끝에 추가 */
.resize-handle {
    width: 8px !important;
    position: relative;
}

.resize-handle::before {
    content: '';
    position: absolute;
    top: 0;
    left: -4px;
    right: -4px;
    bottom: 0;
    background: transparent;
    cursor: col-resize;
    z-index: 1001;
}

.vertical-resize-handle {
    height: 8px !important;
    position: relative;
}

.vertical-resize-handle::before {
    content: '';
    position: absolute;
    top: -4px;
    left: 0;
    right: 0;
    bottom: -4px;
    background: transparent;
    cursor: row-resize;
    z-index: 901; /* 핸들과 동일 계층 */
}

/* 리사이즈 중 시각적 피드백 */
body.resizing {
    user-select: none !important;
}

body.resizing * {
    pointer-events: none !important;
}

body.resizing .resize-handle,
body.resizing .vertical-resize-handle {
    pointer-events: auto !important;
}

/* 파일 업로드 섹션 */
.file-upload-section {
    background: #1a1a2e;
    border-radius: 6px;
    border: 1px solid #3a3a4a;
    margin-bottom: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: linear-gradient(135deg, #2a2a3a 0%, #3a3a4a 100%);
    border-bottom: 1px solid #4a4a5a;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.upload-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #00d4aa;
    text-shadow: 0 2px 10px rgba(0, 212, 170, 0.3);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.upload-modal-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #e0e6ed;
    padding: 4px 6px;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-modal-btn:hover {
    background: rgba(0, 212, 170, 0.2);
    border-color: rgba(0, 212, 170, 0.4);
    color: #00d4aa;
    transform: scale(1.05);
}

/* 파일 업로드 모달 */
.upload-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5000;
    display: none;
}

.upload-modal.show {
    display: block;
}

.upload-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 5000;
}

.upload-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #1a1a2e;
    border-radius: 12px;
    border: 1px solid #3a3a4a;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow: hidden;
    animation: modalContentFadeIn 0.3s ease;
    z-index: 5001;
}

.upload-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #3a3a4a;
    background: #2a2a3a;
}

.upload-modal-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #e0e6ed;
    margin: 0;
}

.upload-modal-close-btn {
    background: none;
    border: none;
    color: #8a8a9a;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-modal-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #e0e6ed;
}

.upload-modal-body {
    padding: 24px;
    max-height: calc(80vh - 80px);
    overflow-y: auto;
}

.upload-content {
    padding: 16px;
    background: #1a1a2e;
}

/* 업로드 타입 선택 */
.upload-options {
    margin-bottom: 20px;
}

.upload-type-selector {
    display: flex;
    gap: 16px;
    justify-content: center;
    padding: 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    border: 1px solid #3a3a4a;
}

.upload-type-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid transparent;
    min-width: 120px;
    justify-content: center;
}

.upload-type-option:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.upload-type-option input[type="radio"] {
    display: none;
}

.radio-custom {
    width: 18px;
    height: 18px;
    border: 2px solid #4a4a5a;
    border-radius: 50%;
    position: relative;
    transition: all 0.3s ease;
}

.radio-custom::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #00d4aa;
    transition: transform 0.3s ease;
}

.upload-type-option input[type="radio"]:checked+.radio-custom {
    border-color: #00d4aa;
    background: rgba(0, 212, 170, 0.1);
}

.upload-type-option input[type="radio"]:checked+.radio-custom::after {
    transform: translate(-50%, -50%) scale(1);
}

.upload-type-option input[type="radio"]:checked~.option-icon,
.upload-type-option input[type="radio"]:checked~.option-text {
    color: #00d4aa;
}

.upload-type-option[data-type="shared"] input[type="radio"]:checked+.radio-custom {
    border-color: #667eea;
}

.upload-type-option[data-type="shared"] input[type="radio"]:checked+.radio-custom::after {
    background: #667eea;
}

.upload-type-option[data-type="shared"] input[type="radio"]:checked~.option-icon,
.upload-type-option[data-type="shared"] input[type="radio"]:checked~.option-text {
    color: #667eea;
}

.option-icon {
    font-size: 1.2rem;
    transition: color 0.3s ease;
}

.option-text {
    font-size: 0.85rem;
    font-weight: 600;
    color: #e0e6ed;
    transition: color 0.3s ease;
}

.upload-area {
    margin-bottom: 16px;
}

.upload-zone {
    border: 2px dashed #4a4a5a;
    border-radius: 8px;
    padding: 32px 24px;
    text-align: center;
    background: linear-gradient(135deg, #0f0f23 0%, #1a1a2e 100%);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.upload-zone::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 212, 170, 0.1), transparent);
    transition: left 0.5s ease;
}

.upload-zone:hover::before,
.upload-zone.dragover::before {
    left: 100%;
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: #00d4aa;
    background: linear-gradient(135deg, rgba(0, 212, 170, 0.05) 0%, rgba(0, 212, 170, 0.1) 100%);
    box-shadow: 0 4px 20px rgba(0, 212, 170, 0.2);
    transform: translateY(-2px);
}

/* 업로드 타입별 스타일 */
.upload-zone.upload-zone-user:hover,
.upload-zone.upload-zone-user.dragover {
    border-color: #00d4aa;
    background: linear-gradient(135deg, rgba(0, 212, 170, 0.05) 0%, rgba(0, 212, 170, 0.1) 100%);
    box-shadow: 0 4px 20px rgba(0, 212, 170, 0.2);
}

.upload-zone.upload-zone-shared:hover,
.upload-zone.upload-zone-shared.dragover {
    border-color: #667eea;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(102, 126, 234, 0.1) 100%);
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.2);
}

.upload-zone.upload-zone-shared::before {
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.1), transparent);
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.7;
    transition: all 0.3s ease;
}

.upload-zone:hover .upload-icon {
    opacity: 1;
    transform: scale(1.1);
}

.upload-text {
    font-size: 0.95rem;
    color: #e0e6ed;
    margin: 0 0 8px 0;
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.upload-hint {
    font-size: 0.8rem;
    color: #8a8a9a;
    margin: 0 0 20px 0;
    line-height: 1.4;
}

.upload-btn {
    background: linear-gradient(135deg, #00d4aa 0%, #00b894 100%);
    border: none;
    color: #0f0f23;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 212, 170, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.upload-btn:hover {
    background: linear-gradient(135deg, #00b894 0%, #009c7a 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 212, 170, 0.4);
}

.upload-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(0, 212, 170, 0.3);
}

.upload-progress {
    margin-top: 16px;
    padding: 16px;
    background: rgba(0, 212, 170, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(0, 212, 170, 0.2);
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #2a2a3a;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 12px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #00d4aa, #00b894, #667eea);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 212, 170, 0.4);
    animation: progressShimmer 2s infinite;
}

@keyframes progressShimmer {
    0% {
        background-position: -200px 0;
    }

    100% {
        background-position: 200px 0;
    }
}

.progress-text {
    font-size: 0.85rem;
    color: #00d4aa;
    text-align: center;
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* 파일 탭 - 플랫 디자인으로 변경 */
.file-tabs {
    display: flex;
    background: #1a1a2e;
    border-bottom: 1px solid #3a3a4a;
    padding: 0;
    margin: 0;
    border-radius: 0;  /* 라운드 테두리 제거 */
    box-shadow: none;  /* 그림자 제거 */
    border: none;      /* 테두리 제거 */
}

.file-tab-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 4px 10px;  /* 더 컴팩트하게 축소 */
    background: #2a2a3a;
    border: none;
    border-right: 1px solid #3a3a4a;
    color: #a0a6b0;
    font-size: 0.72rem;  /* 폰트 크기 소폭 축소 */
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    border-radius: 0;  /* 라운드 테두리 제거 */
}

/* 플랫 디자인으로 변경 - ::before 제거 */

.file-tab-btn:last-child {
    border-right: none;
}

.file-tab-btn:hover {
    background: #3a3a4a;
    color: #e0e6ed;
}

.file-tab-btn.active {
    background: linear-gradient(135deg, #00d4aa 0%, #20c997 100%);
    color: #0a0a1a;
    font-weight: 600;
    border-radius: 0;  /* 라운드 제거 */
    position: relative;
    z-index: 1;
    border: none;
    box-shadow: none;  /* 그림자 제거 */
}



/* 파일 아이템 스타일 개선 */
.analysis-file-item {
    display: flex;
    align-items: flex-start;
    width: 100%;
    min-width: 0;
    padding: 8px 10px;
    margin-bottom: 6px;
    border-radius: 6px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    min-height: 50px;
}

.analysis-file-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent);
    transition: left 0.5s ease;
}

.analysis-file-item:hover::before {
    left: 100%;
}

/* 사용자 파일 스타일 */
.analysis-file-item.user-file {
    background: linear-gradient(135deg, rgba(0, 212, 170, 0.08) 0%, rgba(0, 184, 148, 0.05) 100%);
    border: 2px solid rgba(0, 212, 170, 0.2);
    border-left: 6px solid #00d4aa;
    box-shadow: 0 4px 15px rgba(0, 212, 170, 0.1);
}

.analysis-file-item.user-file:hover {
    background: linear-gradient(135deg, rgba(0, 212, 170, 0.15) 0%, rgba(0, 184, 148, 0.1) 100%);
    border-color: rgba(0, 212, 170, 0.4);
    border-left-color: #00b894;
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(0, 212, 170, 0.2);
}

/* 공유 파일 스타일 */
.analysis-file-item.shared-file {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(90, 103, 216, 0.05) 100%);
    border: 2px solid rgba(102, 126, 234, 0.2);
    border-left: 6px solid #667eea;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.1);
}

.analysis-file-item.shared-file:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(90, 103, 216, 0.1) 100%);
    border-color: rgba(102, 126, 234, 0.4);
    border-left-color: #5a67d8;
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(102, 126, 234, 0.2);
}



.analysis-file-item:hover {
    background: #1a1a2e;
    border-color: #00d4aa;
}

.analysis-file-item .file-checkbox {
    margin-right: 8px;
    accent-color: #00d4aa;
}

.analysis-file-item .file-info {
    flex: 1 1 auto;
    width: 100%;
    margin-left: 12px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    padding-right: 40px;
    /* 아이콘 공간 확보 */
}

.analysis-file-item .file-label {
    color: #e0e6ed;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 4px;
    cursor: pointer;
    line-height: 1.2;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    transition: color 0.2s ease;
    word-wrap: break-word;
    overflow-wrap: break-word;
    width: 100%;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.analysis-file-item.user-file:hover .file-label {
    color: #00d4aa;
}

.analysis-file-item.shared-file:hover .file-label {
    color: #667eea;
}

.analysis-file-item .file-meta {
    display: flex;
    gap: 8px;
    font-size: 0.68rem;
    color: #8a8a9a;
    align-items: center;
    flex-wrap: wrap;
}

.analysis-file-item .file-size {
    font-weight: 600;
}

.analysis-file-item.user-file .file-size {
    color: #00d4aa;
}

.analysis-file-item.shared-file .file-size {
    color: #667eea;
}

.analysis-file-item .file-type {
    text-transform: uppercase;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.65rem;
    letter-spacing: 0.5px;
}

.analysis-file-item.user-file .file-type {
    background: rgba(0, 212, 170, 0.15);
    color: #00d4aa;
    border: 1px solid rgba(0, 212, 170, 0.3);
}

.analysis-file-item.shared-file .file-type {
    background: rgba(102, 126, 234, 0.15);
    color: #667eea;
    border: 1px solid rgba(102, 126, 234, 0.3);
}

.analysis-file-item .file-date {
    opacity: 0.8;
    font-style: italic;
}

.analysis-file-item .file-source {
    font-weight: 700;
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.analysis-file-item.user-file .file-source {
    background: rgba(0, 212, 170, 0.2);
    color: #00d4aa;
    border: 1px solid rgba(0, 212, 170, 0.3);
}

.analysis-file-item.shared-file .file-source {
    background: rgba(102, 126, 234, 0.2);
    color: #667eea;
    border: 1px solid rgba(102, 126, 234, 0.3);
}

.analysis-file-item .file-actions {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-left: 8px;
    opacity: 0.8;
    transition: opacity 0.2s ease;
    align-self: center;
}

.analysis-file-item:hover .file-actions {
    opacity: 1;
}

.file-action-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #8a8a9a;
    padding: 6px;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 사용자 파일 액션 버튼 */
.analysis-file-item.user-file .file-action-btn:hover {
    background: rgba(0, 212, 170, 0.2);
    border-color: rgba(0, 212, 170, 0.4);
    color: #00d4aa;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 212, 170, 0.3);
}

.analysis-file-item.user-file .file-action-btn.delete-btn:hover {
    background: rgba(231, 76, 60, 0.2);
    border-color: rgba(231, 76, 60, 0.4);
    color: #e74c3c;
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

/* 공유 파일 액션 버튼 */
.analysis-file-item.shared-file .file-action-btn:hover {
    background: rgba(102, 126, 234, 0.2);
    border-color: rgba(102, 126, 234, 0.4);
    color: #667eea;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.shared-file-badge {
    position: absolute;
    top: 50px;
    right: 12px;
    background: linear-gradient(135deg, #667eea 0%, #5a67d8 100%);
    color: white;
    font-size: 0.55rem;
    padding: 3px 8px;
    border-radius: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: badgePulse 3s infinite;
}

@keyframes badgePulse {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 3px 10px rgba(102, 126, 234, 0.4);
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 5px 15px rgba(102, 126, 234, 0.6);
    }
}

/* 빈 상태 스타일 */
.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: #8a8a9a;
    border-radius: 12px;
    margin: 20px;
    border: 2px dashed #3a3a4a;
    position: relative;
    overflow: hidden;
}

/* 사용자 파일 빈 상태 */
.file-tabs .file-tab-btn[data-tab="user"].active~.analysis-files-list .empty-state {
    background: linear-gradient(135deg, rgba(0, 212, 170, 0.05) 0%, rgba(0, 184, 148, 0.02) 100%);
    border-color: rgba(0, 212, 170, 0.3);
}

/* 공유 파일 빈 상태 */
.file-tabs .file-tab-btn[data-tab="shared"].active~.analysis-files-list .empty-state {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(90, 103, 216, 0.02) 100%);
    border-color: rgba(102, 126, 234, 0.3);
}

.empty-state::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.03), transparent);
    animation: emptyShimmer 3s infinite;
}

@keyframes emptyShimmer {
    0% {
        left: -100%;
    }

    100% {
        left: 100%;
    }
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.6;
    animation: emptyIconFloat 4s ease-in-out infinite;
}

@keyframes emptyIconFloat {

    0%,
    100% {
        transform: translateY(0px) rotate(0deg);
    }

    25% {
        transform: translateY(-8px) rotate(2deg);
    }

    75% {
        transform: translateY(-8px) rotate(-2deg);
    }
}

.empty-text {
    font-size: 1.1rem;
    margin-bottom: 12px;
    color: #e0e6ed;
    font-weight: 700;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.empty-hint {
    font-size: 0.9rem;
    color: #8a8a9a;
    margin: 0;
    line-height: 1.6;
    max-width: 320px;
    margin: 0 auto;
    font-style: italic;
}
/* 파일 아이
템 스타일 */
.analysis-file-item {
    display: flex;
    align-items: center;
    padding: 12px;
    margin-bottom: 8px;
    background: #1a1a2e;
    border: 1px solid #3a3a4a;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.analysis-file-item:hover {
    background: #252540;
    border-color: #00d4aa;
}

.analysis-file-item.shared-file {
    border-left: 4px solid #667eea;
}

.analysis-file-item.user-file {
    border-left: 4px solid #00d4aa;
}

/* 체크박스 컨테이너 */
.checkbox-container {
    display: flex;
    align-items: center;
    margin-right: 12px;
    position: relative;
}

/* 체크박스 스타일 */
.checkbox-container input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    cursor: pointer;
    opacity: 0;
    position: absolute;
    z-index: 2;
}

.checkbox-container .checkmark {
    width: 18px;
    height: 18px;
    background: #2a2a3e;
    border: 2px solid #3a3a4a;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.checkbox-container input[type="checkbox"]:checked + .checkmark {
    background: #00d4aa;
    border-color: #00d4aa;
}

.checkbox-container input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.checkbox-container:hover .checkmark {
    border-color: #00d4aa;
}

/* 파일 정보 */
.file-info {
    flex: 1;
    min-width: 0;
}

.file-label {
    font-size: 14px;
    font-weight: 500;
    color: #e0e6ed;
    margin-bottom: 4px;
    width: 100%;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-meta {
    display: flex;
    gap: 8px;
    font-size: 11px;
    color: #8a8a9a;
    flex-wrap: wrap;
}

.file-meta span {
    white-space: nowrap;
}

.file-type {
    background: #3a3a4a;
    padding: 2px 6px;
    border-radius: 3px;
    text-transform: uppercase;
}

.file-source {
    font-weight: 500;
}

/* 파일 액션 버튼 */
.file-actions {
    display: flex;
    gap: 4px;
    margin-left: 8px;
}

.file-action-btn {
    width: 28px;
    height: 28px;
    background: transparent;
    border: 1px solid #3a3a4a;
    border-radius: 4px;
    color: #8a8a9a;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.2s ease;
}

.file-action-btn:hover {
    background: #3a3a4a;
    color: #e0e6ed;
}

.preview-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

.delete-btn:hover {
    border-color: #ff6b6b;
    color: #ff6b6b;
}

/* 공유 파일 배지 */
.shared-file-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: #667eea;
    color: white;
    font-size: 8px;
    padding: 2px 4px;
    border-radius: 2px;
    font-weight: bold;
}

/* 빈 상태 */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #8a8a9a;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-text {
    font-size: 14px;
    margin-bottom: 8px;
}

.empty-hint {
    font-size: 12px;
    opacity: 0.7;
}

/* 분석 파일 목록 */
.analysis-files-list {
    flex: 1;
    width: 100%;
    min-width: 0;
    overflow-y: auto;
    padding: 8px;
}

/* 스크롤바 스타일 */
.analysis-files-list::-webkit-scrollbar {
    width: 6px;
}

.analysis-files-list::-webkit-scrollbar-track {
    background: #1a1a2e;
}

.analysis-files-list::-webkit-scrollbar-thumb {
    background: #3a3a4a;
    border-radius: 3px;
}

.analysis-files-list::-webkit-scrollbar-thumb:hover {
    background: #4a4a5a;
}
/* 공유 파
일 삭제 버튼 (관리자 전용) */
.file-action-btn.delete-btn[id^="shared-delete-"] {
    background: #dc3545;
    border: 1px solid #c82333;
    color: white;
    opacity: 0.8;
    transition: all 0.2s ease;
}

.file-action-btn.delete-btn[id^="shared-delete-"]:hover {
    background: #c82333;
    border-color: #bd2130;
    opacity: 1;
    transform: scale(1.05);
}

.file-action-btn.delete-btn[id^="shared-delete-"]:before {
    content: "🔒";
    margin-right: 2px;
    font-size: 0.8em;
}

/* 공유 파일 아이템 스타일 개선 */
.analysis-file-item.shared-file {
    border-left: 3px solid #17a2b8;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

.analysis-file-item.shared-file .shared-file-badge {
    background: #17a2b8;
    color: white;
    font-size: 0.7em;
    padding: 2px 6px;
    border-radius: 10px;
    position: absolute;
    top: 5px;
    right: 5px;
    font-weight: bold;
}

/* 파일 추가 버튼 스타일 */
.analysis-action-btn.add-file-btn {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    border: 1px solid #28a745;
    color: white;
    font-weight: 500;
}

.analysis-action-btn.add-file-btn:hover {
    background: linear-gradient(135deg, #218838 0%, #1ea085 100%);
    border-color: #1e7e34;
}

/* 분석 파일 목록 헤더 (saved-results-header와 동일한 스타일) */
.analysis-files-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid #3a3a4a;
    background: #0f0f23;
    border-radius: 6px 6px 0 0;
    flex-shrink: 0;
}

.analysis-files-title {
    font-size: 0.85rem;
    font-weight: 500;
    color: #e0e6ed;
    margin: 0;
}

.analysis-actions {
    display: flex;
    gap: 8px;
}

.analysis-action-btn {
    background: #2a2a3a;
    border: 1px solid #4a4a5a;
    color: #e0e6ed;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 0.65rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.analysis-action-btn:hover {
    background: #3a3a4a;
    border-color: #00d4aa;
}/* 선택된 파
일 표시 영역 */
.selected-files-area {
    padding: 8px 16px;
    background: #1a1a2e;
    border-top: 1px solid #3a3a4a;
    border-bottom: 1px solid #3a3a4a;
}

.selected-files-container {
    display: flex;
    flex-wrap: nowrap; /* 한 줄만 표시 */
    gap: 6px;
    overflow-x: auto; /* 가로 스크롤 */
    overflow-y: hidden; /* 세로 스크롤 숨김 */
    align-items: center;
}

.selected-file-tag {
    display: inline-flex;
    align-items: center;
    background: linear-gradient(135deg, #2a2a3a 0%, #3a3a4a 100%);
    border: 1px solid #4a4a5a;
    border-radius: 12px;
    padding: 4px 8px;
    font-size: 0.75rem;
    color: #e0e6ed;
    max-width: 200px;
    transition: all 0.2s ease;
}

.selected-file-tag:hover {
    background: linear-gradient(135deg, #3a3a4a 0%, #4a4a5a 100%);
    border-color: #5a5a6a;
}

.selected-file-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 6px;
    font-weight: 500;
}

.selected-file-type {
    background: #00d4aa;
    color: #0a0a1a;
    padding: 1px 4px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 600;
    margin-right: 6px;
    text-transform: uppercase;
}

.selected-file-remove {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.selected-file-remove:hover {
    background: #c82333;
    transform: scale(1.1);
}

.selected-file-tag.shared-file {
    border-color: #17a2b8;
    background: linear-gradient(135deg, #16213e 0%, #1a2332 100%);
}

.selected-file-tag.shared-file .selected-file-type {
    background: #17a2b8;
}

/* 스크롤바 스타일 */
.selected-files-container::-webkit-scrollbar {
    width: 4px; /* 세로 스크롤 두께(대부분 숨김) */
    height: 6px; /* 가로 스크롤 두께 */
}

.selected-files-container::-webkit-scrollbar-track {
    background: #1a1a2e;
}

.selected-files-container::-webkit-scrollbar-thumb {
    background: #3a3a4a;
    border-radius: 2px;
}

.selected-files-container::-webkit-scrollbar-thumb:hover {
    background: #4a4a5a;
}/* 채팅 입력 영역
과 선택된 파일 영역 연결 */
.chat-input-area {
    border-top: none; /* 선택된 파일 영역과 자연스럽게 연결 */
}

.selected-files-area + .chat-input-area {
    border-top: none;
}

/* 선택된 파일이 없을 때 채팅 입력 영역 상단 테두리 복원 */
.selected-files-area[style*="display: none"] + .chat-input-area {
    border-top: 1px solid #3a3a4a;
}

/* 애니메이션 효과 */
.selected-file-tag {
    animation: slideIn 0.2s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.selected-files-area {
    transition: all 0.3s ease;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .selected-file-tag {
        max-width: 150px;
        font-size: 0.7rem;
    }
    
    .selected-files-container {
        max-height: 80px;
    }
}

/* 선택된 파일 개수 표시 개선 */
.selected-files-area::after {
    content: attr(data-count);
    position: absolute;
    top: 6px;
    right: 12px;
    background: #00d4aa;
    color: #0a0a1a;
    font-size: 0.65rem;
    padding: 3px 8px;
    border-radius: 10px;
    font-weight: 600;
    opacity: 0.9;
    pointer-events: none;
}

.selected-files-area {
    position: relative;
}

/* 탭 전환 시에도 선택 상태 유지를 시각적으로 표현 */
.file-tab-btn {
    position: relative;
}

.file-tab-btn::after {
    content: "";
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    background: #00d4aa;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.file-tab-btn.has-selected::after {
    opacity: 1;
}/*
 파일 탭 스타일 */
.file-tabs {
    display: flex;
    background: #1a1a2e;
    border-bottom: 1px solid #3a3a4a;
    padding: 0;
    margin: 0;
    overflow: hidden;
}

.file-tab-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 6px 10px; /* 컴팩트: 상하 6px */
    background: #2a2a3a;
    border: none;
    border-right: 1px solid #3a3a4a;
    color: #a0a6b0;
    font-size: 0.76rem; /* 약간 축소 */
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.file-tab-btn:last-child {
    border-right: none;
}

.file-tab-btn:hover {
    background: #3a3a4a;
    color: #e0e6ed;
}

.file-tab-btn.active {
    background: linear-gradient(135deg, #00d4aa 0%, #20c997 100%);
    color: #0a0a1a;
    font-weight: 600;
    border-radius: 0;
    position: relative;
    z-index: 1;
    border: none;
    outline: none;
}

.file-tab-icon {
    font-size: 0.85em; /* 아이콘도 소폭 축소 */
    opacity: 0.8;
}

.file-tab-btn.active .file-tab-icon {
    opacity: 1;
}

.file-tab-text {
    font-weight: inherit;
}

/* 선택된 파일 표시 점 (더 작은 크기) */
.file-tab-btn::after {
    content: "";
    position: absolute;
    top: 8px;
    right: 8px;
    width: 5px;
    height: 5px;
    background: #00d4aa;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 1;
}

.file-tab-btn.has-selected::after {
    opacity: 1;
}

/* 활성 탭의 선택 표시 점 */
.file-tab-btn.active.has-selected::after {
    background: #0a0a1a;
    box-shadow: 0 0 2px rgba(10, 10, 26, 0.3);
}

/* 반응형 디자인 */
@media (max-width: 480px) {
    .file-tab-btn {
        padding: 4px 6px; /* 모바일 더 컴팩트 */
        font-size: 0.7rem;
        gap: 3px;
    }
    
    .file-tab-icon {
        font-size: 0.75em;
    }
    
    .file-tab-text {
        display: none; /* 작은 화면에서는 텍스트 숨김 */
    }
}/* 모던한 체크
박스 스타일 */
.modern-checkbox {
    position: relative;
    display: inline-block;
}

.modern-checkbox input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.checkbox-indicator {
    width: 16px;
    height: 16px;
    border: 2px solid #4a4a5a;
    border-radius: 3px;
    background: transparent;
    position: relative;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.checkbox-indicator::after {
    content: "";
    width: 4px;
    height: 8px;
    border: solid #ffffff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) scale(0);
    transition: transform 0.2s ease;
}

.modern-checkbox input[type="checkbox"]:checked + .checkbox-label .checkbox-indicator {
    background: linear-gradient(135deg, #00d4aa 0%, #20c997 100%);
    border-color: #00d4aa;
    box-shadow: 0 2px 8px rgba(0, 212, 170, 0.3);
}

.modern-checkbox input[type="checkbox"]:checked + .checkbox-label .checkbox-indicator::after {
    transform: rotate(45deg) scale(1);
}

.modern-checkbox:hover .checkbox-indicator {
    border-color: #00d4aa;
    box-shadow: 0 0 0 2px rgba(0, 212, 170, 0.1);
}

/* 컴팩트한 파일 아이템 레이아웃 */
.analysis-file-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: #1a1a2e;
    border: 1px solid #3a3a4a;
    border-radius: 6px;
    margin-bottom: 4px;
    transition: all 0.2s ease;
    cursor: pointer;
    min-height: 44px;
    position: relative;
}

.analysis-file-item:hover {
    background: #2a2a3e;
    border-color: #4a4a5a;
}

.analysis-file-item.selected {
    background: linear-gradient(135deg, rgba(0, 212, 170, 0.1) 0%, rgba(32, 201, 151, 0.1) 100%);
    border-color: #00d4aa;
    box-shadow: 0 0 0 1px rgba(0, 212, 170, 0.2);
}

.file-selection {
    margin-right: 10px;
    flex-shrink: 0;
}

.file-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: hidden;
}

.file-main {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    flex: 1;
}

.file-name {
    font-weight: 500;
    color: #e0e6ed;
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    text-align: left;
    min-width: 0;
}

.file-type-badge {
    background: #00d4aa;
    color: #0a0a1a;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 1px 4px;
    border-radius: 3px;
    text-transform: uppercase;
    flex-shrink: 0;
}

.shared-badge {
    background: #17a2b8;
    color: white;
    font-size: 0.6rem;
    font-weight: 600;
    padding: 1px 4px;
    border-radius: 3px;
    flex-shrink: 0;
}

.file-details {
    display: flex;
    gap: 8px;
    font-size: 0.7rem;
    color: #a0a6b0;
}

.file-size, .file-date {
    font-size: 0.7rem;
    color: #a0a6b0;
}

.file-actions {
    position: absolute;
    bottom: 4px;
    right: 6px;
    display: flex;
    gap: 2px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.analysis-file-item:hover .file-actions {
    opacity: 1;
}

.file-action-btn {
    width: 18px;
    height: 18px;
    border: 1px solid #4a4a5a;
    background: rgba(42, 42, 58, 0.9);
    color: #e0e6ed;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.7rem;
    font-weight: bold;
    backdrop-filter: blur(4px);
}

.file-action-btn:hover {
    background: rgba(58, 58, 74, 0.95);
    border-color: #5a5a6a;
    transform: scale(1.1);
}

.preview-btn:hover {
    border-color: #00d4aa;
    color: #00d4aa;
    background: rgba(0, 212, 170, 0.2);
}

.delete-btn:hover {
    border-color: #dc3545;
    color: #dc3545;
    background: rgba(220, 53, 69, 0.2);
}

/* 최상단 고정 헤더 */
.top-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: #0f0f23;
    border-bottom: 1px solid #3a3a4a;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
    overflow: hidden;
}

.header-left {
    flex: 1;
    min-width: 0;
}

.header-right {
    flex-shrink: 0;
    margin-left: 20px;
}

.header-left .app-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #e0e6ed;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-right .user-info-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-right .user-info {
    color: #e0e6ed;
    font-size: 0.9rem;
    font-weight: 500;
}

.header-right .logout-btn {
    background: rgba(231, 76, 60, 0.1);
    border: 1px solid rgba(231, 76, 60, 0.2);
    color: #e74c3c;
    padding: 6px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    min-width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-right .logout-btn:hover {
    background: rgba(231, 76, 60, 0.2);
    border-color: rgba(231, 76, 60, 0.4);
    transform: scale(1.05);
}

/* 앱 컨테이너 상단 여백 추가 */
.app-container {
    margin-top: 60px;
    margin-bottom: 0; /* 하단 여백 제거 */
    height: calc(100vh - 100px); /* 헤더(60px) + 푸터(40px) 높이 빼기 */
}

/* 최하단 푸터 - 중복 제거됨, 하단에 통합된 스타일 사용 */

.footer-content p {
    color: #a0a6b0;
    font-size: 0.75rem;
    margin: 0;
    text-align: center;
}

/* 중앙 패널 chat-header 스타일 수정 (saved-results-header와 동일) */
.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border: 1px solid #3a3a4a;
    border-bottom: 1px solid #3a3a4a;
    background: #0f0f23;
    border-radius: 6px 6px 0 0;
    flex-shrink: 0;
}

.chat-title {
    font-size: 0.85rem;
    font-weight: 500;
    color: #e0e6ed;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.chat-title .icon {
    font-size: 0.9em;
}

/* 우측 패널 chart-header 스타일 수정 (saved-results-header와 동일) */
.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border: 1px solid #3a3a4a;
    border-bottom: 1px solid #3a3a4a;
    background: #0f0f23;
    border-radius: 6px 6px 0 0;
    flex-shrink: 0;
}

/* 우측 패널 전용 타이틀 말줄임 처리 (범위를 .chart-header로 한정) */
.chart-header .chart-title {
    font-size: 0.85rem;
    font-weight: 500;
    color: #e0e6ed;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 차트 카드 헤더 내 타이틀은 여러 줄 허용 */
.chart-header-wrapper .chart-title {
    white-space: pre-wrap;
    overflow: visible;
    text-overflow: unset;
}

.chart-icon {
    font-size: 0.9em;
}

/* 우측 chart-header 내 질문 말줄임 처리 */
.chart-header .chart-question {
    margin-left: 12px;
    flex: 1;
    color: #cfd8e3;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 우측 패널 tab-navigation 스타일 수정 (더 플랫하고 작게) */
.tab-navigation {
    display: flex;
    background: #1a1a2e;
    border-bottom: 1px solid #3a3a4a;
    padding: 0;
    margin: 0;
}

.tab-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 12px;
    background: #2a2a3a;
    border: none;
    border-right: 1px solid #3a3a4a;
    color: #a0a6b0;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab-btn:last-child {
    border-right: none;
}

.tab-btn:hover {
    background: #3a3a4a;
    color: #e0e6ed;
}

.tab-btn.active {
    background: linear-gradient(135deg, #00d4aa 0%, #20c997 100%);
    color: #0a0a1a;
    font-weight: 600;
}

.tab-icon {
    font-size: 0.8em;
    opacity: 0.8;
}

.tab-btn.active .tab-icon {
    opacity: 1;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .top-header {
        padding: 0 12px;
    }
    
    .header-left .app-title {
        font-size: 1rem;
    }
    
    .header-right .user-info {
        display: none;
    }
    
    .tab-btn {
        padding: 6px 8px;
        font-size: 0.7rem;
    }
    
    .tab-icon {
        font-size: 0.75em;
    }
}/* 전체 선택
 아이템 스타일 */
.select-all-item {
    display: flex;
    align-items: center;
    padding: 6px 12px;
    background: #0f0f23;
    border: 1px solid #3a3a4a;
    border-bottom: 1px solid #2a2a3a;
    margin-bottom: 2px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.8rem;
}

.select-all-item:hover {
    background: #1a1a2e;
    border-color: #4a4a5a;
}

.select-all-checkbox {
    margin-right: 10px;
    flex-shrink: 0;
}

.select-all-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 6px;
}

.select-all-text {
    color: #e0e6ed;
    font-weight: 500;
    font-size: 0.8rem;
}



/* 전체 선택 아이템의 체크박스 크기 조정 */
.select-all-item .checkbox-indicator {
    width: 14px;
    height: 14px;
    border-width: 1px;
}

.select-all-item .checkbox-indicator::after {
    width: 3px;
    height: 6px;
    border-width: 0 1.5px 1.5px 0;
}
/*
 차트 테마 컨트롤 */
.chart-theme-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.theme-control-btn {
    background: #2a2a3a;
    border: 1px solid #4a4a5a;
    border-radius: 6px;
    padding: 6px 10px;
    color: #e0e6ed;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
}

.theme-control-btn:hover {
    background: #3a3a4a;
    border-color: #00d4aa;
    transform: translateY(-1px);
}

.theme-control-btn:active {
    transform: scale(0.95);
}

.theme-control-select {
    background: #2a2a3a;
    border: 1px solid #4a4a5a;
    border-radius: 6px;
    padding: 6px 10px;
    color: #e0e6ed;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
    min-width: 120px;
    height: 32px;
}

.theme-control-select:hover {
    background: #3a3a4a;
    border-color: #00d4aa;
}

.theme-control-select:focus {
    outline: none;
    border-color: #00d4aa;
    box-shadow: 0 0 0 2px rgba(0, 212, 170, 0.2);
}

.theme-control-select option {
    background: #2a2a3a;
    color: #e0e6ed;
    padding: 4px 8px;
}

/* 라이트 테마에서의 테마 컨트롤 */
.light-theme .theme-control-btn {
    background: #f8f9fa;
    border-color: #d1d5db;
    color: #374151;
}

.light-theme .theme-control-btn:hover {
    background: #e5e7eb;
    border-color: #00d4aa;
}

.light-theme .theme-control-select {
    background: #f8f9fa;
    border-color: #d1d5db;
    color: #374151;
}

.light-theme .theme-control-select:hover {
    background: #e5e7eb;
    border-color: #00d4aa;
}

.light-theme .theme-control-select option {
    background: #ffffff;
    color: #374151;
}

/* 차트 헤더 래퍼 업데이트 - 테마 컨트롤 공간 확보 */
.chart-header-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #1a1a2e;
    border-bottom: 1px solid #3a3a4a;
}

.light-theme .chart-header-wrapper {
    background: #ffffff;
    border-bottom-color: #e1e5e9;
}/* 라이트 테마 추
가 스타일 */
/* 차트 전용 테마 스타일 - 전체 UI는 변경하지 않음 */

/* ApexCharts 라이트 테마 스타일 */
.light-theme .apexcharts-canvas {
    background: transparent !important;
}

.light-theme .apexcharts-tooltip {
    background: #ffffff !important;
    border: 1px solid #d1d5db !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1) !important;
}

.light-theme .apexcharts-tooltip-title {
    background: #f8f9fa !important;
    color: #2c3e50 !important;
    border-bottom: 1px solid #e1e5e9 !important;
}

.light-theme .apexcharts-tooltip-text {
    color: #2c3e50 !important;
}

.light-theme .apexcharts-legend-text {
    color: #2c3e50 !important;
}

.light-theme .apexcharts-xaxis-label,
.light-theme .apexcharts-yaxis-label {
    fill: #2c3e50 !important;
}

.light-theme .apexcharts-gridline {
    stroke: #e1e5e9 !important;
}/* 테마 컨트
롤 반응형 스타일 */
@media (max-width: 768px) {
    .chart-theme-controls {
        flex-direction: column;
        gap: 6px;
        align-items: stretch;
    }
    
    .theme-control-select {
        min-width: auto;
        width: 100%;
    }
    
    .theme-control-btn {
        min-width: auto;
        width: 100%;
        justify-content: center;
    }
}

/* 테마 컨트롤 애니메이션 */
.theme-control-btn,
.theme-control-select {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.theme-control-btn:hover {
    box-shadow: 0 2px 8px rgba(0, 212, 170, 0.3);
}

.theme-control-select:hover {
    box-shadow: 0 2px 8px rgba(0, 212, 170, 0.2);
}

/* 저장 버튼 특별 스타일 */
.save-chart {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
}

.save-chart:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    border-color: #764ba2;
    transform: translateY(-2px);
}

/* 모드 토글 버튼 특별 스타일 */
.mode-toggle {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border-color: #f093fb;
}

.mode-toggle:hover {
    background: linear-gradient(135deg, #f5576c 0%, #f093fb 100%);
    border-color: #f5576c;
}

/* 라이트 테마에서의 특별 스타일 */
.light-theme .save-chart {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.light-theme .mode-toggle {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

/* 차트 래퍼 호버 효과 */
.chart-wrapper {
    transition: all 0.3s ease;
}

.chart-wrapper:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.light-theme .chart-wrapper:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}/*
 ApexCharts 캔버스 배경 전환 애니메이션 */
.apexcharts-canvas,
.apexcharts-svg {
    transition: background-color 0.3s ease;
}

/* 라이트 모드 - ApexCharts 캔버스도 투명 배경 (PNG 저장 시 투명 보장) */
.chart-wrapper .apexcharts-canvas.light-mode,
.chart-wrapper .apexcharts-svg.light-mode {
    background-color: transparent !important;
}

/* 다크 모드 - ApexCharts 캔버스는 투명 배경 (기본값) */
.chart-wrapper .apexcharts-canvas.dark-mode,
.chart-wrapper .apexcharts-svg.dark-mode {
    background-color: transparent !important;
}

/* 전역 ApexCharts 캔버스 라이트 모드 스타일 - 투명 배경 */
.apexcharts-canvas[data-theme="light"],
.apexcharts-svg[data-theme="light"] {
    background-color: transparent !important;
}

/* 전역 ApexCharts 캔버스 다크 모드 스타일 */
.apexcharts-canvas[data-theme="dark"],
.apexcharts-svg[data-theme="dark"] {
    background-color: transparent !important;
}/* 
차트 컨테이너 및 컨트롤 스타일 */
.chart-wrapper {
    margin-bottom: 30px;
    background: var(--bg-secondary, #1a1a2e);
    border-radius: 8px;
    padding: 16px;
    border: 1px solid var(--border-color, #3a3a4a);
}

/* 차트 컨트롤을 상단에 별도 배치 */
.chart-controls-top {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    padding: 4px 0;
    border-bottom: 1px solid var(--border-color, #3a3a4a);
}

/* 차트 헤더 (제목만) */
.chart-header-wrapper {
    margin-bottom: 12px;
}

.chart-title {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary, #e0e6ed);
    line-height: 1.3;
}

/* 테마 컨트롤 버튼들 */
.theme-control-btn {
    background: var(--bg-tertiary, #2a2a3a);
    border: 1px solid var(--border-color, #3a3a4a);
    color: var(--text-primary, #e0e6ed);
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
    min-width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 저장 버튼 특별 스타일 (더 작게) */
.theme-control-btn.save-chart {
    min-width: 24px;
    height: 24px;
    padding: 2px 4px;
    font-size: 10px;
    opacity: 0.8;
}

.theme-control-btn.save-chart:hover {
    opacity: 1;
    transform: scale(1.05);
}

.theme-control-btn:hover {
    background: var(--bg-hover, #3a3a4a);
    border-color: var(--accent-color, #00d4aa);
}

.theme-control-select {
    background: var(--bg-tertiary, #2a2a3a);
    border: 1px solid var(--border-color, #3a3a4a);
    color: var(--text-primary, #e0e6ed);
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    min-width: 100px;
    height: 28px;
}

.theme-control-select:hover {
    border-color: var(--accent-color, #00d4aa);
}

.theme-control-select option {
    background: var(--bg-tertiary, #2a2a3a);
    color: var(--text-primary, #e0e6ed);
}

/* 차트 영역 */
.chart {
    background: transparent;
    border-radius: 6px;
    overflow: hidden;
}

/* ApexCharts 테마별 배경 - 모두 투명으로 설정 */
.apexcharts-canvas.light-mode,
.apexcharts-svg.light-mode {
    background-color: transparent !important;
}

.apexcharts-canvas.dark-mode,
.apexcharts-svg.dark-mode {
    background-color: transparent !important;
}/* 히트맵
 차트 데이터 라벨 스타일 */
.apexcharts-heatmap-series .apexcharts-datalabels text {
    font-weight: 600 !important;
    font-size: 10px !important;
}

/* 라이트 모드에서 히트맵 라벨 */
.apexcharts-canvas.light-mode .apexcharts-heatmap-series .apexcharts-datalabels text {
    fill: #1f2937 !important;
    text-shadow: 0 1px 1px rgba(255,255,255,0.8);
}

/* 다크 모드에서 히트맵 라벨 */
.apexcharts-canvas.dark-mode .apexcharts-heatmap-series .apexcharts-datalabels text {
    fill: #ffffff !important;
    text-shadow: 0 1px 2px rgba(0,0,0,0.6);
}

/* 히트맵 셀별 동적 텍스트 색상 (밝은 셀) */
.apexcharts-heatmap-series .apexcharts-datalabel-light text {
    fill: #1f2937 !important;
    text-shadow: 0 1px 1px rgba(255,255,255,0.8) !important;
}

/* 히트맵 셀별 동적 텍스트 색상 (어두운 셀) */
.apexcharts-heatmap-series .apexcharts-datalabel-dark text {
    fill: #ffffff !important;
    text-shadow: 0 1px 2px rgba(0,0,0,0.6) !important;
}/*
 차트 편집 모달 스타일 */
.chart-edit-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.chart-edit-modal-content {
    background-color: var(--bg-secondary, #1a1a2e);
    margin: 2% auto;
    padding: 24px;
    border: 1px solid var(--border-color, #3a3a4a);
    border-radius: 12px;
    width: 90%;
    max-width: 1200px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.chart-edit-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color, #3a3a4a);
}

.chart-edit-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary, #e0e6ed);
    margin: 0;
}

.chart-edit-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-secondary, #a0a6b0);
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.chart-edit-close:hover {
    background-color: var(--bg-hover, #3a3a4a);
    color: var(--text-primary, #e0e6ed);
}

.chart-edit-section {
    margin-bottom: 20px;
}

.chart-edit-section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary, #e0e6ed);
    margin-bottom: 10px;
}

.chart-edit-input {
    width: 100%;
    padding: 8px 12px;
    background: var(--bg-tertiary, #2a2a3a);
    border: 1px solid var(--border-color, #3a3a4a);
    border-radius: 6px;
    color: var(--text-primary, #e0e6ed);
    font-size: 14px;
    margin-bottom: 8px;
    transition: border-color 0.2s ease;
}

.chart-edit-input:focus {
    outline: none;
    border-color: var(--accent-color, #00d4aa);
}

.chart-edit-textarea {
    width: 100%;
    min-height: 200px;
    padding: 12px;
    background: var(--bg-tertiary, #2a2a3a);
    border: 1px solid var(--border-color, #3a3a4a);
    border-radius: 6px;
    color: var(--text-primary, #e0e6ed);
    font-size: 14px;
    font-family: 'Courier New', monospace;
    resize: vertical;
    transition: border-color 0.2s ease;
}

.chart-edit-textarea:focus {
    outline: none;
    border-color: var(--accent-color, #00d4aa);
}

.chart-edit-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color, #3a3a4a);
}

.chart-edit-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.chart-edit-btn-primary {
    background: var(--accent-color, #00d4aa);
    color: #ffffff;
}

.chart-edit-btn-primary:hover {
    background: var(--accent-hover, #00b894);
    transform: translateY(-1px);
}

.chart-edit-btn-secondary {
    background: var(--bg-tertiary, #2a2a3a);
    color: var(--text-primary, #e0e6ed);
    border: 1px solid var(--border-color, #3a3a4a);
}

.chart-edit-btn-secondary:hover {
    background: var(--bg-hover, #3a3a4a);
}

.chart-edit-help {
    font-size: 12px;
    color: var(--text-secondary, #a0a6b0);
    margin-top: 5px;
    line-height: 1.4;
}

/* 편집 버튼 스타일 */
.theme-control-btn.edit-chart {
    min-width: 24px;
    height: 24px;
    padding: 2px 4px;
    font-size: 10px;
    opacity: 0.8;
}

.theme-control-btn.edit-chart:hover {
    opacity: 1;
    transform: scale(1.05);
}/* 테이블 형태 
데이터 편집 UI */
.chart-data-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 15px;
    background: var(--bg-tertiary, #2a2a3a);
    border-radius: 8px;
    overflow: hidden;
}

.chart-data-table th {
    background: var(--bg-hover, #3a3a4a);
    color: var(--text-primary, #e0e6ed);
    padding: 12px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    border-bottom: 1px solid var(--border-color, #4a4a5a);
}

.chart-data-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-color, #3a3a4a);
}

.chart-data-table tr:last-child td {
    border-bottom: none;
}

.chart-data-table tr:hover {
    background: var(--bg-hover, rgba(255, 255, 255, 0.05));
}

.chart-table-input {
    width: 100%;
    padding: 6px 8px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    color: var(--text-primary, #e0e6ed);
    font-size: 14px;
    transition: all 0.2s ease;
}

.chart-table-input:focus {
    outline: none;
    background: var(--bg-secondary, #1a1a2e);
    border-color: var(--accent-color, #00d4aa);
}

.chart-table-input:hover {
    background: var(--bg-secondary, rgba(26, 26, 46, 0.5));
}

.chart-add-row-btn {
    background: var(--accent-color, #00d4aa);
    color: #ffffff;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    margin-right: 8px;
    transition: all 0.2s ease;
}

.chart-add-row-btn:hover {
    background: var(--accent-hover, #00b894);
    transform: translateY(-1px);
}

.chart-remove-row-btn {
    background: #ff6b6b;
    color: #ffffff;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.chart-remove-row-btn:hover {
    background: #ff5252;
    transform: scale(1.05);
}

.chart-edit-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color, #3a3a4a);
}

.chart-edit-tab {
    padding: 10px 20px;
    background: none;
    border: none;
    color: var(--text-secondary, #a0a6b0);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}

.chart-edit-tab.active {
    color: var(--accent-color, #00d4aa);
    border-bottom-color: var(--accent-color, #00d4aa);
}

.chart-edit-tab:hover {
    color: var(--text-primary, #e0e6ed);
}

.chart-edit-tab-content {
    display: none;
}

.chart-edit-tab-content.active {
    display: block;
}

.chart-series-container {
    margin-bottom: 20px;
}

.chart-series-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding: 10px;
    background: var(--bg-hover, #3a3a4a);
    border-radius: 6px;
}

.chart-series-name {
    font-weight: 600;
    color: var(--text-primary, #e0e6ed);
}

.chart-json-toggle {
    background: var(--bg-tertiary, #2a2a3a);
    color: var(--text-secondary, #a0a6b0);
    border: 1px solid var(--border-color, #3a3a4a);
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.chart-json-toggle:hover {
    color: var(--text-primary, #e0e6ed);
    border-color: var(--accent-color, #00d4aa);
}/* 트
리맵 차트 라벨 가독성 개선 */
.apexcharts-treemap-series .apexcharts-datalabels text {
    font-size: 16px !important;
    font-weight: 700 !important;
    fill: #ffffff !important;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.8));
}

/* 트리맵 라벨 첫 번째 줄 (항목명) 더 크게 */
.apexcharts-treemap-series .apexcharts-datalabels text:first-child {
    font-size: 18px !important;
    font-weight: 800 !important;
}

/* 트리맵 라벨 두 번째 줄 (값) 약간 작게 */
.apexcharts-treemap-series .apexcharts-datalabels text:nth-child(2) {
    font-size: 15px !important;
    font-weight: 600 !important;
    fill: rgba(255,255,255,0.95) !important;
}

/* 큰 셀의 라벨 더욱 크게 */
.apexcharts-treemap-series .apexcharts-datalabels[data-realindex="0"] text:first-child {
    font-size: 20px !important;
    font-weight: 900 !important;
}

.apexcharts-treemap-series .apexcharts-datalabels[data-realindex="0"] text:nth-child(2) {
    font-size: 16px !important;
}

/* 트리맵 전체 라벨 그룹 중앙 정렬 */
.apexcharts-treemap-series .apexcharts-datalabels {
    text-anchor: middle !important;
    dominant-baseline: central !important;
}

/* 트리맵 셀 테두리 강화 */
.apexcharts-treemap-series .apexcharts-treemap-rect {
    stroke: #ffffff !important;
    stroke-width: 2 !important;
}

/* 분석 파일 목록 섹션 - 유연한 높이 조정 */
.analysis-files-section {
    background: #1a1a2e;
    border-radius: 6px;
    border: 1px solid #3a3a4a;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex: 2;  /* 저장된 결과보다 더 많은 공간 차지 */
    min-height: 200px;  /* 최소 높이 설정 */
}

/* 분석 파일 목록 - 유연한 높이 조정 */
.analysis-files-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    min-height: 0;  /* 최소 높이를 0으로 설정하여 유연하게 조정 */
}

/* 왼쪽 패널 전체 레이아웃 - 플렉스 컨테이너로 설정 */
.left-panel {
    display: flex;
    flex-direction: column;
    height: 100%;  /* app-container 높이에 맞춤 */
    background: #0f0f23;
    border-right: 1px solid #3a3a4a;
    width: 320px;
    min-width: 280px;
    max-width: 500px;
    overflow: hidden;
    padding: 8px;  /* 모든 방향 동일한 패딩 */
}

/* 앱 컨테이너 - 플렉스 레이아웃 */
.app-container {
    display: flex;
    height: calc(100vh - 100px);  /* 헤더(60px) + 푸터(40px) 높이만큼 빼기 */
    margin-top: 60px;  /* 헤더 높이만큼 마진 */
    margin-bottom: 0;  /* 하단 여백 제거 */
    overflow: visible; /* 내부에서 가로 스크롤 표시 위해 컨테이너는 overflow 제한 해제 */
}

/* 중앙 패널 */
.center-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 400px;  /* 최소 너비 설정으로 레이아웃 안정성 확보 */
    background: #0f0f23;
    height: 100%;  /* app-container 높이에 맞춤 */
}

/* 오른쪽 패널 (있는 경우) */
.right-panel {
    width: 700px;  /* 기본 너비 */
    min-width: 400px;  /* 최소 너비 */
    max-width: calc(100vw - 320px - 6px - 400px); /* 좌측패널(320) + 핸들(6) + 중앙 최소(400)를 뺀 최대치 */
    background: #0f0f23;
    border-left: 1px solid #3a3a4a;
    height: 100%;  /* app-container 높이에 맞춤 */
    flex-shrink: 0;  /* 축소되지 않도록 설정 */
}

/* 하단 푸터 스타일 */
.bottom-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: #0f0f23;
    border-top: 1px solid #3a3a4a;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1100;  /* 리사이즈 핸들보다 위에 표시 */
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.2);
}

.footer-content {
    text-align: center;
}

.footer-content p {
    margin: 0;
    font-size: 0.75rem;
    color: #8a8a9a;
    font-weight: 400;
}

/* 통합된 리사이즈 핸들 스타일 - 중복 제거 및 높이 조정 */
.resize-handle {
    width: 6px !important;
    background: #3a3a4a !important;
    cursor: col-resize !important;
    position: relative !important;
    transition: background-color 0.2s !important;
    z-index: 1000 !important;
    user-select: none !important;
    height: calc(100vh - 100px) !important;  /* 헤더와 푸터를 제외한 높이 */
    flex-shrink: 0 !important;
    top: 0 !important;  /* 상단부터 시작 */
}

.resize-handle:hover {
    background: #00d4aa !important;
}

.resize-handle:active {
    background: #00b894 !important;
}

.resize-handle::after {
    content: '' !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 2px !important;
    height: 20px !important;
    background: #666 !important;
    border-radius: 1px !important;
    pointer-events: none !important;
}

.resize-handle:hover::after {
    background: #fff !important;
}

/* 세로 리사이즈 핸들 통합 스타일 */
.vertical-resize-handle {
    height: 6px !important;
    background: #3a3a4a !important;
    cursor: row-resize !important;
    position: relative !important;
    transition: background-color 0.2s !important;
    z-index: 900 !important;
    margin: 4px 0 !important;
    flex-shrink: 0 !important;
    user-select: none !important;
}

.vertical-resize-handle:hover {
    background: #00d4aa !important;
}

.vertical-resize-handle:active {
    background: #00b894 !important;
}

.vertical-resize-handle::after {
    content: '' !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 20px !important;
    height: 2px !important;
    background: #666 !important;
    border-radius: 1px !important;
    pointer-events: none !important;
}

.vertical-resize-handle:hover::after {
    background: #fff !important;
}/*
 채팅 입력 영역 - 푸터와 겹치지 않도록 조정 */
.chat-input-area {
    padding: 16px;
    background: #1a1a2e;
    border-top: 1px solid #3a3a4a;
    margin-bottom: 0;  /* 푸터 공간 확보 */
    flex-shrink: 0;
}

.question-form {
    width: 100%;
}

.input-group {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.question-input {
    flex: 1;
    min-height: 60px;
    max-height: 120px;
    padding: 12px 16px;
    background: #0f0f23;
    border: 1px solid #3a3a4a;
    border-radius: 8px;
    color: #e0e6ed;
    font-size: 0.9rem;
    font-family: inherit;
    resize: vertical;
    transition: all 0.3s ease;
}

.question-input:focus {
    outline: none;
    border-color: #00d4aa;
    box-shadow: 0 0 0 3px rgba(0, 212, 170, 0.1);
}

.question-input::placeholder {
    color: #8a8a9a;
}

.send-button {
    background: linear-gradient(135deg, #00d4aa 0%, #00b894 100%);
    border: none;
    color: #0f0f23;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 48px;
    white-space: nowrap;
}

.send-button:hover {
    background: linear-gradient(135deg, #00b894 0%, #009c7a 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 212, 170, 0.3);
}

.send-button:active {
    transform: translateY(0);
}

.send-button:disabled {
    background: #3a3a4a;
    color: #8a8a9a;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.send-icon {
    font-size: 1.1rem;
}/* 중앙 패널
 내부 레이아웃 조정 */
.center-panel {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
}

.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.chat-window {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    min-height: 0;
}

.chat-window::-webkit-scrollbar {
    width: 6px;
}

.chat-window::-webkit-scrollbar-track {
    background: #1a1a2e;
    border-radius: 3px;
}

.chat-window::-webkit-scrollbar-thumb {
    background: #3a3a4a;
    border-radius: 3px;
}

.chat-window::-webkit-scrollbar-thumb:hover {
    background: #4a4a5a;
}

/* 선택된 파일 영역 */
.selected-files-area {
    flex-shrink: 0;
    background: #1a1a2e;
    border-top: 1px solid #3a3a4a;
    border-bottom: 1px solid #3a3a4a;
}

/* 탭 네비게이션과 컨텐츠 */
.tab-navigation {
    flex-shrink: 0;
}

.tab-content {
    flex: 1;
    min-height: 0;
    overflow: hidden;
}/*
 Mixed 차트 Area 시리즈 그라데이션 효과 (CSS 백업) */
.apexcharts-series[seriesName*="area"] .apexcharts-area-series .apexcharts-series-markers-wrap,
.apexcharts-series[data-realIndex] .apexcharts-area-series {
    opacity: 0.7 !important;
}

/* Area 시리즈 그라데이션 효과 강화 */
.apexcharts-area-series .apexcharts-series-markers-wrap {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

/* Mixed 차트에서 Area 영역 투명도 조정 */
.apexcharts-mixed-chart .apexcharts-area-series {
    opacity: 0.6 !important;
}

/* Area 차트 그라데이션 애니메이션 */
.apexcharts-area-series {
    transition: opacity 0.3s ease !important;
}

.apexcharts-area-series:hover {
    opacity: 0.8 !important;
}/*
 TXT 직접 입력 기능 스타일 */
.txt-direct-input-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #3a3a4a;
    text-align: center;
}

.txt-direct-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: #ffffff;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 auto;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.txt-direct-btn:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.txt-direct-icon {
    font-size: 1.1rem;
}

/* TXT 입력 영역 */
.txt-input-area {
    margin-top: 20px;
    background: #0f0f23;
    border-radius: 12px;
    border: 1px solid #3a3a4a;
    overflow: hidden;
}

.txt-input-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: #1a1a2e;
    border-bottom: 1px solid #3a3a4a;
}

.txt-input-title {
    margin: 0;
    color: #e0e6ed;
    font-size: 1.1rem;
    font-weight: 600;
}

.back-btn {
    background: #3a3a4a;
    border: none;
    color: #e0e6ed;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.back-btn:hover {
    background: #4a4a5a;
    transform: translateX(-2px);
}

.back-icon {
    font-size: 1rem;
}

.txt-input-content {
    padding: 20px;
}

.txt-filename-section {
    margin-bottom: 16px;
}

.txt-filename-section label {
    display: block;
    margin-bottom: 6px;
    color: #e0e6ed;
    font-size: 0.9rem;
    font-weight: 500;
}

.txt-filename-input {
    width: 100%;
    padding: 10px 12px;
    background: #2a2a3a;
    border: 1px solid #3a3a4a;
    border-radius: 6px;
    color: #e0e6ed;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.txt-filename-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.txt-content-section {
    margin-bottom: 20px;
}

.txt-content-section label {
    display: block;
    margin-bottom: 6px;
    color: #e0e6ed;
    font-size: 0.9rem;
    font-weight: 500;
}

.txt-content-textarea {
    width: 100%;
    min-height: 200px;
    max-height: 400px;
    padding: 12px;
    background: #2a2a3a;
    border: 1px solid #3a3a4a;
    border-radius: 6px;
    color: #e0e6ed;
    font-size: 0.9rem;
    font-family: 'Courier New', monospace;
    line-height: 1.5;
    resize: vertical;
    transition: all 0.3s ease;
}

.txt-content-textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.txt-content-textarea::placeholder {
    color: #8a8a9a;
    font-style: italic;
}

.txt-input-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.txt-cancel-btn {
    background: #3a3a4a;
    border: none;
    color: #e0e6ed;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.txt-cancel-btn:hover {
    background: #4a4a5a;
}

.txt-insert-btn {
    background: linear-gradient(135deg, #00d4aa 0%, #00b894 100%);
    border: none;
    color: #0f0f23;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 212, 170, 0.3);
}

.txt-insert-btn:hover {
    background: linear-gradient(135deg, #00b894 0%, #009c7a 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 212, 170, 0.4);
}

.txt-insert-btn:disabled {
    background: #3a3a4a;
    color: #8a8a9a;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 사용자 지정 팔레트 편집 버튼 */
.theme-control-btn.palette-edit {
	background: var(--bg-tertiary, #2a2a3a);
}
.theme-control-btn.palette-edit:hover {
	background: var(--bg-hover, #3a3a4a);
	border-color: var(--accent-color, #00d4aa);
}

/* 색상 팔레트 모달 */
.color-palette-modal {
	position: fixed;
	inset: 0;
	z-index: 4000;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0,0,0,0.5);
}
.color-palette-modal-content {
	width: 520px;
	max-width: 90vw;
	background: #1a1a2e;
	border: 1px solid #4a4a5a;
	border-radius: 12px;
	box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.color-palette-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 16px;
	border-bottom: 1px solid #4a4a5a;
}
.color-palette-header h3 { margin: 0; color: #e0e6ed; font-size: 1rem; }
.color-palette-close { background: transparent; border: none; color: #cfd6e4; font-size: 1.2rem; cursor: pointer; }
.color-palette-body { padding: 16px; }
.color-palette-desc { color: #9aa3b2; margin: 0 0 10px 0; font-size: 0.9rem; }
.color-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 10px 12px;
}
.color-item { display: flex; align-items: center; gap: 10px; }
.color-item input[type="color"] { width: 44px; height: 34px; border: none; background: transparent; padding: 0; }
.color-item input[type="text"] {
	flex: 1;
	background: #0f0f23;
	color: #e0e6ed;
	border: 1px solid #3a3a4a;
	border-radius: 8px;
	padding: 8px 10px;
}
.color-palette-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px; border-top: 1px solid #4a4a5a; }
.color-palette-btn { background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.14); color: #cfd6e4; border-radius: 8px; padding: 8px 12px; cursor: pointer; }
.color-palette-btn.primary { background: linear-gradient(135deg, #00d4aa33, #00d4aa22); border-color: rgba(0,212,170,0.35); }

/* 차트 높이 조절 UI */
.chart-height-control {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 8px;
    background: rgba(26, 32, 44, 0.8);
    border-radius: 4px;
    margin: 2px 0 4px 0;
    font-size: 11px;
    color: #a0a6b0;
    border: 1px solid #3a3a4a;
    backdrop-filter: blur(4px);
    position: relative;
    z-index: 10;
    height: 28px;
}

.chart-height-slider-container {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    margin: 0 8px;
}

.chart-height-slider {
    flex: 1;
    height: 3px;
    background: #3a3a4a;
    border-radius: 2px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.chart-height-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    background: #00d4aa;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.2s;
}

.chart-height-slider::-webkit-slider-thumb:hover {
    background: #00b894;
}

.chart-height-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: #00d4aa;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    transition: background-color 0.2s;
}

.chart-height-slider::-moz-range-thumb:hover {
    background: #00b894;
}

.chart-height-value {
    min-width: 35px;
    text-align: center;
    font-weight: 500;
    color: #e0e6ed;
    font-size: 10px;
}

.chart-height-reset {
    background: #374151;
    border: 1px solid #4b5563;
    color: #d1d5db;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    cursor: pointer;
    transition: all 0.2s;
    height: 20px;
    line-height: 16px;
}

.chart-height-reset:hover {
    background: #4b5563;
    border-color: #6b7280;
    color: #f9fafb;
}

.chart-height-label {
    font-size: 10px;
    color: #9ca3af;
    white-space: nowrap;
    min-width: 20px;
}