/* ==========================================================================
   Welfarechi Exam System Style Sheet 
   Filename: style_exam.css
   Location: /exam/style_exam.css
   ========================================================================== */

/* 1. 글로벌 및 레이아웃 컨테이너 */
.exam-body-wrapper {
    width: 100%;
    background-color: #f8fafc; /* 시험지가 돋보이도록 전체 배경을 부드러운 연그레이로 지정 */
    min-height: 100vh;
}

.exam-container {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 40px 20px 80px 20px;
}

/* 2. 메인 헤더(header.php) 강제 커스텀 오버라이드
   - 기출문제 페이지 내에서 상단 포털 영역을 미니멀하게 강제 조정 */
.exam-body-wrapper ~ header, 
body:has(.exam-container) header {
    padding: 20px 0 !important;
    background-color: #fff;
    border-bottom: 1px solid #e2e8f0;
}

body:has(.exam-container) header h1 {
    font-size: 42px !important;
    margin-bottom: 15px !important;
}

body:has(.exam-container) .search-slogan,
body:has(.exam-container) .header-link-menu {
    display: none !important; /* 시험지 페이지 내에서는 슬로건과 중복 버튼 히든 처리 */
}

/* 3. 시험지 헤더 영역 */
.exam-paper-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    border-bottom: 3px double #1a6cff;
    padding-bottom: 25px;
    margin-bottom: 40px;
}

.exam-title-area h2 {
    font-family: 'Malgun Gothic', "Apple SD Gothic Neo", serif;
    font-size: 28px;
    color: #0f172a;
    margin-bottom: 8px;
    font-weight: 700;
}

.exam-title-area p {
    font-size: 15px;
    color: #64748b;
}

.exam-select-year select { 
    padding: 10px 18px;
    font-size: 15px;
    border: 2px solid #1a6cff; 
    border-radius: 8px;
    color: #1a6cff;
    font-weight: bold;
    cursor: pointer;
    background-color: #fff;
}

/* 4. 모의고사 시험지 본판 (아날로그 종이 감성) */
.exam-paper {
    background: #fdfdfd;
    border: 1px solid #e2e8f0;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    border-radius: 12px;
    padding: 50px;
}

.question-box {
    margin-bottom: 40px;
    padding-bottom: 35px;
    border-bottom: 1px dashed #cbd5e1;
}

.question-box:last-child {
    border-bottom: none;
}

.question-title {
    font-size: 19px;
    color: #1e293b;
    line-height: 1.6;
    font-weight: 600;
    margin-bottom: 20px;
}

.q-num {
    color: #1a6cff;
    margin-right: 10px;
    font-weight: 800;
    font-size: 22px;
}

/* 新 구조 전용: 과목 표시 배지 스타일 */
.subject-badge {
    font-size: 13px;
    background-color: #e8f0fe;
    color: #1a6cff;
    padding: 4px 10px;
    border-radius: 6px;
    margin-right: 8px;
    vertical-align: middle;
    font-weight: bold;
    border: 1px solid #d2e3fc;
}

/* 5. 보기 문항 리스트 */
.options-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-left: 10px;
}

.option-item { 
    display: flex !important;
    align-items: center !important;
    gap: 12px;
    cursor: pointer; 
    font-size: 16px;
    color: #334155;
    line-height: 1.5;
    padding: 10px 15px; 
    border-radius: 8px;
    transition: background 0.2s, color 0.2s; 
}

.option-item:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.option-item input[type="radio"] {
    transform: scale(1.25);
    cursor: pointer;
    accent-color: #1a6cff;
    margin: 0;
}

.option-number {
    font-weight: bold;
    color: #64748b;
}

.option-text {
    flex: 1;
}

/* 6. 하단 채점 버튼 */
.exam-submit-area {
    text-align: center;
    margin-top: 50px;
}

.exam-submit-btn { 
    background: linear-gradient(135deg, #1a6cff, #0052e0);
    color: #fff;
    border: none; 
    padding: 20px 60px;
    font-size: 19px;
    font-weight: bold;
    border-radius: 40px; 
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(26, 108, 255, 0.3);
    transition: all 0.2s ease-in-out;
}

.exam-submit-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 24px rgba(26, 108, 255, 0.4);
}

/* 7. 결과 리포트 대시보드 (exam_result.php 전용) */
.score-dashboard {
    background: #fff;
    border: 2px solid #1a6cff;
    border-radius: 16px;
    padding: 40px;
    text-align: center;
    margin-bottom: 40px;
    box-shadow: 0 10px 25px rgba(26, 108, 255, 0.05);
}

.score-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin: 30px 0;
}

