/**
 * HR 조직역량 서베이 분석 시스템 - 스타일시트
 */

/* 기본 설정 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4A90E2;
    --secondary-color: #2E5C8A;
    --success-color: #2F9E44;
    --danger-color: #C92A2A;
    --warning-color: #F59F00;
    --light-bg: #F8F9FA;
    --border-color: #DEE2E6;
    --text-primary: #212529;
    --text-secondary: #6C757D;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.15);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.2);
}

body {
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

/* 헤더 */
.header {
    background: white;
    border-radius: 16px;
    padding: 40px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.header-content h1 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 10px;
    font-weight: 700;
}

.header-content h1 i {
    margin-right: 15px;
    color: #667eea;
}

.subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-weight: 400;
}

/* 섹션 헤더 */
.section-header {
    margin-bottom: 25px;
}

.section-header h2 {
    font-size: 1.8rem;
    color: var(--text-primary);
    margin-bottom: 8px;
    font-weight: 600;
}

.section-header h2 i {
    margin-right: 12px;
    color: var(--primary-color);
}

.section-header p {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* 업로드 섹션 */
.upload-section {
    background: white;
    border-radius: 16px;
    padding: 40px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-md);
}

.upload-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.upload-item {
    position: relative;
}

.upload-label {
    display: block;
    cursor: pointer;
}

.year-label {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
    font-size: 1rem;
}

.year-label i {
    color: var(--success-color);
    margin-right: 8px;
}

.file-input {
    display: none;
}

.upload-box {
    border: 3px dashed var(--border-color);
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    transition: all 0.3s ease;
    background: var(--light-bg);
}

.upload-box:hover {
    border-color: var(--primary-color);
    background: rgba(74, 144, 226, 0.05);
    transform: translateY(-2px);
}

.upload-box.dragover {
    border-color: var(--primary-color);
    background: rgba(74, 144, 226, 0.1);
    transform: scale(1.02);
}

.upload-box.file-selected {
    border-color: var(--success-color);
    background: rgba(47, 158, 68, 0.05);
}

.upload-box i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 15px;
    display: block;
}

.upload-box p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.upload-box .file-name {
    display: block;
    margin-top: 10px;
    color: var(--success-color);
    font-weight: 600;
    font-size: 0.9rem;
    word-break: break-all;
}

/* 분석 버튼 */
.btn-analyze {
    width: 100%;
    max-width: 400px;
    display: block;
    margin: 0 auto;
    padding: 18px 40px;
    font-size: 1.2rem;
    font-weight: 600;
    color: white;
    background: var(--text-secondary);
    border: none;
    border-radius: 12px;
    cursor: not-allowed;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.btn-analyze.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    cursor: pointer;
}

.btn-analyze.active:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-analyze i {
    margin-right: 10px;
}

/* 결과 섹션 */
.results-section {
    background: white;
    border-radius: 16px;
    padding: 40px;
    box-shadow: var(--shadow-md);
}

/* 탭 메뉴 */
.tab-menu {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 2px solid var(--border-color);
    flex-wrap: wrap;
}

.tab-btn {
    padding: 15px 30px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    bottom: -2px;
}

