/*
 * Exam Pages Common Styles
 * 시험 관련 페이지 공통 스타일 - 주황색 키컬러, 배경 선택 형태
 * style.css로부터 완전히 독립적인 스타일
 */

/* ===== Bootstrap Essentials ===== */
*,
*::before,
*::after {
    box-sizing: border-box;
}

:root {
    --exam-primary: #FF6633;
    --exam-primary-dark: #E55A2B;
    --exam-primary-light: #FFF4F0;
    --exam-secondary: #64748B;
    --exam-accent: #FF8C5A;
    --exam-background: #F8FAFC;
    --exam-surface: #FFFFFF;
    --exam-text: #1E293B;
    --exam-text-muted: #64748B;
    --exam-border: #E2E8F0;
    --exam-success: #16A34A;
    --exam-warning: #F59E0B;
    --exam-error: #DC2626;
}

/* AI Evaluation Result Styles - Added based on user request */
.block-result {
    background: var(--exam-surface);
    border-radius: 12px;
    padding: 2rem;
    border: 1px solid var(--exam-border);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    height: 100%;
}

.grade-display {
    font-size: 5rem;
    font-weight: 800;
    color: var(--exam-primary);
    line-height: 1.2;
}

.exam-header {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--exam-text);
    margin-bottom: 0.5rem;
}

.exam-subheader {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--exam-primary);
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--exam-primary-light);
    padding-bottom: 0.5rem;
}

.progress-bar-custom {
    background-color: var(--exam-primary) !important;
}

.score-label {
    font-weight: 600;
    color: var(--exam-text);
}

.list-improvements li {
    margin-bottom: 0.5rem;
    position: relative;
    padding-left: 1.5rem;
    color: var(--exam-text-muted);
}

.list-improvements li::before {
    content: "•";
    color: var(--exam-primary);
    position: absolute;
    left: 0;
    font-weight: bold;
}

.q-feedback-card {
    background: var(--exam-surface);
    border: 1px solid var(--exam-border);
    border-radius: 12px;
    padding: 1.5rem;
}

.q-feedback-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border-color: var(--exam-primary-light);
}

.var-text-primary {
    color: var(--exam-primary) !important;
}


/* ===== 기본 설정 ===== */
html {
    font-size: 13px !important;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background-color: var(--exam-background) !important;
    color: var(--exam-text) !important;
    font-size: 1.2rem !important;
    line-height: 1.6 !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}

/* Container */
.container-fluid {
    width: 100%;
    margin-right: auto;
    margin-left: auto;
    margin-bottom: 30rem;
}

/* Row & Columns */
.row {
    display: flex;
    flex-wrap: wrap;
}

.col,
.col-2,
.col-8,
.col-lg-3,
.col-sm-6 {
    position: relative;
    width: 100%;
}

.col {
    flex-basis: 0;
    flex-grow: 1;
    max-width: 100%;
}

.col-2 {
    flex: 0 0 16.666667%;
    max-width: 16.666667%;
}

.col-8 {
    flex: 0 0 66.666667%;
    max-width: 66.666667%;
}

@media (min-width: 576px) {
    .col-sm-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

@media (min-width: 992px) {
    .col-lg-3 {
        flex: 0 0 25%;
        max-width: 25%;
    }
}

/* Buttons */
.btn {
    display: inline-block;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    user-select: none;
    border: 1px solid transparent;
    font-size: 1rem;
    line-height: 1.5;
    transition: all 0.15s ease-in-out;
    cursor: pointer;
}

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

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-control {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--exam-text);
    background-color: #fff;
    border: 1px solid var(--exam-border);
    border-radius: 6px;
}

/* Col-6 definition */
.col-6 {
    flex: 0 0 50%;
    max-width: 50%;
    position: relative;
    width: 100%;
}

/* Utilities */
.text-center {
    text-align: center !important;
}

.text-left {
    text-align: left !important;
}

.text-right {
    text-align: right !important;
}

.mx-auto {
    margin-left: auto !important;
    margin-right: auto !important;
}

.mt-4 {
    margin-top: 1.5rem !important;
}

.mt-6 {
    margin-top: 3rem !important;
}

.mb-3 {
    margin-bottom: 1rem !important;
}

.d-flex {
    display: flex !important;
}

.justify-content-center {
    justify-content: center !important;
}

/* Modal Backdrop */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1050;
    display: none;
    width: 100%;
    height: 100%;
    overflow: hidden;
    outline: 0;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal.show {
    display: block;
}

.modal-dialog {
    position: relative;
    width: auto;
    margin: 1.75rem auto;
    max-width: 500px;
}

.modal-dialog-centered {
    display: flex;
    align-items: center;
    min-height: calc(100% - 3.5rem);
}

.modal-content {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
}

.modal-header,
.modal-footer {
    display: flex;
    align-items: center;
    padding: 1rem;
}

