/* 색상 테마 설정 */
:root {
    --bg-primary: #f8f9fa;
    --bg-secondary: #ffffff;
    --bg-surface: #f1f3f5;
    --border-primary: #3350b4;
    --border-secondary: #5c7cfa;
    --text-primary: #212529;
    --text-secondary: #495057;
    --accent-primary: #3350b4;
    --accent-secondary: #4c6ef5;
    --accent-warning: #f59f00;
    --accent-danger: #f03e3e;
    --accent-success: #51cf66;
    --accent-info: #339af0;
    --shadow-primary: rgba(51, 80, 180, 0.1);
    --shadow-secondary: rgba(51, 80, 180, 0.05);
    --gradient-primary: linear-gradient(135deg, #3350b4 0%, #5c7cfa 100%);
    --gradient-secondary: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Inter', 'Noto Sans KR', sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
}

/* 헤더 스타일 */
.main-header {
    background: var(--bg-secondary);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px var(--shadow-primary);
}

.header-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

.header-top {
    padding: 1rem 0 .5rem 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-title-section {
    flex: 1;
}

h1 {
    color: var(--accent-primary);
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

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

/* 진행률 표시 */
.progress-indicator {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.progress-bar {
    width: 120px;
    height: 6px;
    background: var(--bg-surface);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: var(--accent-primary);
    border-radius: 3px;
    transition: all 0.3s ease;
    width: 0%;
}

/* 네비게이션 바 */
.nav-container {
    background: rgba(245, 247, 250, 1);
    padding: 0;
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
}

.nav-container::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(0, 0, 0, 0.05);
}

.nav-items {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    gap: 0;
    position: relative;
}

/* 움직이는 인디케이터 */
.nav-indicator{
    position:absolute;
    bottom:0;
    height:3px;
    width:0;
    left:0;
    background:var(--accent-primary);
    transition:all .25s cubic-bezier(.4,0,.2,1);
    z-index:10;
}

/* 탭 주변 불필요한 공백 제거 */
.main-content{margin:1rem auto;padding:0 2rem;}

.nav-item {
    flex: 1;
    text-align: center;
    padding: 0.8rem 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.85rem;
    color: var(--text-secondary);
    position: relative;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-item:hover {
    color: var(--accent-primary);
    background: rgba(51, 80, 180, 0.05);
}

.nav-item.active {
    font-weight: 600;
}

/* 각 nav-item의 색상을 활용 */
.nav-item[data-color="#3350b4"]:hover { background: rgba(51, 80, 180, 0.08); color: #3350b4; }
.nav-item[data-color="#1c7ed6"]:hover { background: rgba(28, 126, 214, 0.08); color: #1c7ed6; }
.nav-item[data-color="#2f9e44"]:hover { background: rgba(47, 158, 68, 0.08); color: #2f9e44; }
.nav-item[data-color="#f59f00"]:hover { background: rgba(245, 159, 0, 0.08); color: #f59f00; }
.nav-item[data-color="#862e9c"]:hover { background: rgba(134, 46, 156, 0.08); color: #862e9c; }
.nav-item[data-color="#e03131"]:hover { background: rgba(224, 49, 49, 0.08); color: #e03131; }
.nav-item[data-color="#495057"]:hover { background: rgba(73, 80, 87, 0.08); color: #495057; }

.nav-item[data-color="#3350b4"].active { background: rgba(51, 80, 180, 0.12); color: #3350b4; }
.nav-item[data-color="#1c7ed6"].active { background: rgba(28, 126, 214, 0.12); color: #1c7ed6; }
.nav-item[data-color="#2f9e44"].active { background: rgba(47, 158, 68, 0.12); color: #2f9e44; }
.nav-item[data-color="#f59f00"].active { background: rgba(245, 159, 0, 0.12); color: #f59f00; }
.nav-item[data-color="#862e9c"].active { background: rgba(134, 46, 156, 0.12); color: #862e9c; }
.nav-item[data-color="#e03131"].active { background: rgba(224, 49, 49, 0.12); color: #e03131; }
.nav-item[data-color="#495057"].active { background: rgba(73, 80, 87, 0.12); color: #495057; }

/* 네비게이션 아이콘 */
.nav-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-right: 6px;
    vertical-align: middle;
}

/* 반응형 네비게이션 */
@media (max-width: 1200px) {
    .nav-item {
        font-size: 0.75rem;
        padding: 0.8rem 0.3rem;
    }
    
    .nav-icon {
        display: none;
    }
}

@media (max-width: 768px) {
    .header-top {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .progress-indicator {
        width: 100%;
    }
    
    .nav-item {
        font-size: 0.65rem;
        padding: 0.7rem 0.2rem;
    }
}

@media (max-width: 480px) {
    .nav-item {
        font-size: 0.6rem;
        padding: 0.6rem 0.1rem;
    }
}

/* 메인 콘텐츠 */
.main-content {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 2rem;
}

/* LOS 섹션 */
.los-section {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 2.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 20px var(--shadow-secondary);
    border: 1px solid #e9ecef;
    position: relative;
    overflow: hidden;
}

.los-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 5px;
    height: 100%;
    background: var(--gradient-primary);
}

.los-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.los-title {
    color: var(--accent-primary);
    font-size: 1.3rem;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
}

.difficulty-badge {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
}

.difficulty-easy {
    background: rgba(81, 207, 102, 0.1);
    color: var(--accent-success);
    border: 1px solid var(--accent-success);
}

.difficulty-medium {
    background: rgba(245, 159, 0, 0.1);
    color: var(--accent-warning);
    border: 1px solid var(--accent-warning);
}

.difficulty-hard {
    background: rgba(240, 62, 62, 0.1);
    color: var(--accent-danger);
    border: 1px solid var(--accent-danger);
}

/* 개념 박스 */
.concept-box {
    background: var(--bg-surface);
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    border: 1px solid #e9ecef;
}

.concept-title {
    color: var(--accent-primary);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.concept-icon {
    width: 24px;
    height: 24px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.9rem;
}

/* 소크라테스식 대화 */
.socratic-dialogue {
    background: linear-gradient(135deg, rgba(51, 80, 180, 0.05) 0%, rgba(51, 80, 180, 0.02) 100%);
    border-left: 4px solid var(--accent-info);
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.socratic-question {
    color: var(--accent-info);
    font-weight: 600;
    margin-bottom: 0.8rem;
    font-size: 1.05rem;
}

.socratic-answer {
    color: var(--text-primary);
    padding-left: 1.5rem;
    line-height: 1.8;
}

/* 테이블 스타일 */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    background: var(--bg-secondary);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px var(--shadow-secondary);
}

.data-table th {
    background: var(--gradient-primary);
    color: white;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.95rem;
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid #e9ecef;
    font-size: 0.95rem;
}

.data-table tr:hover {
    background: var(--bg-surface);
}

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

/* 문제 박스 */
.quiz-box {
    background: var(--bg-secondary);
    border: 2px solid var(--border-secondary);
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0;
    position: relative;
    transition: all 0.3s ease;
}

.quiz-box:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 6px 25px var(--shadow-primary);
    transform: translateY(-2px);
}

.quiz-number {
    position: absolute;
    top: -15px;
    left: 20px;
    background: var(--accent-primary);
    color: white;
    padding: 0.3rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
}

.quiz-question {
    margin-bottom: 1.5rem;
    font-weight: 500;
    line-height: 1.7;
}

.quiz-options {
    list-style: none;
    padding: 0;
}

.quiz-option {
    padding: 0.8rem 1rem;
    margin: 0.5rem 0;
    background: var(--bg-surface);
    border-radius: 8px;
    border: 1px solid #e9ecef;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quiz-option:hover {
    background: rgba(51, 80, 180, 0.05);
    border-color: var(--accent-primary);
    transform: translateX(5px);
}

/* 정답 박스 */
.answer-box {
    background: linear-gradient(135deg, rgba(81, 207, 102, 0.1) 0%, rgba(81, 207, 102, 0.05) 100%);
    border: 2px solid var(--accent-success);
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    position: relative;
}

.answer-label {
    position: absolute;
    top: -12px;
    left: 20px;
    background: var(--bg-secondary);
    padding: 0 0.8rem;
    color: var(--accent-success);
    font-weight: 600;
    font-size: 0.9rem;
}

/* 공식 박스 */
.formula-box {
    background: var(--bg-surface);
    border: 1px solid var(--border-secondary);
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    text-align: center;
    font-size: 1.1rem;
}

/* 경고 박스 */
.alert {
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    border-radius: 8px;
    border-left: 4px solid;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.alert-icon {
    font-size: 1.2rem;
}

.alert-danger {
    background: rgba(240, 62, 62, 0.1);
    border-color: var(--accent-danger);
    color: var(--accent-danger);
}

.alert-info {
    background: rgba(51, 154, 240, 0.1);
    border-color: var(--accent-info);
    color: var(--accent-info);
}

.alert-warning {
    background: rgba(245, 159, 0, 0.1);
    border-color: var(--accent-warning);
    color: var(--accent-warning);
}

/* 키 포인트 */
.key-points {
    background: linear-gradient(135deg, var(--bg-surface) 0%, var(--bg-secondary) 100%);
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0;
    border: 1px solid #e9ecef;
}

.key-points-title {
    color: var(--accent-primary);
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.key-point-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin: 1rem 0;
    padding: 0.8rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.key-point-number {
    background: var(--gradient-primary);
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    flex-shrink: 0;
}

/* 그래프 컨테이너 */
.chart-container {
    margin: 2rem 0;
    padding: 1.5rem;
    background: var(--bg-surface);
    border-radius: 12px;
    border: 1px solid #e9ecef;
    position: relative;
}

.chart-wrapper {
    position: relative;
    height: 400px;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
}

.chart-wrapper canvas {
    position: absolute;
    left: 0;
    top: 0;
    width: 100% !important;
    height: 100% !important;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
}

.chart-title {
    color: var(--accent-primary);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    text-align: center;
}

/* 예제 박스 */
.example-box {
    background: linear-gradient(135deg, rgba(51, 154, 240, 0.05) 0%, rgba(51, 154, 240, 0.02) 100%);
    border: 1px solid var(--accent-info);
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.example-title {
    color: var(--accent-info);
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.example-icon {
    width: 20px;
    height: 20px;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .header-top {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        padding: 1rem 0 0.5rem 0;
    }
    
    h1 {
        font-size: 1.3rem;
        line-height: 1.3;
    }
    
    .subtitle {
        font-size: 0.85rem;
    }
    
    .progress-indicator {
        width: 100%;
        font-size: 0.8rem;
    }
    
    .nav-items {
        padding: 0 1rem;
    }
    
    .nav-item {
        font-size: 0.7rem;
        padding: 0.8rem 0.3rem;
    }
    
    .los-section {
        padding: 1.5rem;
    }
    
    .data-table {
        font-size: 0.85rem;
    }
    
    .data-table th,
    .data-table td {
        padding: 0.7rem;
    }
    
    .chart-wrapper {
        height: 250px;
    }
}

@media (max-width: 480px) {
    .chart-wrapper {
        height: 200px;
    }
}

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

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

/* 스크롤바 스타일 */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-secondary);
}track {
    background: var(--bg-surface);
}

::-webkit-scrollbar-thumb {
    background: var(--accent-primary);
    border-radius: 5px;
}

::-webkit-scrollbar-