/* 전역 스타일 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Apple SD Gothic Neo', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #1f2937;
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
    box-sizing: border-box;
}

/* 헤더 */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem 0;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1rem;
    opacity: 0.9;
    font-weight: 300;
}

/* 컨트롤 패널 */
.control-panel {
    background: white;
    padding: 1.5rem 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.checkbox-group {
    display: flex;
    gap: 2rem;
    justify-content: center;
    align-items: center;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.checkbox-label:hover {
    background: #f3f4f6;
    border-color: #667eea;
    transform: translateY(-2px);
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #667eea;
}

.checkbox-text {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.checkbox-text strong {
    font-size: 1rem;
    color: #1f2937;
}

.checkbox-text small {
    font-size: 0.875rem;
    color: #6b7280;
}

/* 메인 콘텐츠 */
.main-content {
    padding: 2rem 0;
    width: 100%;
    overflow-x: hidden;
}

.chart-section {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    animation: fadeIn 0.6s ease;
    width: 100%;
    box-sizing: border-box;
}

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

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 3px solid #667eea;
}

/* 차트 컨테이너 */
.chart-container {
    position: relative;
    width: 100%;
    height: 500px;
    max-height: 500px;
    margin-bottom: 1rem;
}

.chart-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 2rem;
    margin-bottom: 1rem;
}

.chart-grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.chart-item {
    background: #f9fafb;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    width: 100%;
    overflow: hidden;
}

.chart-item h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 1rem;
    text-align: center;
}

.chart-item canvas {
    width: 100% !important;
    height: 350px !important;
    max-height: 350px;
}

/* AI 분석 카드 */
.analysis-card {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
    border-left: 4px solid #f59e0b;
    font-size: 0.875rem;
}

.analysis-section {
    margin-bottom: 0.75rem;
}

.analysis-section:last-child {
    margin-bottom: 0;
}

.analysis-section h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: #92400e;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.analysis-section ul {
    list-style: none;
    padding: 0;
}

.analysis-section li {
    padding: 0.35rem 0;
    color: #78350f;
    font-size: 0.85rem;
    line-height: 1.5;
    border-bottom: 1px solid rgba(245, 158, 11, 0.15);
}

.analysis-section li:last-child {
    border-bottom: none;
}

/* 빈 상태 */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: #9ca3af;
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.empty-state h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 0.5rem;
}

.empty-state p {
    font-size: 1rem;
    color: #9ca3af;
}

/* 푸터 */
.footer {
    background: rgba(255, 255, 255, 0.95);
    padding: 2rem 0;
    text-align: center;
    color: #6b7280;
    margin-top: 2rem;
}

.footer p {
    margin: 0.5rem 0;
    font-size: 0.875rem;
}

.note {
    font-style: italic;
    color: #9ca3af;
}

/* 반응형 */
@media (max-width: 768px) {
    .header h1 {
        font-size: 1.5rem;
    }

    .subtitle {
        font-size: 0.875rem;
    }

    .checkbox-group {
        flex-direction: column;
        gap: 1rem;
    }

    .checkbox-label {
        width: 100%;
    }

    .chart-grid,
    .chart-grid-3 {
        grid-template-columns: 1fr;
    }

    .chart-container {
        height: 350px;
        max-height: 350px;
    }

    .chart-item canvas {
        width: 100% !important;
        height: 280px !important;
        max-height: 280px;
    }

    .section-title {
        font-size: 1.25rem;
    }
}

@media (min-width: 769px) and (max-width: 1400px) {
    .chart-grid {
        grid-template-columns: 1fr;
    }
    
    .chart-grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1401px) {
    .chart-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .chart-grid-3 {
        grid-template-columns: repeat(3, 1fr);
    }
}