.score-card {
    padding: 25px 15px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.score-card .label {
    font-size: 14px;
    color: #64748b;
    font-weight: bold;
    margin-bottom: 10px;
    display: block;
}

.score-card .value {
    font-size: 24px;
    font-weight: 800;
    color: #0f172a;
}

.score-card.correct {
    background: #e6f4ea;
    color: #137333;
    border-color: #c4eed0;
}
.score-card.correct .value { color: #137333; }

.score-card.wrong {
    background: #fce8e6;
    color: #c5221f;
    border-color: #fad2cf;
}
.score-card.wrong .value { color: #c5221f; }

.score-card.points {
    background: #e8f0fe;
    border: 1px dashed #1a6cff;
}
.score-card.points .value {
    font-size: 32px;
    color: #1a6cff;
}

/* 결과창 이동 버튼 세트 */
.result-action-bar {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 25px;
}
.btn-retry, .btn-home {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 25px;
    font-weight: bold;
    font-size: 15px;
    transition: all 0.2s;
}
.btn-retry { background-color: #1a6cff; color: #fff !important; }
.btn-retry:hover { background-color: #0052e0; }
.btn-home { background-color: #e2e8f0; color: #334155 !important; }
.btn-home:hover { background-color: #cbd5e1; }

/* 8. 오답 노트 스타일 (exam_result.php 전용) */
.wrong-notebook-section {
    margin-top: 50px;
}
.wrong-notebook-section h3 {
    font-size: 22px;
    color: #1e293b;
    margin-bottom: 8px;
}
.notebook-tip {
    font-size: 14px;
    color: #64748b;
    margin-bottom: 25px;
}
.wrong-item-box { 
    background: #fff;
    border-left: 6px solid #c5221f;
    padding: 30px; 
    border-radius: 0 12px 12px 0;
    margin-bottom: 35px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
    border-top: 1px solid #f1f5f9;
    border-right: 1px solid #f1f5f9;
    border-bottom: 1px solid #f1f5f9;
}

.wrong-q-num {
    color: #c5221f;
    font-weight: 800;
    font-size: 18px;
    margin-right: 10px;
}
.wrong-q-text {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    margin: 15px 0 20px 0;
}

.status-badge-wrong {
    font-size: 12px;
    background-color: #fce8e6;
    color: #c5221f;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: bold;
}

.wrong-options-check {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.option-check-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    border-radius: 8px;
    font-size: 15px;
    color: #475569;
    background-color: #f8fafc;
}

.option-check-row.is-correct-ans {
    background: #e6f4ea;
    color: #137333;
    font-weight: bold;
}

.option-check-row.is-user-ans {
    background: #fce8e6;
    color: #c5221f;
    font-weight: bold;
}

.ans-marker {
    margin-left: auto;
    font-size: 13px;
    font-weight: bold;
}

/* 9. 모바일 반응형 대응 (Media Queries) */
@media (max-width: 768px) {
    .exam-container {
        padding: 20px 10px 60px 10px;
    }
    .exam-paper-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }
    .exam-select-year {
        width: 100%;
    }
    .exam-select-year select {
        width: 100%;
    }
    .exam-paper {
        padding: 25px 15px;
    }
    .option-item {
        font-size: 15px;
        padding: 8px 10px;
    }
    .score-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    .exam-submit-btn {
        width: 100%;
        padding: 18px 0;
    }
    .result-action-bar {
        flex-direction: column;
    }
    .btn-retry, .btn-home {
        width: 100%;
        text-align: center;
    }
}


/* 대기실 (로그인) 박스 스타일 */
.exam-login-box {
    background: #fff;
    max-width: 550px;
    margin: 60px auto;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 20px;
}

.login-header h2 {
    font-size: 24px;
    color: #0f172a;
    font-weight: 700;
    margin-bottom: 6px;
}

.login-header p {
    font-size: 14px;
    color: #64748b;
}

.form-group {
    margin-bottom: 22px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: bold;
    color: #334155;
    margin-bottom: 8px;
}

.form-group input[type="text"],
.form-group select {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    color: #334155;
    background-color: #fff;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #1a6cff;
    box-shadow: 0 0 0 3px rgba(26, 108, 255, 0.1);
}

/* 수험번호 전용 읽기전용 인풋 */
.form-group .input-readonly {
    background-color: #f8fafc;
    color: #64748b;
    font-family: monospace;
    font-weight: bold;
    letter-spacing: 0.5px;
    border-color: #e2e8f0;
    cursor: not-allowed;
}

.form-group small {
    display: block;
    margin-top: 6px;
    color: #94a3b8;
    font-size: 12px;
}

/* 시작하기 대형 버튼 */
.btn-start-payload {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #1a6cff, #0052e0);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(26, 108, 255, 0.2);
    transition: all 0.2s;
    margin-top: 10px;
}

.btn-start-payload:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(26, 108, 255, 0.3);
}

/* 시험중 표시 배지 */
.badge-running {
    background-color: #fff3cd;
    color: #856404;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: bold;
    border: 1px solid #ffeeba;
}