.tab-btn:hover {
    color: var(--primary-color);
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-btn i {
    margin-right: 8px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

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

/* 연도 선택기 */
.year-selector {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.year-btn {
    padding: 12px 24px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    background: var(--light-bg);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.year-btn:hover {
    border-color: var(--primary-color);
    background: rgba(74, 144, 226, 0.1);
}

.year-btn.active {
    color: white;
    background: var(--primary-color);
    border-color: var(--primary-color);
}

/* 분석 통계 정보 */
.analysis-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    padding: 20px;
    background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
    border-radius: 12px;
    border: 2px solid var(--primary-color);
    flex-wrap: wrap;
}

.stat-box {
    flex: 1;
    min-width: 150px;
    text-align: center;
    padding: 15px;
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
}

.stat-box .stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.stat-box .stat-desc {
    display: block;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.stat-box.filtered .stat-number {
    color: var(--danger-color);
}

.stat-box.valid .stat-number {
    color: var(--success-color);
}

/* 다운로드 버튼 */
.download-buttons {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.btn-download {
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

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

.btn-download i {
    margin-right: 8px;
}

.btn-download:disabled {
    background: var(--text-secondary);
    cursor: not-allowed;
    transform: none;
}

/* 마인드맵 */
.mindmap-container {
    position: relative;
    background: var(--light-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 30px;
    overflow: hidden;
}

.mindmap {
    width: 100%;
    height: 700px;
}

.mindmap-controls {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.control-btn {
    width: 45px;
    height: 45px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.control-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.1);
}

.control-btn i {
    font-size: 1.1rem;
}

/* 토픽 상세 정보 */
.topic-detail {
    background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
    border: 2px solid var(--primary-color);
    border-radius: 12px;
    padding: 30px;
    margin-top: 30px;
}

.topic-title {
    font-size: 1.6rem;
    color: var(--primary-color);
    margin-bottom: 20px;
    font-weight: 700;
}

.topic-stats {
    display: flex;
    gap: 30px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 25px;
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
}

.stat-item i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-right: 8px;
}

.stat-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
}

.topic-keywords {
    margin-bottom: 25px;
}

.topic-keywords h4 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.keyword-tag {
    display: inline-block;
    padding: 8px 16px;
    margin: 5px;
    background: white;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
}

.keyword-tag .freq {
    color: var(--text-secondary);
    font-weight: 400;
}

.no-keywords {
    text-align: center;
    color: var(--text-secondary);
    padding: 20px;
    font-style: italic;
}

.topic-responses h4 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.response-list {
    list-style: none;
}

.response-list li {
    padding: 15px;
    margin-bottom: 10px;
    background: white;
    border-left: 4px solid var(--primary-color);
    border-radius: 8px;
    line-height: 1.7;
    box-shadow: var(--shadow-sm);
}

.response-num {
    display: inline-block;
    width: 28px;
    height: 28px;
    line-height: 28px;
    text-align: center;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    margin-right: 12px;
    font-weight: 700;
    font-size: 0.85rem;
}

/* 비교 분석 */
.comparison-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.chart-container {
    background: var(--light-bg);
    padding: 30px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.topic-evolution h3 {
    font-size: 1.4rem;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.evolution-topic {
    margin-bottom: 25px;
    padding: 20px;
    background: var(--light-bg);
    border-radius: 8px;
}

.evolution-topic h4 {
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.evolution-item {
    padding: 12px 16px;
    margin-bottom: 8px;
    background: white;
    border-radius: 6px;
    border-left: 4px solid;
}

.evolution-item.increase {
    border-left-color: var(--success-color);
}

.evolution-item.decrease {
    border-left-color: var(--danger-color);
}

.evolution-item i {
    margin-right: 10px;
}

.evolution-item.increase i {
    color: var(--success-color);
}

.evolution-item.decrease i {
    color: var(--danger-color);
}

.no-change {
    text-align: center;
    color: var(--text-secondary);
    padding: 40px;
    font-style: italic;
}

/* 원본 데이터 */
.rawdata-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.search-input {
    flex: 1;
    min-width: 250px;
    padding: 12px 18px;
    font-size: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.3s ease;
    font-family: 'Noto Sans KR', sans-serif;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.filter-select {
    padding: 12px 18px;
    font-size: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Noto Sans KR', sans-serif;
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.rawdata-table-container {
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: white;
    max-height: 600px;
    overflow-y: auto;
}

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

.rawdata-table thead {
    background: var(--primary-color);
    color: white;
    position: sticky;
    top: 0;
    z-index: 10;
}

.rawdata-table th {
    padding: 16px;
    text-align: left;
    font-weight: 600;
    font-size: 0.95rem;
}

.rawdata-table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s ease;
}

.rawdata-table tbody tr:hover {
    background: rgba(74, 144, 226, 0.05);
}

.rawdata-table td {
    padding: 14px 16px;
    font-size: 0.9rem;
}

.topic-badge {
    display: inline-block;
    padding: 6px 12px;
    background: var(--primary-color);
    color: white;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.response-text {
    line-height: 1.6;
    max-width: 600px;
}

.no-data {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
    font-style: italic;
}

/* 로딩 오버레이 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-spinner {
    text-align: center;
    color: white;
}

.loading-spinner i {
    font-size: 4rem;
    margin-bottom: 20px;
    display: block;
}

.loading-spinner p {
    font-size: 1.3rem;
    margin-bottom: 10px;
    font-weight: 600;
}

.loading-detail {
    font-size: 1rem;
    color: #ccc;
    font-weight: 400;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .header {
        padding: 25px;
    }

    .header-content h1 {
        font-size: 1.8rem;
    }

    .subtitle {
        font-size: 0.95rem;
    }

    .upload-section,
    .results-section {
        padding: 25px;
    }

    .upload-container {
        grid-template-columns: 1fr;
    }

    .tab-menu {
        flex-direction: column;
    }

    .tab-btn {
        width: 100%;
        text-align: left;
    }

    .mindmap {
        height: 500px;
    }

    .topic-stats {
        flex-direction: column;
    }

    .rawdata-controls {
        flex-direction: column;
    }

    .search-input,
    .filter-select {
        width: 100%;
    }

    .chart-container {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .header-content h1 {
        font-size: 1.5rem;
    }

    .section-header h2 {
        font-size: 1.3rem;
    }

    .mindmap {
        height: 400px;
    }
}

/* 유틸리티 클래스 */
.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
.text-center { text-align: center; }
.text-muted { color: var(--text-secondary); }
