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

:root {
    --primary-color: #0066cc;
    --secondary-color: #4a90e2;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --dark-color: #2c3e50;
    --light-gray: #f8f9fa;
    --border-gray: #dee2e6;
    --text-dark: #333;
    --text-light: #666;
    --white: #ffffff;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
}

body {
    font-family: 'Noto Sans KR', sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 섹션 표시/숨김 */
.section {
    display: none;
    min-height: 100vh;
    padding: 40px 0;
}

.section.active {
    display: block;
}

/* 버튼 스타일 */
.btn {
    padding: 14px 32px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    font-family: 'Noto Sans KR', sans-serif;
}

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

.btn-primary:hover {
    background: #0052a3;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--white);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: var(--white);
    transform: translateY(-2px);
}

/* 메인 페이지 */
.header-logo {
    text-align: center;
    margin-bottom: 30px;
}

/* 주제 선택 카드 */
.topic-selection {
    margin-top: 40px;
}

.topic-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin-top: 20px;
}

.topic-card {
    background: var(--light-gray);
    padding: 35px 30px;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 3px solid transparent;
}

.topic-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
    background: #fff;
}

.topic-icon {
    font-size: 60px;
    text-align: center;
    margin-bottom: 20px;
}

.topic-card h3 {
    color: var(--dark-color);
    font-size: 28px;
    margin-bottom: 8px;
    text-align: center;
}

.topic-subtitle {
    color: var(--text-light);
    font-size: 14px;
    text-align: center;
    margin-bottom: 15px;
    font-style: italic;
}

.topic-card > p:not(.topic-subtitle) {
    color: var(--text-dark);
    font-size: 16px;
    text-align: center;
    margin-bottom: 20px;
    font-weight: 500;
}

.topic-points {
    list-style: none;
    padding: 0;
    margin: 20px 0;
}

.topic-points li {
    padding: 10px 0;
    color: var(--text-dark);
    font-size: 15px;
    position: relative;
    padding-left: 25px;
}

.topic-points li:before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: bold;
    font-size: 18px;
}

.topic-card .btn {
    width: 100%;
    margin-top: 20px;
}

.school-badge {
    background: var(--white);
    color: var(--primary-color);
    padding: 12px 24px;
    border-radius: 50px;
    font-weight: 600;
    display: inline-block;
    box-shadow: var(--shadow);
}

.hero {
    background: var(--white);
    padding: 60px 40px;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    text-align: center;
}

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

.subtitle {
    font-size: 20px;
    color: var(--text-light);
    margin-bottom: 30px;
    font-weight: 400;
}

.hero-description {
    background: var(--light-gray);
    padding: 25px;
    border-radius: 12px;
    margin: 30px 0;
    border-left: 4px solid var(--primary-color);
}

.hero-description p {
    font-size: 16px;
    margin-bottom: 8px;
    color: var(--text-dark);
}

.hero-description p:last-child {
    margin-bottom: 0;
}

.program-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin: 40px 0;
}

