/* ==========================================================================
   GIO Exam Taking - Full Screen Layout
   ========================================================================== */

/* ---------- CSS Variables (Exam-specific) ---------- */
:root {
    --exam-header-height: 56px;
    --exam-footer-height: 54px;
    --exam-resizer-width: 4px;
    --exam-left-bg: #f5f5f5;
    --exam-right-bg: #ffffff;
    --exam-panel-padding: 28px;
    --exam-timer-warning: #f0850c;
    --exam-timer-danger: #e53935;
    --exam-pill-size: 34px;
}

/* ---------- Fullscreen Body ---------- */
body.exam-fullscreen {
    margin: 0;
    padding: 0;
    overflow: hidden;
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    height: 100vh;
    width: 100vw;
    font-size: 15px;
    line-height: 1.6;
    color: #333;
    background: var(--exam-right-bg);
    display: flex;
    flex-direction: column;
}

/* ==========================================================================
   Exam Header
   ========================================================================== */
.exam-header {
    position: relative;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--exam-header-height);
    padding: 0 20px;
    background: var(--gio-color-text, #1a1a2e);
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.exam-header .exam-title {
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 300px;
}

.exam-header .exam-section-name {
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.75);
    padding: 4px 14px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    white-space: nowrap;
}

.exam-header .exam-header-center {
    display: flex;
    align-items: center;
    gap: 16px;
}

.exam-header .exam-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ---------- Timer ---------- */
.exam-timer {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 18px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: 1px;
    color: #fff;
    padding: 4px 14px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    min-width: 80px;
    justify-content: center;
    transition: background 0.3s, color 0.3s;
}

.exam-timer i,
.exam-timer .timer-icon {
    font-size: 16px;
    opacity: 0.8;
}

.exam-timer.warning {
    background: var(--exam-timer-warning);
    color: #fff;
}

.exam-timer.danger {
    background: var(--exam-timer-danger);
    color: #fff;
    animation: timer-pulse 1s ease-in-out infinite;
}

@keyframes timer-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* ---------- Submit Button (Header) ---------- */
.exam-header .btn-exam-submit {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 20px;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    background: var(--gio-color-action);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    white-space: nowrap;
}

.exam-header .btn-exam-submit:hover {
    background: var(--gio-color-action-hover);
    transform: translateY(-1px);
}

.exam-header .btn-exam-submit:active {
    transform: translateY(0);
}

/* ==========================================================================
   Split Panel Layout
   ========================================================================== */
.exam-split {
    display: flex;
    flex: 1;
    min-height: 0; /* crucial for flex overflow */
    overflow: hidden;
}

/* ---------- Left Panel (Script / Passage) ---------- */
.exam-left-panel {
    width: 50%;
    min-width: 280px;
    background: var(--exam-left-bg);
    overflow-y: auto;
    overflow-x: hidden;
    border-right: 1px solid var(--gio-color-border, #e5e5e5);
    display: flex;
    flex-direction: column;
}

.exam-left-panel .panel-content {
    flex: 1;
    padding: var(--exam-panel-padding);
    overflow-y: auto;
}

.exam-left-panel .panel-content h1,
.exam-left-panel .panel-content h2,
.exam-left-panel .panel-content h3 {
    color: var(--gio-color-text, #1a1a2e);
    margin-bottom: 12px;
}

.exam-left-panel .panel-content h2 {
    font-size: 20px;
    font-weight: 700;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--gio-color-action);
    margin-bottom: 20px;
}

.exam-left-panel .panel-content p {
    font-size: 15px;
    line-height: 1.8;
    margin-bottom: 14px;
    color: #444;
}

.exam-left-panel .panel-content img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 12px 0;
}

.exam-left-panel .panel-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 14px;
}

.exam-left-panel .panel-content table th,
.exam-left-panel .panel-content table td {
    padding: 8px 12px;
    border: 1px solid #ddd;
    text-align: left;
}

.exam-left-panel .panel-content table th {
    background: #eee;
    font-weight: 600;
}

