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

:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --success-color: #48bb78;
    --error-color: #f56565;
    --text-dark: #2d3748;
    --text-light: #718096;
    --bg-light: #f7fafc;
    --border-color: #e2e8f0;
    --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', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    position: relative;
}

/* 관리자 링크 */
.admin-link {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    text-decoration: none;
    box-shadow: var(--shadow-lg);
    transition: all 0.3s ease;
    z-index: 100;
}

.admin-link:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
}

/* 화면 전환 */
.screen {
    display: none;
}

.screen.active {
    display: block;
    animation: fadeIn 0.3s ease-in;
}

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

/* 컨테이너 */
.container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 16px;
    padding: 40px;
    box-shadow: var(--shadow-lg);
}

/* 헤더 */
.header {
    text-align: center;
    margin-bottom: 30px;
}

.header h1 {
    font-size: 32px;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

.header h2 {
    font-size: 20px;
    font-weight: 400;
    color: var(--text-light);
}

/* 정보 박스 */
.info-box {
    background: var(--bg-light);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 30px;
    border-left: 4px solid var(--primary-color);
}

.subtitle {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.description {
    font-size: 14px;
    color: var(--text-light);
}

/* 폼 스타일 */
.student-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
}

.required {
    color: var(--error-color);
}

.form-group input {
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 버튼 */
.btn {
    padding: 14px 28px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

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

.btn-secondary:hover:not(:disabled) {
    background: var(--bg-light);
}

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

/* 퀴즈 헤더 */
.quiz-header {
    margin-bottom: 30px;
}

.progress-info {
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 12px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-light);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s ease;
    width: 0%;
}

/* 질문 섹션 */
.question-section {
    margin-bottom: 30px;
}

.question-label {
    display: inline-block;
    padding: 6px 12px;
    background: var(--bg-light);
    color: var(--primary-color);
    font-size: 13px;
    font-weight: 600;
    border-radius: 6px;
    margin-bottom: 16px;
}

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

/* 선택지 */
.options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.option {
    padding: 16px 20px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
    display: flex;
    align-items: center;
    gap: 12px;
}

.option:hover {
    border-color: var(--primary-color);
    background: var(--bg-light);
}

.option.selected {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
}

.option-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-light);
    color: var(--text-light);
    font-weight: 600;
    flex-shrink: 0;
}

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

.option-text {
    flex: 1;
    font-size: 16px;
    color: var(--text-dark);
}

/* 네비게이션 */
.quiz-navigation {
    display: flex;
    gap: 16px;
    justify-content: space-between;
}

.quiz-navigation .btn {
    flex: 1;
}

/* 결과 화면 */
.result-header {
    text-align: center;
    margin-bottom: 30px;
}

.result-header h1 {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 16px;
}

.student-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 14px;
    color: var(--text-light);
    background: var(--bg-light);
    padding: 16px;
    border-radius: 8px;
}

/* 점수 박스 */
.score-box {
    text-align: center;
    padding: 40px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-radius: 12px;
    margin-bottom: 30px;
}

.score-main {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 4px;
    margin-bottom: 12px;
}

.score-number {
    font-size: 64px;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.score-total {
    font-size: 32px;
    font-weight: 600;
    color: var(--text-light);
}

.score-percentage {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-light);
}

/* 결과 상세 */
.result-details {
    margin-bottom: 30px;
}

.result-item {
    padding: 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 12px;
}

.result-item.correct {
    border-color: var(--success-color);
    background: rgba(72, 187, 120, 0.05);
}

.result-item.incorrect {
    border-color: var(--error-color);
    background: rgba(245, 101, 101, 0.05);
}

.result-item-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.result-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}

.result-item.correct .result-icon {
    background: var(--success-color);
    color: white;
}

.result-item.incorrect .result-icon {
    background: var(--error-color);
    color: white;
}

.result-question-num {
    font-weight: 600;
    color: var(--text-dark);
}

.result-question-text {
    font-size: 14px;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.result-answer {
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 4px;
}

.result-explanation {
    font-size: 13px;
    color: var(--text-light);
    background: var(--bg-light);
    padding: 12px;
    border-radius: 6px;
    margin-top: 8px;
}

/* 결과 액션 */
.result-actions {
    display: flex;
    gap: 16px;
}

.result-actions .btn {
    flex: 1;
}

/* 제출 상태 */
.submit-status {
    margin-top: 20px;
    padding: 16px;
    border-radius: 8px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
}

.submit-status.success {
    background: rgba(72, 187, 120, 0.1);
    color: var(--success-color);
    border: 2px solid var(--success-color);
}

.submit-status.error {
    background: rgba(245, 101, 101, 0.1);
    color: var(--error-color);
    border: 2px solid var(--error-color);
}

/* 인쇄 스타일 */
@media print {
    body {
        background: white;
        padding: 0;
    }

    .container {
        box-shadow: none;
        max-width: 100%;
    }

    .result-actions {
        display: none;
    }

    .submit-status {
        display: none;
    }
}

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

    .container {
        padding: 24px;
    }

    .header h1 {
        font-size: 24px;
    }

    .header h2 {
        font-size: 16px;
    }

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

    .score-number {
        font-size: 48px;
    }

    .score-total {
        font-size: 24px;
    }

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

@media (max-width: 480px) {
    .container {
        padding: 20px;
    }

    .header h1 {
        font-size: 20px;
    }

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

    .option {
        padding: 12px 16px;
    }

    .option-text {
        font-size: 14px;
    }
}