.modal-header {
    border-bottom: 1px solid var(--exam-border);
    justify-content: space-between;
}

.modal-footer {
    border-top: 1px solid var(--exam-border);
    justify-content: center;
}

.modal-body {
    position: relative;
    flex: 1 1 auto;
    padding: 1.5rem;
}

.close {
    padding: 0;
    background-color: transparent;
    border: 0;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
    color: #000;
    opacity: 0.5;
    cursor: pointer;
}

/* Progress */
.progress {
    display: flex;
    height: 1rem;
    overflow: hidden;
    background-color: #e9ecef;
    border-radius: 0.25rem;
}

.progress-bar {
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: #fff;
    text-align: center;
    white-space: nowrap;
    background-color: var(--exam-primary);
    transition: width 0.6s ease;
}

/* Main Container */
.actfl-test-container {
    background: transparent !important;
    max-width: 900px !important;
    margin: 0 auto;
    padding: 0 15px;
}

#contentDiv {
    padding-top: 30px !important;
    min-height: 100vh;
}

/* ===== Survey Block - Questions Page ===== */
.block-survey {
    background: var(--exam-surface) !important;
    border-radius: 12px !important;
    padding: 2rem !important;
    border: 1px solid var(--exam-border) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
    margin-bottom: 1.5rem !important;
}

.block-survey .header-primary {
    font-size: 1.5rem !important;
    font-weight: 700 !important;
    color: var(--exam-text) !important;
    margin-bottom: 0.75rem !important;
    border-bottom: 3px solid var(--exam-primary) !important;
    padding-bottom: 0.5rem !important;
    background: none !important;
}

.block-survey .instructions-survey {
    color: var(--exam-text-muted) !important;
    font-size: 1.3rem !important;
    margin-bottom: 1.25rem !important;
    line-height: 1.6 !important;
}

.block-survey #survey-progress {
    font-size: 1rem !important;
    font-weight: 600 !important;
    color: var(--exam-primary) !important;
    background: var(--exam-primary-light) !important;
    padding: 0.625rem 1rem !important;
    border-radius: 6px !important;
    margin-bottom: 1.25rem !important;
    display: inline-block !important;
    border: 1px solid rgba(255, 102, 51, 0.2) !important;
}

.block-survey .background-survey-question {
    font-size: 1.125rem !important;
    font-weight: 600 !important;
    color: var(--exam-text) !important;
    margin-bottom: 1rem !important;
    padding-left: 0 !important;
}