.info-card {
    background: var(--light-gray);
    padding: 30px;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.info-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.info-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.info-card h3 {
    color: var(--dark-color);
    margin-bottom: 10px;
    font-size: 22px;
}

.info-card p {
    color: var(--text-light);
    font-size: 15px;
}

/* 학습 섹션 */
.section-header {
    text-align: center;
    margin-bottom: 40px;
    background: var(--white);
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.section-header h2 {
    color: var(--dark-color);
    font-size: 36px;
    margin-bottom: 10px;
}

.section-header p {
    color: var(--text-light);
    font-size: 18px;
}

.learning-content {
    display: grid;
    gap: 25px;
}

.learning-card {
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.learning-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.card-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: var(--white);
    padding: 20px 25px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.card-number {
    background: rgba(255, 255, 255, 0.2);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
}

.card-header h3 {
    font-size: 22px;
    font-weight: 600;
}

.card-content {
    padding: 25px;
}

.card-content p {
    margin-bottom: 15px;
    font-size: 15px;
    line-height: 1.8;
}

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

.card-content strong {
    color: var(--primary-color);
    font-weight: 600;
}

.card-content ul {
    margin-left: 20px;
    margin-top: 10px;
}

.card-content ul li {
    margin-bottom: 10px;
    line-height: 1.8;
}

.highlight {
    background: linear-gradient(120deg, #e3f2fd 0%, #bbdefb 100%);
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
    margin-top: 15px !important;
    font-weight: 500;
}

.info-box {
    background: #fff3cd;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #ffc107;
    margin-top: 15px !important;
}

.learning-footer {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 40px;
    padding: 30px;
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow);
}

/* 퀴즈 섹션 */
.quiz-header {
    background: var(--white);
    padding: 25px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.quiz-header h2 {
    color: var(--dark-color);
    font-size: 28px;
}

.quiz-progress {
    font-size: 24px;
    color: var(--primary-color);
    font-weight: 700;
}

.quiz-container {
    background: var(--white);
    padding: 40px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}

.quiz-question {
    margin-bottom: 30px;
}

.question-text {
    font-size: 20px;
    color: var(--dark-color);
    font-weight: 600;
    margin-bottom: 25px;
    line-height: 1.6;
}

.quiz-options {
    display: grid;
    gap: 15px;
}

.option {
    background: var(--light-gray);
    padding: 18px 22px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    font-size: 16px;
}

.option:hover {
    background: #e3f2fd;
    border-color: var(--primary-color);
    transform: translateX(5px);
}

.option.selected {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

.option.correct {
    background: var(--success-color);
    color: var(--white);
    border-color: var(--success-color);
}

.option.incorrect {
    background: var(--danger-color);
    color: var(--white);
    border-color: var(--danger-color);
}

.option.disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.explanation {
    background: #e3f2fd;
    padding: 20px;
    border-radius: 10px;
    margin-top: 20px;
    border-left: 4px solid var(--primary-color);
}

.explanation strong {
    color: var(--primary-color);
    display: block;
    margin-bottom: 8px;
    font-size: 16px;
}

.quiz-nav-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 30px;
}

.quiz-navigation {
    text-align: center;
    background: var(--white);
    padding: 25px;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

/* 결과 섹션 */
.result-container {
    background: var(--white);
    padding: 50px 40px;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    text-align: center;
    max-width: 700px;
    margin: 0 auto;
}

.result-container h2 {
    color: var(--dark-color);
    font-size: 32px;
    margin-bottom: 30px;
}

.score-display {
    margin: 40px 0;
}

.score-circle {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    box-shadow: var(--shadow-lg);
}

.score-circle #final-score {
    font-size: 64px;
    font-weight: 700;
    color: var(--white);
}

.score-label {
    font-size: 24px;
    color: var(--white);
    margin-top: -10px;
}

.result-message {
    font-size: 20px;
    margin: 30px 0;
    padding: 25px;
    border-radius: 12px;
    font-weight: 500;
}

.result-message.pass {
    background: #d4edda;
    color: #155724;
    border: 2px solid #c3e6cb;
}

.result-message.fail {
    background: #f8d7da;
    color: #721c24;
    border: 2px solid #f5c6cb;
}

.certificate-input {
    margin: 35px 0;
    padding: 30px;
    background: var(--light-gray);
    border-radius: 12px;
}

.certificate-input h3 {
    color: var(--primary-color);
    font-size: 24px;
    margin-bottom: 15px;
}

.certificate-input p {
    color: var(--text-light);
    margin-bottom: 20px;
    font-size: 16px;
}

.certificate-input input {
    width: 100%;
    max-width: 400px;
    padding: 14px;
    font-size: 18px;
    border: 2px solid var(--border-gray);
    border-radius: 8px;
    margin-bottom: 20px;
    font-family: 'Noto Sans KR', sans-serif;
    text-align: center;
}

.certificate-input input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.result-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 30px;
}

/* 이수증 스타일 */
.certificate {
    max-width: 900px;
    margin: 0 auto 30px;
    background: var(--white);
    padding: 50px;
    border-radius: 15px;
    box-shadow: var(--shadow-lg);
}

.certificate-border {
    border: 8px double var(--primary-color);
    padding: 50px;
    border-radius: 10px;
    position: relative;
}

.certificate-header {
    text-align: center;
    border-bottom: 3px solid var(--primary-color);
    padding-bottom: 30px;
    margin-bottom: 40px;
}

.certificate-logo {
    font-size: 80px;
    margin-bottom: 20px;
}

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

.certificate-subtitle {
    font-size: 18px;
    color: var(--text-light);
    font-style: italic;
}

.certificate-body {
    text-align: center;
}

.certificate-name-section {
    margin: 40px 0;
}

.name-label {
    font-size: 16px;
    color: var(--text-light);
    margin-bottom: 10px;
}

.student-name-display {
    font-size: 48px;
    color: var(--dark-color);
    font-weight: 700;
    border-bottom: 3px solid var(--primary-color);
    display: inline-block;
    padding: 10px 40px;
    margin: 10px 0 30px;
}

.certificate-text {
    font-size: 18px;
    line-height: 2;
    color: var(--text-dark);
    margin: 30px 0;
}

.certificate-text strong {
    color: var(--primary-color);
    font-size: 20px;
}

.certificate-score {
    background: var(--light-gray);
    padding: 20px;
    border-radius: 10px;
    margin: 30px 0;
    font-size: 20px;
    font-weight: 600;
    color: var(--primary-color);
}

.certificate-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 50px;
    padding-top: 30px;
    border-top: 2px solid var(--border-gray);
}

.certificate-date, .certificate-issuer {
    text-align: center;
}

.certificate-date p:first-child,
.certificate-issuer p:first-child {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 8px;
}

.certificate-date p:last-child,
.certificate-issuer p:last-child {
    font-size: 16px;
    font-weight: 600;
    color: var(--dark-color);
}

.certificate-seal {
    position: absolute;
    top: 30px;
    right: 30px;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    text-align: center;
    border: 4px solid var(--white);
    box-shadow: var(--shadow);
}

.certificate-actions {
    text-align: center;
    display: flex;
    justify-content: center;
    gap: 15px;
}

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

    .main-title {
        font-size: 32px;
    }

    .subtitle {
        font-size: 18px;
    }

    .hero {
        padding: 40px 25px;
    }

    .program-info {
        grid-template-columns: 1fr;
    }

    .topic-cards {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .topic-card {
        padding: 25px 20px;
    }

    .topic-card h3 {
        font-size: 24px;
    }

    .quiz-header {
        flex-direction: column;
        gap: 15px;
    }

    .quiz-container {
        padding: 25px;
    }

    .question-text {
        font-size: 18px;
    }

    .result-actions {
        flex-direction: column;
    }

    .certificate {
        padding: 25px;
    }

    .certificate-border {
        padding: 25px;
        border-width: 4px;
    }

    .certificate-header h1 {
        font-size: 28px;
    }

    .student-name-display {
        font-size: 32px;
        padding: 10px 20px;
    }

    .certificate-footer {
        flex-direction: column;
        gap: 25px;
    }

    .certificate-seal {
        width: 70px;
        height: 70px;
        font-size: 11px;
        top: 15px;
        right: 15px;
    }

    .learning-footer {
        flex-direction: column;
    }

    .certificate-actions {
        flex-direction: column;
    }

    .score-circle {
        width: 160px;
        height: 160px;
    }

    .score-circle #final-score {
        font-size: 48px;
    }
}

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

.section.active {
    animation: fadeIn 0.5s ease;
}
