/* === 기본 스타일 리셋 및 변수 === */
:root {
    --primary-blue: #2196F3;
    --primary-blue-dark: #1976D2;
    --primary-blue-light: #64B5F6;
    --text-dark: #333333;
    --text-gray: #666666;
    --text-light: #999999;
    --bg-white: #FFFFFF;
    --bg-light: #F8F9FA;
    --bg-gray: #E9ECEF;
    --border-color: #DEE2E6;
    --success-green: #28A745;
    --error-red: #DC3545;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
    min-height: 100vh;
}

/* === 컨테이너 === */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
}

/* === 화면 전환 === */
.screen {
    display: none;
    animation: fadeIn 0.3s ease;
}

.screen.active {
    display: block;
}

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

/* === 홈 화면 === */
/* 로고 */
.logo-container {
    text-align: center;
    margin-bottom: 30px;
}

.logo {
    max-width: 280px;
    width: 100%;
    height: auto;
}

/* 제목 섹션 */
.title-section {
    text-align: center;
    margin-bottom: 30px;
    padding: 30px 20px;
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.subtitle {
    font-size: 14px;
    color: var(--primary-blue);
    font-weight: 500;
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.main-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.author {
    font-size: 14px;
    color: var(--text-gray);
    font-weight: 400;
}

/* 설명 문구 */
.description {
    text-align: center;
    padding: 20px;
    margin-bottom: 30px;
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-dark) 100%);
    border-radius: var(--radius-md);
    color: white;
}

.description p {
    font-size: 14px;
    line-height: 1.8;
    font-weight: 300;
}

/* 문제 유형 선택 */
.type-selection {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--primary-blue);
}

.type-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.type-btn {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: var(--bg-light);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

.type-btn:hover {
    background: var(--bg-white);
    border-color: var(--primary-blue);
    box-shadow: var(--shadow-md);
    transform: translateX(4px);
}

.type-btn:active {
    transform: translateX(2px);
}

.type-name {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-dark);
}

.type-count {
    font-size: 13px;
    color: var(--primary-blue);
    font-weight: 600;
    background: rgba(33, 150, 243, 0.1);
    padding: 4px 12px;
    border-radius: 20px;
}

/* === 문제 화면 === */
/* 상단 헤더 */
.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 16px 20px;
    background: var(--bg-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.home-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--bg-light);
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-gray);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

.home-btn:hover {
    background: var(--primary-blue);
    color: white;
}

.home-btn svg {
    width: 18px;
    height: 18px;
}

.progress-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.current-type {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-blue);
}

.progress-text {
    font-size: 13px;
    color: var(--text-light);
}

/* 결과 배너 */
.result-banner {
    padding: 16px 20px;
    border-radius: var(--radius-md);
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    animation: slideDown 0.3s ease;
}

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

.result-banner.correct {
    background: linear-gradient(135deg, #28A745 0%, #20C997 100%);
    color: white;
}

.result-banner.incorrect {
    background: linear-gradient(135deg, #DC3545 0%, #E83E8C 100%);
    color: white;
}

.result-banner.hidden {
    display: none;
}

/* 문제 컨텐츠 영역 */
.quiz-content {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

/* 문제 박스 */
.question-box {
    margin-bottom: 24px;
}

.question-label {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    color: var(--primary-blue);
    background: rgba(33, 150, 243, 0.1);
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: 12px;
}

.question-text {
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-dark);
    padding: 20px;
    background: var(--bg-light);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--primary-blue);
}

/* O/X 버튼 */
.answer-buttons {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
}

.answer-btn {
    flex: 1;
    padding: 20px;
    font-size: 32px;
    font-weight: 700;
    border: 3px solid;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

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

.btn-o {
    background: var(--bg-white);
    border-color: var(--primary-blue);
    color: var(--primary-blue);
}

.btn-o:not(:disabled):hover {
    background: var(--primary-blue);
    color: white;
    transform: scale(1.02);
}

.btn-x {
    background: var(--bg-white);
    border-color: var(--error-red);
    color: var(--error-red);
}

.btn-x:not(:disabled):hover {
    background: var(--error-red);
    color: white;
    transform: scale(1.02);
}

.answer-btn.selected {
    transform: scale(0.98);
}

.btn-o.selected {
    background: var(--primary-blue);
    color: white;
}

.btn-x.selected {
    background: var(--error-red);
    color: white;
}

.answer-btn.correct-answer {
    animation: pulse 0.5s ease;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* 해설 영역 */
.explanation-box {
    background: var(--bg-light);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 20px;
    animation: fadeIn 0.3s ease;
}

.explanation-box.hidden {
    display: none;
}

.explanation-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.answer-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-gray);
}

.correct-answer {
    font-size: 24px;
    font-weight: 700;
}

.correct-answer.answer-o {
    color: var(--primary-blue);
}

.correct-answer.answer-x {
    color: var(--error-red);
}

.explanation-content {
    
}

.explanation-label {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    color: var(--success-green);
    background: rgba(40, 167, 69, 0.1);
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: 12px;
}

.explanation-text {
    font-size: 14px;
    line-height: 1.8;
    color: var(--text-gray);
}

/* 해설 내 강조 텍스트 (파란색 + 굵은 글씨) */
.explanation-text .highlight-bold {
    color: var(--primary-blue);
    font-weight: 700;
}

/* 다음 문제 버튼 */
.next-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-dark) 100%);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

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

.next-btn.hidden {
    display: none;
}

/* 완료 메시지 */
.complete-message {
    text-align: center;
    padding: 40px 20px;
    animation: fadeIn 0.5s ease;
}

.complete-message.hidden {
    display: none;
}

.complete-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.complete-message h3 {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 12px;
}

.complete-message p {
    font-size: 14px;
    color: var(--text-gray);
}

/* === 반응형 === */
@media (max-width: 600px) {
    .container {
        padding: 16px;
    }
    
    .logo {
        max-width: 220px;
    }
    
    .main-title {
        font-size: 22px;
    }
    
    .title-section {
        padding: 24px 16px;
    }
    
    .quiz-header {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
    
    .progress-info {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    
    .answer-btn {
        padding: 16px;
        font-size: 28px;
    }
    
    .question-text {
        font-size: 15px;
        padding: 16px;
    }
}

/* === 스크롤바 커스텀 === */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-light);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-blue-light);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-blue);
}