/* list-plain 오버라이드 */
.block-survey .list-plain {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* ===== Form Check - 단순한 클릭 스타일 ===== */
.block-survey .form-check,
.block-self-assessment .form-check {
    position: relative !important;
    padding: 0.625rem 0.5rem 0.625rem 1.75rem !important;
    margin-bottom: 0.25rem !important;
    margin-left: 0 !important;
    border-radius: 4px !important;
    border: none !important;
    background: transparent !important;
    cursor: pointer !important;
    display: block !important;
}

/* ○ 기호 추가 */
.block-survey .form-check::before,
.block-self-assessment .form-check::before {
    content: '○' !important;
    position: absolute !important;
    left: 0.25rem !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    font-size: 0.875rem !important;
    color: var(--exam-text-muted) !important;
    transition: color 0.15s ease !important;
}

/* 호버: 배경만 살짝 (선택/미선택 모두) */
.block-survey .form-check:hover,
.block-self-assessment .form-check:hover {
    background: rgba(0, 0, 0, 0.03) !important;
}

/* 선택된 상태: 텍스트 주황색, ● 기호 */
.block-survey .form-check.selected,
.block-self-assessment .form-check.selected {
    background: transparent !important;
}

.block-survey .form-check.selected::before,
.block-self-assessment .form-check.selected::before {
    content: '◉' !important;
    color: var(--exam-primary) !important;
}

.block-survey .form-check.selected .form-check-label,
.block-survey .form-check.selected .form-check-label span,
.block-self-assessment .form-check.selected .form-check-label,
.block-self-assessment .form-check.selected .form-check-label span {
    color: var(--exam-primary) !important;
    font-weight: 600 !important;
}

/* 체크박스/라디오 버튼 - 전체 영역 커버 (클릭 안정성) */
.block-survey .form-check-input,
.block-self-assessment .form-check-input {
    position: absolute !important;
    opacity: 0 !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    cursor: pointer !important;
    z-index: 10 !important;
}

/* 라벨 스타일 */
.block-survey .form-check-label,
.block-self-assessment .form-check-label {
    cursor: pointer !important;
    display: block !important;
    color: var(--exam-text) !important;
    font-size: 1rem !important;
    line-height: 1.5 !important;
    font-weight: 400 !important;
    margin: 0 !important;
    padding: 0 !important;
    background: none !important;
    transition: color 0.15s ease !important;
}

.block-survey .form-check-label span,
.block-self-assessment .form-check-label span {
    font-size: 1.15rem !important;
}

/* ===== Self Assessment Block ===== */
.block-self-assessment {
    background: var(--exam-surface) !important;
    border-radius: 12px !important;
    padding: 2rem !important;
    border: 1px solid var(--exam-border) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
    margin-bottom: 1.5rem !important;
}

.block-self-assessment .header-primary,
.block-begin-test .header-primary {
    font-size: 1.5rem !important;
    font-weight: 700 !important;
    color: var(--exam-text) !important;
    margin-bottom: 0.75rem !important;
    border-bottom: 3px solid var(--exam-primary) !important;
    padding-bottom: 0.5rem !important;
    background: none !important;
}

.block-self-assessment .instructions-self-assessment,
.block-begin-test .instructions-self-assessment {
    color: var(--exam-text-muted) !important;
    font-size: 1.2rem !important;
    margin-bottom: 1.25rem !important;
    line-height: 1.6 !important;
}

.block-self-assessment .list-numbered {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    counter-reset: item !important;
}

.block-self-assessment .list-numbered li {
    counter-increment: item !important;
    margin-bottom: 0.5rem !important;
}

.block-self-assessment .list-numbered li .form-check {
    padding-left: 2.5rem !important;
    position: relative !important;
}

.block-self-assessment .list-numbered li .form-check::before {
    content: counter(item) !important;
    position: absolute !important;
    left: 0.75rem !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    font-weight: 700 !important;
    color: var(--exam-primary) !important;
    font-size: 1rem !important;
    width: 1.25rem !important;
    text-align: center !important;
}

/* ===== Start Practice Block ===== */
.block-begin-test {
    background: var(--exam-surface) !important;
    border-radius: 12px !important;
    padding: 2rem !important;
    border: 1px solid var(--exam-border) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
    margin-bottom: 1.5rem !important;
}

.block-begin-test .header-instructions,
.block-begin-test .opic-header-plain {
    font-size: 1.5rem !important;
    font-weight: 700 !important;
    color: var(--exam-text) !important;
    margin-bottom: 0.5rem !important;
    background: none !important;
    -webkit-text-fill-color: var(--exam-text) !important;
}

.block-begin-test>.row>.col>p,
.block-begin-test .row .col p {
    font-size: 1rem !important;
    color: var(--exam-text-muted) !important;
}

.block-begin-test .row-instructions {
    margin-bottom: 1.25rem !important;
}

.block-begin-test .block-instructions-msg {
    text-align: center !important;
    padding: 1.5rem 1rem !important;
    background: var(--exam-background) !important;
    border-radius: 8px !important;
    border: 2px solid var(--exam-border) !important;
    margin-bottom: 0.75rem !important;
    transition: all 0.15s ease !important;
    cursor: pointer !important;
}

.block-begin-test .block-instructions-msg:hover {
    border-color: var(--exam-primary) !important;
    background: var(--exam-primary-light) !important;
}

/* 체크된 상태 - JavaScript로 .selected 클래스 추가 */
.block-begin-test .block-instructions-msg.selected {
    border-color: var(--exam-primary) !important;
    background: var(--exam-primary-light) !important;
}

.block-begin-test .block-instructions-msg h4 {
    font-size: 1.125rem !important;
    font-weight: 600 !important;
    color: var(--exam-text) !important;
    margin-bottom: 0.625rem !important;
}

.block-begin-test .block-instructions-msg p {
    font-size: 0.95rem !important;
    color: var(--exam-text-muted) !important;
    line-height: 1.5 !important;
    margin-bottom: 0 !important;
}

.block-begin-test .block-instructions-msg .material-symbols-outlined {
    color: var(--exam-primary) !important;
    font-size: 40px !important;
    margin-bottom: 0.5rem !important;
}

/* 체크박스 라벨 숨기기 */
.block-begin-test .rules-checkbox-label.custom-checkbox-label {
    display: none !important;
}

/* Alert */
.alert-purple {
    background: var(--exam-primary-light) !important;
    border: 1px solid rgba(255, 102, 51, 0.3) !important;
    border-radius: 8px !important;
    padding: 1rem 1.25rem !important;
    color: var(--exam-primary-dark) !important;
}

.alert-purple p {
    margin: 0 !important;
    font-size: 0.9375rem !important;
    line-height: 1.5 !important;
}

/* Message Begin */
.message-begin {
    color: var(--exam-text) !important;
    font-weight: 600 !important;
    font-size: 1.25rem !important;
}

/* ===== Readjustment Block ===== */
.block-test-level {
    background: var(--exam-surface) !important;
    border-radius: 12px !important;
    padding: 2rem !important;
    border: 1px solid var(--exam-border) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
}

.block-test-level .tit {
    font-size: 1.5rem !important;
    font-weight: 700 !important;
    color: var(--exam-text) !important;
    margin-bottom: 1rem !important;
    border-bottom: 3px solid var(--exam-primary) !important;
    padding-bottom: 0.5rem !important;
}

.block-test-level .check-q .copy {
    color: var(--exam-text-muted) !important;
    font-size: 1.2rem !important;
    margin-bottom: 1.25rem !important;
}

.block-test-level .check-q-list {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.block-test-level .check-q-list li {
    padding: 1rem 1.25rem !important;
    margin-bottom: 0.625rem !important;
    border-radius: 8px !important;
    border: 2px solid var(--exam-border) !important;
    background: var(--exam-surface) !important;
    transition: all 0.15s ease !important;
    cursor: pointer !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    font-size: 1rem !important;
    color: var(--exam-text) !important;
}

.block-test-level .check-q-list li:hover {
    border-color: var(--exam-primary) !important;
    background: var(--exam-primary-light) !important;
}

.block-test-level .check-q-list li.active,
.block-test-level .check-q-list li.on,
.block-test-level .check-q-list li.selected {
    border-color: var(--exam-primary) !important;
    background: var(--exam-primary-light) !important;
    box-shadow: 0 0 0 2px rgba(255, 102, 51, 0.12) !important;
}

.block-test-level .check-q-list li button {
    background: var(--exam-primary) !important;
    color: white !important;
    border: none !important;
    padding: 0.5rem 1rem !important;
    border-radius: 6px !important;
    font-size: 0.875rem !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: background-color 0.15s ease !important;
}

.block-test-level .check-q-list li button:hover {
    background: var(--exam-primary-dark) !important;
}

/* ===== Primary Button ===== */
.btn-primary {
    background: var(--exam-primary) !important;
    border-color: var(--exam-primary) !important;
    color: white !important;
    padding: 0.75rem 2rem !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    font-size: 1rem !important;
    transition: all 0.15s ease !important;
}

.btn-primary:hover {
    background: var(--exam-primary-dark) !important;
    border-color: var(--exam-primary-dark) !important;
    transform: translateY(-1px) !important;
}

.btn-primary:disabled {
    background: #CBD5E1 !important;
    border-color: #CBD5E1 !important;
    color: #94A3B8 !important;
    cursor: not-allowed !important;
    transform: none !important;
}

/* Selection Count */
.selection-count {
    color: var(--exam-primary) !important;
    font-weight: 600 !important;
    font-size: 1.3rem !important;
}

.selection-count font {
    color: var(--exam-primary) !important;
}

/* Additional Utility Overrides */
.add-con-stretch {
    padding: 1.25rem !important;
}

/* Modal Styling */
.modal-content {
    border-radius: 10px !important;
    border: none !important;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15) !important;
}

.modal-header {
    border-bottom: 1px solid var(--exam-border) !important;
}

.modal-footer {
    border-top: 1px solid var(--exam-border) !important;
}

.modal-body p {
    font-size: 1rem !important;
}

/* Spinner Animation */
.animate-spin {
    animation: spin 1s linear infinite !important;
    color: var(--exam-primary) !important;
}

@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

/* Text Alignment */
.text-right {
    text-align: right !important;
}

.text-center {
    text-align: center !important;
}

/* ===== Mobile Responsive ===== */
@media (max-width: 768px) {
    html {
        font-size: 12px !important;
    }

    .block-survey,
    .block-self-assessment,
    .block-begin-test,
    .block-test-level {
        padding: 1.25rem !important;
        border-radius: 8px !important;
    }

    .block-survey .header-primary,
    .block-self-assessment .header-primary,
    .block-test-level .tit,
    .block-begin-test .header-instructions,
    .block-begin-test .opic-header-plain {
        font-size: 1.25rem !important;
    }

    .block-begin-test .block-instructions-msg {
        padding: 1rem !important;
    }

    .block-begin-test .block-instructions-msg .material-symbols-outlined {
        font-size: 32px !important;
    }

    .btn-primary {
        padding: 0.625rem 1.5rem !important;
        font-size: 0.9375rem !important;
    }
}

/* ===== Button Container - 양식과 정렬 ===== */
.block-survey+.row,
.block-self-assessment+.row,
.block-begin-test+.row,
.block-test-level+.row {
    padding: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.block-survey+.row>.col-6,
.block-self-assessment+.row>.col-6,
.block-begin-test+.row>.col-6,
.block-test-level+.row>.col-6 {
    padding-left: 0 !important;
}

/* ===== Prompt List Alignment ===== */
/* 프랙티스/노트 페이지 문항 번호 리스트 중앙 정렬 */
.prompt-list {
    text-align: center !important;
    padding-left: 0 !important;
    margin-left: auto !important;
    margin-right: auto !important;
    list-style: none !important;
}