/* Section label inside left panel */
.exam-left-panel .section-label {
    padding: 12px var(--exam-panel-padding);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--gio-color-action);
    border-bottom: 1px solid var(--gio-color-border, #e5e5e5);
    background: rgba(127, 0, 255, 0.04);
    flex-shrink: 0;
}

/* ---------- Resizer ---------- */
.exam-resizer {
    width: var(--exam-resizer-width);
    background: var(--gio-color-border, #e5e5e5);
    cursor: col-resize;
    flex-shrink: 0;
    position: relative;
    z-index: 10;
    transition: background 0.2s;
}

.exam-resizer:hover,
.exam-resizer.active {
    background: var(--gio-color-action);
}

.exam-resizer::after {
    content: '';
    position: absolute;
    top: 0;
    left: -4px;
    right: -4px;
    bottom: 0;
    /* invisible wider hit area */
}

/* ---------- Right Panel (Questions) ---------- */
.exam-right-panel {
    flex: 1;
    min-width: 320px;
    background: var(--exam-right-bg);
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

.exam-right-panel .panel-content {
    flex: 1;
    padding: var(--exam-panel-padding);
    overflow-y: auto;
}

/* ==========================================================================
   Question Styles
   ========================================================================== */

/* ---------- Question Group ---------- */
.q-group {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--gio-color-border, #e5e5e5);
}

.q-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

/* ---------- Directive (Instruction) ---------- */
.q-directive {
    margin-bottom: 20px;
    padding: 14px 18px;
    background: #f0ebff;
    border-left: 4px solid var(--gio-color-action);
    border-radius: 0 8px 8px 0;
    font-size: 14px;
    line-height: 1.7;
    color: #333;
}

.q-directive p {
    margin: 0 0 8px;
}

.q-directive p:last-child {
    margin-bottom: 0;
}

.q-directive strong,
.q-directive b {
    font-weight: 600;
    color: var(--gio-color-text, #1a1a2e);
}

.q-header {
    display: flex;
}
.q-title p {
    margin-bottom: 0;
}

/* ---------- Individual Question ---------- */
.q-item {
    margin-bottom: 20px;
    padding: 16px 18px;
    background: #fff;
    border: 1px solid var(--gio-color-border, #e5e5e5);
    border-radius: 10px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.q-item:hover {
    border-color: #d0d0d0;
}

.q-item.active,
.q-item.current {
    border-color: var(--gio-color-action);
    box-shadow: 0 0 0 3px rgba(127, 0, 255, 0.08);
}

.q-item.answered {
    border-color: var(--gio-color-action);
    background: rgba(127, 0, 255, 0.02);
}

/* ---------- Question Number Badge ---------- */
.q-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--gio-color-action);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    margin-right: 10px;
    flex-shrink: 0;
    line-height: 1;
}

.q-item-header {
    display: flex;
    align-items: flex-start;
    margin-bottom: 12px;
}

.q-item-header .q-text {
    font-size: 15px;
    font-weight: 500;
    color: #333;
    line-height: 1.6;
    padding-top: 2px;
}

/* ---------- Selection Item (Radio / Checkbox Option) ---------- */
.q-selection-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 14px;
    margin-bottom: 6px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
    border: 1px solid transparent;
}

.q-selection-item:last-child {
    margin-bottom: 0;
}

.q-selection-item:hover {
    background: var(--gio-color-bg, #f8f9fa);
}

.q-selection-item.selected {
    background: rgba(127, 0, 255, 0.06);
    border-color: var(--gio-color-action);
}

.q-selection-item input[type="radio"],
.q-selection-item input[type="checkbox"] {
    margin-top: 3px;
    accent-color: var(--gio-color-action);
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    cursor: pointer;
}

.q-selection-item .option-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #e8e8e8;
    color: #555;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s;
}

.q-selection-item.selected .option-label {
    background: var(--gio-color-action);
    color: #fff;
}

.q-selection-item .option-text {
    font-size: 14px;
    line-height: 1.6;
    color: #444;
    padding-top: 1px;
}

/* ---------- Select One (Radio Buttons) ---------- */
.q-select-one .q-options {
    display: flex;
    flex-direction: column;
}

/* ---------- Multiple Choice (Checkboxes) ---------- */
.q-multiple-choice .q-options {
    display: flex;
    flex-direction: column;
}

.q-multiple-choice .q-note {
    font-size: 12px;
    color: var(--gio-color-text-muted, #6c757d);
    font-style: italic;
    margin-bottom: 8px;
}

/* ---------- Multi-Group Part ("Choose TWO/THREE letters") ----------
   같은 group 의 N 개 question 을 묶어 N 개 letter 를 선택하는 멀티-셀렉트. */
.q-multi-group__hint {
    font-size: 12px;
    color: var(--gio-color-text-muted, #6c757d);
    font-style: italic;
    margin: 4px 0 8px;
}
.q-multi-group--limit-hit .q-multi-group__hint {
    color: var(--exam-timer-danger, #dc3545);
    animation: q-multi-group-shake 0.3s ease-in-out;
}
@keyframes q-multi-group-shake {
    0%,100% { transform: translateX(0); }
    25% { transform: translateX(-3px); }
    75% { transform: translateX(3px); }
}
/* 묶음 followup question — visual 공백 0, anchor 만 유지(pill scrollIntoView 지원). */
.question--multi-group-followup {
    height: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
    visibility: hidden;
}

/* ---------- Short Answer / Fill Bracket ---------- */
.q-short-answer {
    margin-top: 1rem;
}
.q-short-answer input,
.q-fill-bracket input {
    width: 100%;
    max-width: 400px;
    padding: 8px 14px;
    font-size: 15px;
    font-family: 'Poppins', sans-serif;
    border: 2px solid var(--gio-color-border, #e5e5e5);
    border-radius: 8px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fff;
    color: #333;
}

.q-short-answer input:focus,
.q-fill-bracket input:focus {
    border-color: var(--gio-color-action);
    box-shadow: 0 0 0 3px rgba(127, 0, 255, 0.1);
}

.q-short-answer input::placeholder,
.q-fill-bracket input::placeholder {
    color: #bbb;
    font-size: 14px;
}

/* ---------- Drop Box (Select Dropdown) ---------- */
.q-drop-box select {
    width: 100%;
    max-width: 400px;
    padding: 8px 36px 8px 14px;
    font-size: 15px;
    font-family: 'Poppins', sans-serif;
    border: 2px solid var(--gio-color-border, #e5e5e5);
    border-radius: 8px;
    outline: none;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23888' stroke-width='1.5' fill='none'/%3E%3C/svg%3E") no-repeat right 12px center;
    appearance: none;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    color: #333;
}

.q-drop-box select:focus {
    border-color: var(--gio-color-action);
    box-shadow: 0 0 0 3px rgba(127, 0, 255, 0.1);
}

/* ---------- Descriptive (Textarea) ---------- */
.q-descriptive textarea {
    width: 100%;
    min-height: 160px;
    padding: 12px 14px;
    font-size: 15px;
    font-family: 'Poppins', sans-serif;
    line-height: 1.7;
    border: 2px solid var(--gio-color-border, #e5e5e5);
    border-radius: 8px;
    outline: none;
    resize: vertical;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fff;
    color: #333;
}

.q-descriptive textarea:focus {
    border-color: var(--gio-color-action);
    box-shadow: 0 0 0 3px rgba(127, 0, 255, 0.1);
}

.q-descriptive .word-counter {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-top: 6px;
    font-size: 12px;
    color: var(--gio-color-text-muted, #6c757d);
    gap: 4px;
}

.q-descriptive .word-counter .count {
    font-weight: 600;
    color: var(--gio-color-action);
}

.q-descriptive .word-counter.over-limit .count {
    color: var(--exam-timer-danger);
}

/* ---------- Multiple Short Answers ---------- */
.q-multiple-short .short-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.q-multiple-short .short-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.q-multiple-short .short-item .short-label {
    font-size: 13px;
    font-weight: 600;
    color: #666;
    min-width: 24px;
    flex-shrink: 0;
}

.q-multiple-short .short-item input {
    flex: 1;
    max-width: 360px;
    padding: 8px 14px;
    font-size: 15px;
    font-family: 'Poppins', sans-serif;
    border: 2px solid var(--gio-color-border, #e5e5e5);
    border-radius: 8px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fff;
    color: #333;
}

.q-multiple-short .short-item input:focus {
    border-color: var(--gio-color-action);
    box-shadow: 0 0 0 3px rgba(127, 0, 255, 0.1);
}

/* ==========================================================================
   Audio Player (Listening Section)
   ========================================================================== */
.audio-player {
    padding: 24px var(--exam-panel-padding);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.audio-player .audio-label {
    font-size: 14px;
    font-weight: 600;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.audio-controls {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    max-width: 500px;
    padding: 16px 20px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.audio-controls .btn-play {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--gio-color-action);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 18px;
    flex-shrink: 0;
    transition: background 0.2s, transform 0.1s;
}

.audio-controls .btn-play:hover {
    background: var(--gio-color-action-hover);
    transform: scale(1.05);
}

.audio-controls .btn-play:active {
    transform: scale(0.97);
}

.audio-controls .progress-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.audio-controls .progress-bar-track {
    width: 100%;
    height: 6px;
    background: #e8e8e8;
    border-radius: 3px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
}

.audio-controls .progress-bar-fill {
    height: 100%;
    background: var(--gio-color-action);
    border-radius: 3px;
    width: 0%;
    transition: width 0.1s linear;
}

.audio-controls .progress-time {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: #999;
    font-variant-numeric: tabular-nums;
}

.audio-controls .volume-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.audio-controls .volume-wrap i {
    font-size: 16px;
    color: #888;
}

.audio-controls .volume-slider {
    width: 60px;
    height: 4px;
    accent-color: var(--gio-color-action);
    cursor: pointer;
}

/* Plays remaining indicator */
.audio-player .plays-remaining {
    font-size: 13px;
    color: var(--gio-color-text-muted, #6c757d);
}

.audio-player .plays-remaining strong {
    color: var(--gio-color-action);
    font-weight: 700;
}

/* ==========================================================================
   Exam Footer
   ========================================================================== */
.exam-footer {
    position: relative;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--exam-footer-height);
    padding: 0 16px;
    background: #fff;
    border-top: 1px solid var(--gio-color-border, #e5e5e5);
    flex-shrink: 0;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.04);
}

/* ---------- Section Navigation ---------- */
.exam-footer .section-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.exam-footer .btn-section-nav {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    font-size: 13px;
    font-weight: 500;
    font-family: 'Poppins', sans-serif;
    color: #555;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.exam-footer .btn-section-nav:hover {
    background: var(--gio-color-bg, #f8f9fa);
    border-color: #bbb;
    color: var(--gio-color-action);
}

.exam-footer .btn-section-nav:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.exam-footer .btn-section-nav:disabled:hover {
    background: #fff;
    border-color: #ddd;
    color: #555;
}

/* ---------- Question Number Pills ---------- */
.exam-footer .q-pills {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 4px 8px;
    scrollbar-width: thin;
    scrollbar-color: #ccc transparent;
    flex: 1;
    justify-content: center;
    min-width: 0;
}

.exam-footer .q-pills::-webkit-scrollbar {
    height: 3px;
}

.exam-footer .q-pills::-webkit-scrollbar-track {
    background: transparent;
}

.exam-footer .q-pills::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

/* Individual Pill */
.q-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--exam-pill-size);
    height: var(--exam-pill-size);
    border-radius: 50%;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    border: 2px solid #ddd;
    background: #fff;
    color: #888;
    flex-shrink: 0;
    line-height: 1;
    user-select: none;
}

.q-pill:hover {
    border-color: #bbb;
    background: var(--gio-color-bg, #f8f9fa);
    color: #555;
}

/* Unanswered */
.q-pill.unanswered {
    border-color: #ddd;
    background: #fff;
    color: #aaa;
}

/* Answered */
.q-pill.answered {
    border-color: var(--gio-color-action);
    background: var(--gio-color-action);
    color: #fff;
}

.q-pill.answered:hover {
    background: var(--gio-color-action-hover);
    border-color: var(--gio-color-action-hover);
}

/* Current (viewing) */
.q-pill.current {
    border-color: var(--gio-color-action);
    background: #fff;
    color: var(--gio-color-action);
    box-shadow: 0 0 0 3px rgba(127, 0, 255, 0.15);
}

.q-pill.current.answered {
    background: var(--gio-color-action);
    color: #fff;
    box-shadow: 0 0 0 3px rgba(127, 0, 255, 0.2);
}

/* Pill section separator */
.q-pills .pill-separator {
    width: 1px;
    height: 20px;
    background: #ddd;
    margin: 0 4px;
    flex-shrink: 0;
}

/* ==========================================================================
   Exam Scrollbar Styling
   ========================================================================== */
.exam-left-panel .panel-content,
.exam-right-panel .panel-content {
    scrollbar-width: thin;
    scrollbar-color: #ccc transparent;
}

.exam-left-panel .panel-content::-webkit-scrollbar,
.exam-right-panel .panel-content::-webkit-scrollbar {
    width: 6px;
}

.exam-left-panel .panel-content::-webkit-scrollbar-track,
.exam-right-panel .panel-content::-webkit-scrollbar-track {
    background: transparent;
}

.exam-left-panel .panel-content::-webkit-scrollbar-thumb,
.exam-right-panel .panel-content::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.exam-left-panel .panel-content::-webkit-scrollbar-thumb:hover,
.exam-right-panel .panel-content::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

/* ==========================================================================
   Selection Highlight (for referencing passage text)
   ========================================================================== */
.exam-left-panel .panel-content ::selection {
    background: rgba(127, 0, 255, 0.2);
    color: inherit;
}

/* ==========================================================================
   Responsive - Tablet
   ========================================================================== */
@media (max-width: 991px) {
    :root {
        --exam-panel-padding: 20px;
        --exam-pill-size: 30px;
    }

    .exam-header .exam-title {
        max-width: 200px;
        font-size: 14px;
    }

    .exam-header .exam-section-name {
        display: none;
    }

    .exam-timer {
        font-size: 16px;
        padding: 4px 10px;
    }

    .exam-header .btn-exam-submit {
        padding: 5px 14px;
        font-size: 12px;
    }

    .q-pill {
        font-size: 11px;
    }

    .exam-footer .btn-section-nav span.btn-label {
        display: none;
    }
}

/* ==========================================================================
   Responsive - Mobile (stacked layout)
   ========================================================================== */
@media (max-width: 767px) {
    :root {
        --exam-header-height: 50px;
        --exam-footer-height: 48px;
        --exam-panel-padding: 16px;
        --exam-pill-size: 28px;
    }

    /* Stack panels vertically */
    .exam-split {
        flex-direction: column;
    }

    .exam-left-panel {
        width: 100% !important;
        min-width: 0;
        max-height: 40vh;
        border-right: none;
        border-bottom: 2px solid var(--gio-color-border, #e5e5e5);
    }

    .exam-resizer {
        display: none;
    }

    .exam-right-panel {
        min-width: 0;
        flex: 1;
    }

    /* Header adjustments */
    .exam-header {
        padding: 0 12px;
    }

    .exam-header .exam-title {
        max-width: 120px;
        font-size: 13px;
    }

    .exam-header .exam-section-name {
        display: none;
    }

    .exam-timer {
        font-size: 14px;
        padding: 3px 8px;
        min-width: 60px;
    }

    .exam-header .btn-exam-submit {
        padding: 5px 12px;
        font-size: 12px;
    }

    .exam-header .btn-exam-submit .btn-label {
        display: none;
    }

    /* Footer adjustments */
    .exam-footer {
        padding: 0 10px;
        gap: 6px;
    }

    .exam-footer .btn-section-nav {
        padding: 5px 10px;
        font-size: 12px;
    }

    .exam-footer .btn-section-nav .btn-label {
        display: none;
    }

    .exam-footer .q-pills {
        gap: 3px;
        padding: 4px 4px;
    }

    .q-pill {
        font-size: 10px;
    }

    /* Question items */
    .q-item {
        padding: 12px 14px;
        margin-bottom: 14px;
    }

    .q-directive {
        padding: 10px 14px;
        font-size: 13px;
    }

    .q-selection-item {
        padding: 8px 10px;
    }

    .q-short-answer input,
    .q-fill-bracket input,
    .q-drop-box select,
    .q-multiple-short .short-item input {
        max-width: 100%;
        font-size: 14px;
    }

    .q-descriptive textarea {
        min-height: 120px;
        font-size: 14px;
    }

    /* Audio player */
    .audio-controls {
        flex-wrap: wrap;
        padding: 12px 16px;
    }

    .audio-controls .volume-wrap {
        width: 100%;
        justify-content: center;
        margin-top: 4px;
    }

}

/* ==========================================================================
   Print - Hide exam chrome
   ========================================================================== */
@media print {
    .exam-header,
    .exam-footer,
    .exam-resizer,
    .audio-controls {
        display: none !important;
    }

    body.exam-fullscreen {
        overflow: visible;
        height: auto;
    }

    .exam-split {
        flex-direction: column;
        overflow: visible;
    }

    .exam-left-panel,
    .exam-right-panel {
        width: 100% !important;
        overflow: visible;
        max-height: none;
    }
}

/* ==========================================================================
   Accessibility - Focus Visible
   ========================================================================== */
.q-selection-item:focus-within {
    outline: 2px solid var(--gio-color-action);
    outline-offset: 2px;
    border-radius: 8px;
}

.q-pill:focus-visible {
    outline: 2px solid var(--gio-color-action);
    outline-offset: 2px;
}

.exam-header .btn-exam-submit:focus-visible,
.exam-footer .btn-section-nav:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* ==========================================================================
   Drag-select prevention during resize
   ========================================================================== */
body.exam-fullscreen.resizing {
    cursor: col-resize;
    user-select: none;
}

body.exam-fullscreen.resizing * {
    cursor: col-resize !important;
    user-select: none !important;
}

/* ==========================================================================
   AI Scoring Badge (Writing / Speaking)
   ========================================================================== */
.q-ai-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    margin-bottom: 12px;
    background: linear-gradient(90deg, rgba(127,0,255,0.06), rgba(59,130,246,0.06));
    border: 1px solid rgba(127,0,255,0.15);
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    color: var(--gio-color-action);
}
.q-ai-badge i {
    font-size: 14px;
}

/* ---------- Word Counter with Progress Bar ---------- */
.q-word-counter {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
}
.q-wc-bar {
    flex: 1;
    height: 4px;
    background: #e8e8e8;
    border-radius: 2px;
    overflow: hidden;
}
.q-wc-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s, background 0.3s;
}
.q-wc-text {
    font-size: 12px;
    font-weight: 500;
    color: #888;
    white-space: nowrap;
}
.q-wc-text.text-success { color: #198754; }
.q-wc-text.text-warning { color: #f0850c; }

/* ---------- Writing Left Panel ---------- */
.writing-left-panel {
    padding: var(--exam-panel-padding);
}
.wlp-header {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 700;
    color: var(--gio-color-text, #1a1a2e);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--gio-color-action);
}
.wlp-header i {
    color: var(--gio-color-action);
    font-size: 22px;
}
.wlp-prompt {
    font-size: 15px;
    line-height: 1.8;
    color: #444;
    margin-bottom: 20px;
}
.wlp-prompt p { margin-bottom: 12px; }
.wlp-graph {
    margin: 16px 0;
}
.wlp-graph img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    border: 1px solid #eee;
}
.wlp-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: rgba(127,0,255,0.04);
    border-radius: 8px;
    font-size: 13px;
    color: #666;
    margin-top: 20px;
}
.wlp-info i {
    color: var(--gio-color-action);
    font-size: 16px;
    flex-shrink: 0;
}

/* ==========================================================================
   AI Loading Overlay (LOAD-01)
   ========================================================================== */
.ai-loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 40px;
}
.ai-loading-card {
    text-align: center;
    max-width: 480px;
    width: 100%;
}
.ai-loading-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gio-color-action), var(--gio-color-action, #3b82f6));
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    animation: ai-pulse 2s ease-in-out infinite;
}
@keyframes ai-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(127,0,255,0.3); }
    50% { transform: scale(1.05); box-shadow: 0 0 0 20px rgba(127,0,255,0); }
}
.ai-loading-icon i {
    font-size: 36px;
    color: #fff;
}
.ai-loading-title {
    font-size: 22px;
    font-weight: 700;
    color: #333;
    margin-bottom: 8px;
}
.ai-loading-subtitle {
    font-size: 14px;
    color: #888;
    margin-bottom: 32px;
}

/* Section steps */
.ai-section-steps {
    text-align: left;
    margin-bottom: 32px;
}
.ai-step {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 8px;
    transition: background 0.3s;
}
.ai-step.completed { background: rgba(25,135,84,0.06); }
.ai-step.processing { background: rgba(127,0,255,0.06); }
.ai-step.pending { background: #f9f9f9; }
.ai-step.failed { background: rgba(220,53,69,0.06); }

.ai-step-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}
.ai-step.completed .ai-step-icon { background: #198754; color: #fff; }
.ai-step.processing .ai-step-icon { background: var(--gio-color-action); color: #fff; }
.ai-step.pending .ai-step-icon { background: #e8e8e8; color: #999; }
.ai-step.failed .ai-step-icon { background: #dc3545; color: #fff; }

.ai-step-label {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    flex: 1;
}
.ai-step-status {
    font-size: 12px;
    font-weight: 500;
}
.ai-step.completed .ai-step-status { color: #198754; }
.ai-step.processing .ai-step-status { color: var(--gio-color-action); }
.ai-step.pending .ai-step-status { color: #999; }
.ai-step.failed .ai-step-status { color: #dc3545; }

.ai-step.processing .ai-step-icon .spinner-border {
    width: 16px;
    height: 16px;
    border-width: 2px;
}

.ai-loading-timeout {
    margin-top: 16px;
}
.ai-loading-timeout .btn {
    padding: 10px 28px;
    font-weight: 600;
}


/* ── MATCHING / IMAGE_MAP (drag&drop) ───────────────────────────── */
.q-matching, .q-imagemap {
    margin: 8px 0 16px;
}

.q-match-slot, .q-imgmap-slot {
    min-height: 36px;
    padding: 4px;
    background: #fff;
    border: 2px dashed #b9c4d9;
    border-radius: 6px;
    box-sizing: border-box;
}

.q-match-slot.sortable-over,
.q-imgmap-slot.sortable-over {
    border-color: var(--gio-color-action, #2563eb);
    background: #f0f6ff;
}

.q-match-pool {
    margin-top: 12px;
    padding: 8px;
    background: #f6f8fc;
    border-radius: 6px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-height: 40px;
}

.q-match-item {
    padding: 6px 10px;
    background: #fff;
    border: 1px solid #b9c4d9;
    border-radius: 4px;
    cursor: grab;
    user-select: none;
    font-size: 14px;
    line-height: 1.4;
}

.q-match-item:active {
    cursor: grabbing;
}

.q-imagemap-stage {
    position: relative;
    display: inline-block;
    max-width: 100%;
    margin-bottom: 12px;
}

.q-imagemap-stage img {
    display: block;
    max-width: 100%;
    height: auto;
}

.q-imgmap-slot {
    background: rgba(255, 255, 255, 0.85);
    min-width: 80px;
}
