/* =============================================
   Oxford Teachers — Quiz System Styles
   ============================================= */

/* ===== Quiz Dashboard (Teacher) ===== */

.ox-quiz-dashboard {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ===== View Tabs (My Quizzes / Library) ===== */

.ox-quiz-view-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--ox-border);
    margin-bottom: 24px;
}

.ox-quiz-view-tab {
    padding: 12px 24px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--ox-secondary);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--ox-transition);
}

.ox-quiz-view-tab .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.ox-quiz-view-tab:hover {
    color: var(--ox-dark);
}

.ox-quiz-view-tab.active {
    border-bottom-color: var(--ox-primary);
    color: var(--ox-primary);
    font-weight: 600;
}

/* ===== Library Filters ===== */

.ox-quiz-library-filters {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.ox-quiz-library-filters select {
    padding: 8px 12px;
    border: 1px solid var(--ox-border);
    border-radius: var(--ox-radius-sm);
    font-size: 0.9rem;
    min-width: 160px;
}

/* ===== Template Card ===== */

.ox-quiz-card-template {
    border-left: 4px solid #059669;
}

.ox-badge-template {
    background: #059669;
    color: var(--ox-white);
}

.ox-quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.ox-quiz-header h2 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--ox-primary);
}

.ox-quiz-subtitle {
    margin: 4px 0 0;
    color: var(--ox-secondary);
    font-size: 0.9em;
}

.ox-quiz-header-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ===== Type Filter Tabs ===== */

.ox-quiz-filter {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.ox-quiz-type-tabs {
    display: flex;
    gap: 4px;
    background: var(--ox-light);
    padding: 3px;
    border-radius: var(--ox-radius-sm);
}

.ox-quiz-type-tab {
    padding: 6px 16px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--ox-secondary);
    border-radius: var(--ox-radius-sm);
    transition: var(--ox-transition);
}

.ox-quiz-type-tab:hover {
    color: var(--ox-dark);
    background: rgba(255, 255, 255, 0.6);
}

.ox-quiz-type-tab.active {
    background: var(--ox-white);
    color: var(--ox-primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.ox-quiz-filter select {
    padding: 8px 12px;
    border: 1px solid var(--ox-border);
    border-radius: var(--ox-radius-sm);
    font-size: 0.9rem;
}

/* ===== Type Badges ===== */

.ox-badge-quiz {
    background: var(--ox-primary);
    color: var(--ox-white);
}

.ox-badge-test {
    background: #7c3aed;
    color: var(--ox-white);
}

.ox-badge-worksheet {
    background: #059669;
    color: var(--ox-white);
}

.ox-badge-archived {
    background: #9ca3af;
    color: var(--ox-white);
}

.ox-quiz-card-badges {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

/* ===== Quiz Card Grid ===== */

.ox-quiz-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
}

.ox-quiz-card {
    background: var(--ox-white);
    border: 1px solid var(--ox-border);
    border-radius: var(--ox-radius);
    padding: 20px;
    box-shadow: var(--ox-shadow);
    transition: var(--ox-transition);
}

.ox-quiz-card:hover {
    box-shadow: var(--ox-shadow-lg);
}

.ox-quiz-card-test {
    border-left: 4px solid #7c3aed;
}

.ox-quiz-card-worksheet {
    border-left: 4px solid #059669;
}

.ox-quiz-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    gap: 8px;
}

.ox-quiz-card-title {
    margin: 0;
    font-size: 1.05rem;
    color: var(--ox-dark);
    line-height: 1.3;
}

.ox-quiz-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    color: var(--ox-secondary);
    font-size: 0.85em;
    margin-bottom: 16px;
}

.ox-quiz-card-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.ox-quiz-card-meta .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.ox-quiz-card-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    border-top: 1px solid var(--ox-border);
    padding-top: 12px;
}

.ox-quiz-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--ox-secondary);
    grid-column: 1 / -1;
}

.ox-quiz-empty .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    opacity: 0.4;
}

/* ===== Question Editor ===== */

#ox-quiz-questions-container {
    padding: 20px 24px;
}

.ox-quiz-questions-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--ox-border);
    gap: 8px;
    flex-wrap: wrap;
}

.ox-quiz-question-stats {
    color: var(--ox-secondary);
    font-size: 0.9em;
}

.ox-quiz-questions-list {
    min-height: 60px;
}

.ox-quiz-question-item {
    background: var(--ox-light);
    border: 1px solid var(--ox-border);
    border-radius: var(--ox-radius-sm);
    padding: 16px;
    margin-bottom: 10px;
    transition: var(--ox-transition);
}

.ox-quiz-question-item:hover {
    border-color: var(--ox-primary-light);
}

.ox-quiz-question-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.ox-quiz-question-num {
    font-weight: bold;
    color: var(--ox-primary);
    font-size: 0.95em;
}

.ox-quiz-question-points {
    margin-left: auto;
    font-size: 0.85em;
    color: var(--ox-secondary);
}

.ox-quiz-question-actions {
    display: flex;
    gap: 4px;
}

.ox-btn-ghost {
    background: none;
    border: 1px solid transparent;
    color: var(--ox-secondary);
    cursor: pointer;
    padding: 2px 4px;
    border-radius: var(--ox-radius-sm);
}
.ox-btn-ghost:hover {
    background: var(--ox-light);
    color: var(--ox-primary);
    border-color: var(--ox-border);
}

.ox-quiz-question-text {
    font-size: 0.95em;
    color: var(--ox-dark);
    margin-bottom: 8px;
    line-height: 1.4;
    letter-spacing: normal;
    word-spacing: normal;
}

/* Prevent pasted/rich-text inline styles from breaking letter spacing */
.ox-quiz-question-text *,
.ox-quiz-review-question-header strong,
.ox-quiz-review-question-header strong * {
    letter-spacing: normal !important;
    word-spacing: normal !important;
}

.ox-quiz-question-preview {
    font-size: 0.85em;
    color: var(--ox-secondary);
}

.ox-quiz-option-preview {
    padding: 3px 0;
    display: flex;
    align-items: center;
    gap: 4px;
}

.ox-quiz-option-preview .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

.ox-quiz-option-preview.ox-correct {
    color: var(--ox-success);
    font-weight: 600;
}

.ox-quiz-matching-preview div {
    padding: 2px 0;
}

.ox-quiz-ordering-preview {
    margin: 4px 0;
    padding-left: 20px;
}

/* Rich Text Toolbar & Editor */

.ox-richtext-toolbar {
    display: flex;
    gap: 2px;
    padding: 4px 6px;
    background: var(--ox-light);
    border: 1px solid var(--ox-border);
    border-bottom: none;
    border-radius: var(--ox-radius-sm) var(--ox-radius-sm) 0 0;
}

.ox-richtext-btn {
    width: 30px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 4px;
    background: transparent;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--ox-dark);
    transition: var(--ox-transition);
    padding: 0;
}

.ox-richtext-btn:hover {
    background: rgba(0, 0, 0, 0.08);
    border-color: var(--ox-border);
}

.ox-richtext-btn-active {
    background: var(--ox-primary) !important;
    color: var(--ox-white) !important;
    border-color: var(--ox-primary) !important;
}

.ox-richtext-sep {
    width: 1px;
    height: 20px;
    background: var(--ox-border);
    margin: 4px 4px;
    align-self: center;
}

.ox-richtext-table-btn .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* Table insert prompt */
.ox-table-insert-prompt {
    padding: 10px 12px;
    background: #f0f4ff;
    border: 1px solid var(--ox-primary);
    border-radius: var(--ox-radius-sm);
    margin-bottom: 6px;
}
.ox-table-insert-prompt label {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 6px;
    display: block;
}
.ox-table-insert-prompt input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid var(--ox-border);
    border-radius: 4px;
    font-size: 0.9rem;
    margin-bottom: 8px;
}
.ox-table-insert-actions {
    display: flex;
    gap: 6px;
}

/* Tables inside richtext editor */
.ox-richtext-editor table {
    border-collapse: collapse;
    margin: 6px 0;
    width: auto;
}
.ox-richtext-editor table td,
.ox-richtext-editor table th {
    border: 1px solid var(--ox-border, #dee2e6);
    padding: 4px 14px;
    text-align: center;
}
.ox-richtext-editor table td {
    font-weight: 600;
}
.ox-richtext-editor table th {
    background: #ebf1fa;
    color: var(--ox-primary, #1e3a5f);
    font-weight: 700;
}

.ox-richtext-editor {
    width: 100%;
    min-height: 50px;
    padding: 10px 14px;
    border: 1px solid var(--ox-border);
    border-radius: 0 0 var(--ox-radius-sm) var(--ox-radius-sm);
    font-size: 0.95rem;
    line-height: 1.5;
    transition: var(--ox-transition);
    box-sizing: border-box;
    outline: none;
    background: var(--ox-white);
}

.ox-richtext-editor:focus {
    border-color: var(--ox-primary);
    box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.1);
}

.ox-richtext-editor:empty::before {
    content: attr(data-placeholder);
    color: #aaa;
    pointer-events: none;
}

/* Question Form */

.ox-quiz-question-form-wrapper {
    background: var(--ox-white);
    border: 2px solid var(--ox-primary);
    border-radius: var(--ox-radius);
    padding: 24px;
    margin-top: 16px;
    scroll-margin-top: 20px;
}

.ox-quiz-question-form-wrapper h4 {
    margin: 0 0 20px;
    color: var(--ox-primary);
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Override global .ox-form-group input { width: 100% } for quiz form elements */
.ox-quiz-question-form-wrapper .ox-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--ox-dark);
    font-size: 0.9rem;
}

.ox-quiz-question-form-wrapper .ox-form-group textarea,
.ox-quiz-question-form-wrapper .ox-form-group > input[type="text"],
.ox-quiz-question-form-wrapper .ox-form-group > input[type="number"] {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--ox-border);
    border-radius: var(--ox-radius-sm);
    font-size: 0.95rem;
    transition: var(--ox-transition);
    box-sizing: border-box;
}

.ox-quiz-question-form-wrapper .ox-form-group textarea:focus,
.ox-quiz-question-form-wrapper .ox-form-group > input:focus {
    outline: none;
    border-color: var(--ox-primary);
    box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.1);
}

.ox-quiz-question-form-wrapper .ox-form-group select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--ox-border);
    border-radius: var(--ox-radius-sm);
    font-size: 0.95rem;
    background: var(--ox-white);
}

.ox-quiz-question-form-wrapper .ox-form-group {
    margin-bottom: 16px;
}

.ox-quiz-question-form-wrapper .ox-form-row {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.ox-quiz-question-form-wrapper .ox-form-half {
    flex: 1;
}

/* MC / Option rows — reset global .ox-form-group input width */
.ox-quiz-option-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    padding: 8px 12px;
    background: var(--ox-light);
    border-radius: var(--ox-radius-sm);
    border: 1px solid transparent;
    transition: var(--ox-transition);
}

.ox-quiz-option-row:hover {
    border-color: var(--ox-primary-light);
}

.ox-quiz-option-row input[type="text"],
.ox-quiz-option-row input[type="number"] {
    flex: 1;
    width: auto !important;
    padding: 8px 12px;
    border: 1px solid var(--ox-border);
    border-radius: var(--ox-radius-sm);
    font-size: 0.95rem;
    background: var(--ox-white);
    transition: var(--ox-transition);
}

.ox-quiz-option-row input[type="text"]:focus {
    outline: none;
    border-color: var(--ox-primary);
    box-shadow: 0 0 0 2px rgba(30, 58, 95, 0.1);
}

.ox-quiz-option-row input[type="radio"] {
    flex-shrink: 0;
    width: 18px !important;
    height: 18px;
    accent-color: var(--ox-primary);
    cursor: pointer;
}

.ox-quiz-tf-options {
    display: flex;
    gap: 24px;
}

/* Matching rows — same override */
.ox-quiz-match-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    padding: 8px 12px;
    background: var(--ox-light);
    border-radius: var(--ox-radius-sm);
}

.ox-quiz-match-row input[type="text"] {
    flex: 1;
    width: auto !important;
    padding: 8px 12px;
    border: 1px solid var(--ox-border);
    border-radius: var(--ox-radius-sm);
    font-size: 0.95rem;
    background: var(--ox-white);
}

.ox-quiz-match-row input[type="text"]:focus {
    outline: none;
    border-color: var(--ox-primary);
    box-shadow: 0 0 0 2px rgba(30, 58, 95, 0.1);
}

.ox-match-arrow {
    color: var(--ox-secondary);
    font-weight: bold;
    flex-shrink: 0;
    font-size: 1.1em;
}

/* Ordering rows — same override */
.ox-quiz-order-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    padding: 8px 12px;
    background: var(--ox-light);
    border-radius: var(--ox-radius-sm);
}

.ox-quiz-order-row input[type="text"] {
    flex: 1;
    width: auto !important;
    padding: 8px 12px;
    border: 1px solid var(--ox-border);
    border-radius: var(--ox-radius-sm);
    font-size: 0.95rem;
    background: var(--ox-white);
}

.ox-quiz-order-row input[type="text"]:focus {
    outline: none;
    border-color: var(--ox-primary);
    box-shadow: 0 0 0 2px rgba(30, 58, 95, 0.1);
}

.ox-order-num {
    font-weight: bold;
    color: var(--ox-primary);
    min-width: 24px;
}

/* Add buttons under option lists */
#ox-mc-add-option,
#ox-fb-add-answer,
#ox-match-add-pair,
#ox-order-add-item {
    margin-top: 4px;
}

.ox-radio-label,
.ox-checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 0.9rem;
}

/* Question form actions */
.ox-quiz-question-form-wrapper .ox-form-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    padding-top: 16px;
    margin-top: 16px;
    border-top: 1px solid var(--ox-border);
}

/* ===== Submissions / Review (Teacher) ===== */

#ox-quiz-review-container {
    padding: 20px 24px;
}

.ox-quiz-submissions-toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 12px;
}

.ox-quiz-review-header {
    background: var(--ox-light);
    padding: 16px;
    border-radius: var(--ox-radius-sm);
    margin-bottom: 20px;
}

.ox-quiz-review-header h4 {
    margin: 0 0 4px;
}

.ox-quiz-review-header p {
    margin: 0;
    color: var(--ox-secondary);
}

.ox-quiz-review-answer {
    padding: 16px;
    border-left: 4px solid var(--ox-border);
    margin: 12px 0;
    background: var(--ox-white);
    border-radius: 0 var(--ox-radius-sm) var(--ox-radius-sm) 0;
}

.ox-quiz-review-answer.ox-correct {
    border-left-color: var(--ox-success);
    background: rgba(40, 167, 69, 0.03);
}

.ox-quiz-review-answer.ox-incorrect {
    border-left-color: var(--ox-danger);
    background: rgba(220, 53, 69, 0.03);
}

.ox-quiz-review-answer.ox-pending {
    border-left-color: var(--ox-warning);
    background: rgba(255, 193, 7, 0.03);
}

.ox-quiz-review-question-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 10px;
}

.ox-quiz-review-student-answer {
    margin: 8px 0;
    padding: 8px 12px;
    background: var(--ox-light);
    border-radius: var(--ox-radius-sm);
    font-size: 0.9em;
}

.ox-quiz-review-correct-answer {
    margin: 8px 0;
    padding: 8px 12px;
    background: rgba(40, 167, 69, 0.08);
    border-radius: var(--ox-radius-sm);
    font-size: 0.9em;
    color: #155724;
}

.ox-quiz-review-score-row,
.ox-quiz-review-feedback-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    font-size: 0.9em;
}

.ox-quiz-review-score-row input[type="number"] {
    width: 70px;
    padding: 6px 8px;
    border: 1px solid var(--ox-border);
    border-radius: var(--ox-radius-sm);
}

.ox-quiz-review-feedback-row input[type="text"] {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid var(--ox-border);
    border-radius: var(--ox-radius-sm);
    font-size: 0.9em;
}

/* Quick Grade Buttons */
.ox-quick-grade-btns {
    display: inline-flex;
    gap: 4px;
    margin-left: 8px;
}

.ox-btn-xs {
    padding: 2px 8px;
    font-size: 0.75em;
    line-height: 1.4;
    border-radius: 3px;
    cursor: pointer;
    border: none;
    font-weight: 600;
}

.ox-btn-xs.ox-btn-success { background: var(--ox-success); color: #fff; }
.ox-btn-xs.ox-btn-warning { background: var(--ox-warning); color: #333; }
.ox-btn-xs.ox-btn-danger { background: var(--ox-danger); color: #fff; }
.ox-btn-xs.ox-btn-secondary { background: var(--ox-secondary); color: #fff; }
.ox-btn-xs:hover { opacity: 0.85; }

/* Review question header layout */
.ox-review-header-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

/* Collapsible question details in review */
.ox-review-question-details {
    margin: 8px 0;
    padding: 12px;
    background: #f8f9fc;
    border: 1px solid var(--ox-border);
    border-radius: var(--ox-radius-sm);
}

.ox-review-question-details .ox-q-image {
    margin-bottom: 8px;
    text-align: center;
}

.ox-review-question-details .ox-q-image img {
    max-width: 100%;
    max-height: 350px;
    object-fit: contain;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}

.ox-review-question-details .ox-q-audio {
    margin-bottom: 8px;
}

.ox-review-question-details .ox-q-audio audio {
    width: 100%;
}

.ox-review-long-text {
    padding: 10px 12px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: var(--ox-radius-sm);
    font-size: 0.9em;
    white-space: pre-wrap;
    max-height: 200px;
    overflow-y: auto;
}

/* =============================================
   Quiz Take (Student-Facing)
   ============================================= */

/* Hide navigation menus on student quiz page — show only logo + quiz content */
body:has(#ox-quiz-take) .oxford-account-menu,
body:has(#ox-quiz-take) .oxford-account-menu--horizontal {
    display: none !important;
}

.ox-quiz-take {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Constrain any images inside quiz content (includes WP emoji/twemoji img tags) */
.ox-quiz-take img.emoji,
.ox-quiz-take img.wp-smiley,
.ox-quiz-take .ox-quiz-question-text img,
.ox-quiz-take .ox-q-example-text img,
.ox-quiz-take .ox-quiz-section-card-title img,
.ox-quiz-take .ox-quiz-section-card-desc img {
    max-width: 100% !important;
    height: 1em !important;
    width: 1em !important;
    vertical-align: -0.1em !important;
    margin: 0 .07em !important;
    display: inline !important;
}

/* Allow selection inside inputs/textareas so students can edit their own text */
.ox-quiz-take input,
.ox-quiz-take textarea {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

.ox-quiz-state {
    /* States are toggled via JS display */
}

.ox-quiz-centered {
    text-align: center;
    padding: 40px 20px;
}

/* Identify Step */

.ox-quiz-identify-header {
    text-align: center;
    margin-bottom: 20px;
}

.ox-quiz-type-badge {
    display: inline-block;
    background: var(--ox-primary);
    color: var(--ox-white);
    padding: 4px 14px;
    border-radius: 12px;
    font-size: 0.75em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.ox-quiz-take-test .ox-quiz-type-badge {
    background: #7c3aed;
}

.ox-quiz-take-test .ox-quiz-class-badge {
    background: #7c3aed;
}

.ox-quiz-take-test .ox-btn-primary {
    background: #7c3aed;
    border-color: #7c3aed;
}

.ox-quiz-take-test .ox-btn-primary:hover {
    background: #6d28d9;
    border-color: #6d28d9;
}

.ox-quiz-take-test #ox-quiz-progress-fill {
    background: #7c3aed;
}

/* Worksheet variant — green */
.ox-quiz-take-worksheet .ox-quiz-type-badge {
    background: #059669;
}

.ox-quiz-take-worksheet .ox-quiz-class-badge {
    background: #059669;
}

.ox-quiz-take-worksheet .ox-btn-primary {
    background: #059669;
    border-color: #059669;
}

.ox-quiz-take-worksheet .ox-btn-primary:hover {
    background: #047857;
    border-color: #047857;
}

.ox-quiz-take-worksheet #ox-quiz-progress-fill {
    background: #059669;
}

.ox-quiz-identify-header h2 {
    margin: 0 0 8px;
    color: var(--ox-primary);
}

.ox-quiz-class-badge {
    display: inline-block;
    background: var(--ox-primary);
    color: var(--ox-white);
    padding: 4px 16px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
}

.ox-quiz-desc {
    text-align: center;
    color: var(--ox-secondary);
    margin-bottom: 20px;
    line-height: 1.5;
}

.ox-quiz-time-info {
    text-align: center;
    margin-bottom: 20px;
    padding: 10px;
    background: #fff8e1;
    border-radius: var(--ox-radius-sm);
    color: #856404;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-weight: 500;
}

.ox-quiz-take .ox-form-group {
    margin-bottom: 16px;
}

.ox-quiz-take .ox-form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: var(--ox-dark);
    font-size: 0.9rem;
}

.ox-quiz-take .ox-form-group select,
.ox-quiz-take .ox-form-group input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--ox-border);
    border-radius: var(--ox-radius-sm);
    font-size: 1rem;
    transition: var(--ox-transition);
}

.ox-quiz-take .ox-form-group select:focus,
.ox-quiz-take .ox-form-group input:focus {
    outline: none;
    border-color: var(--ox-primary);
    box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.1);
}

.ox-quiz-take .ox-form-hint {
    display: block;
    margin-top: 4px;
    font-size: 0.8rem;
    color: #999;
}

.ox-quiz-inline-error {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 0.9rem;
    margin-bottom: 12px;
}

.ox-quiz-retake-warning {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 0.9rem;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.ox-quiz-retake-warning .dashicons {
    color: #d97706;
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.ox-btn-block {
    display: block;
    width: 100%;
    text-align: center;
}

.ox-btn-lg {
    padding: 14px 24px;
    font-size: 1.05rem;
}

/* Progress Bar */

.ox-quiz-progress {
    position: sticky;
    top: 0;
    background: var(--ox-white);
    padding: 12px 0;
    z-index: 10;
    border-bottom: 1px solid var(--ox-border);
    margin-bottom: 20px;
}

.ox-quiz-progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9em;
    color: var(--ox-secondary);
    margin-bottom: 8px;
}

.ox-quiz-timer {
    font-size: 1.2em;
    font-weight: bold;
    color: var(--ox-primary);
    font-variant-numeric: tabular-nums;
}

.ox-quiz-timer.ox-timer-caution {
    color: var(--ox-warning);
}

.ox-quiz-timer.ox-timer-warning {
    color: var(--ox-danger);
    animation: ox-timer-pulse 1s ease-in-out infinite;
}

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

.ox-quiz-progress-bar {
    height: 4px;
    background: var(--ox-border);
    border-radius: 2px;
    overflow: hidden;
}

#ox-quiz-progress-fill {
    height: 100%;
    background: var(--ox-success);
    border-radius: 2px;
    transition: width 0.3s ease;
    width: 0%;
}

/* Question Cards (Student) */

.ox-quiz-question-card {
    background: var(--ox-white);
    border: 1px solid var(--ox-border);
    border-radius: var(--ox-radius);
    padding: 24px;
    margin-bottom: 16px;
    transition: var(--ox-transition);
}

.ox-quiz-question-card:hover {
    border-color: var(--ox-primary-light);
}

.ox-quiz-question-card .ox-quiz-question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.ox-quiz-question-card .ox-quiz-question-number {
    color: var(--ox-primary);
    font-weight: bold;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ox-quiz-question-card .ox-quiz-question-points {
    color: var(--ox-secondary);
    font-size: 0.85em;
}

.ox-quiz-question-card .ox-quiz-question-text {
    font-size: 1.05rem;
    line-height: 1.5;
    color: var(--ox-dark);
    margin-bottom: 16px;
}

/* Word bank tables inside question text */
.ox-quiz-question-text table {
    margin-top: 10px;
    border-collapse: collapse;
    width: auto;
}
.ox-quiz-question-text table td {
    border: 1px solid var(--ox-border, #dee2e6);
    padding: 6px 16px;
    text-align: center;
    font-weight: 600;
}

/* Multiple Choice / True False */

.ox-quiz-mc-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    margin-bottom: 8px;
    border: 1px solid var(--ox-border);
    border-radius: var(--ox-radius-sm);
    cursor: pointer;
    transition: var(--ox-transition);
}

.ox-quiz-mc-option:hover {
    border-color: var(--ox-primary-light);
    background: rgba(30, 58, 95, 0.02);
}

.ox-quiz-mc-option input[type="radio"] {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    accent-color: var(--ox-primary);
}

.ox-quiz-mc-option input[type="radio"]:checked + .ox-quiz-mc-label {
    font-weight: 600;
    color: var(--ox-primary);
}

.ox-quiz-mc-label {
    font-size: 0.95rem;
}

/* Open-ended */

.ox-quiz-textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--ox-border);
    border-radius: var(--ox-radius-sm);
    font-size: 0.95rem;
    font-family: inherit;
    resize: vertical;
    min-height: 100px;
    transition: var(--ox-transition);
}

.ox-quiz-textarea:focus {
    outline: none;
    border-color: var(--ox-primary);
    box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.1);
}

/* Fill in the Blank */

.ox-quiz-text-input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--ox-border);
    border-radius: var(--ox-radius-sm);
    font-size: 0.95rem;
    transition: var(--ox-transition);
}

.ox-quiz-text-input:focus {
    outline: none;
    border-color: var(--ox-primary);
    box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.1);
}

/* Fill Multiple Blanks — Teacher Form */

.ox-quiz-fm-blank-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.ox-quiz-fm-blank-row .ox-fm-label-input {
    width: 50px !important;
    text-align: center;
    font-weight: 600;
    flex-shrink: 0;
    padding: 8px 4px;
    border: 1px solid var(--ox-border);
    border-radius: var(--ox-radius-sm);
    font-size: 0.95rem;
}

.ox-quiz-fm-blank-row .ox-fm-answers-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--ox-border);
    border-radius: var(--ox-radius-sm);
    font-size: 0.95rem;
}

.ox-quiz-fm-blank-row .ox-fm-answers-input:focus,
.ox-quiz-fm-blank-row .ox-fm-label-input:focus {
    outline: none;
    border-color: var(--ox-primary);
    box-shadow: 0 0 0 2px rgba(30, 58, 95, 0.1);
}

/* Fill Multiple Blanks — Student UI */

.ox-quiz-fm-answers {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ox-quiz-fm-answer-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ox-quiz-fm-label {
    font-weight: 600;
    color: var(--ox-primary);
    min-width: 36px;
    text-align: center;
    flex-shrink: 0;
}

.ox-quiz-fm-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--ox-border);
    border-radius: var(--ox-radius-sm);
    font-size: 0.95rem;
    max-width: 300px;
    transition: var(--ox-transition);
}

.ox-quiz-fm-input:focus {
    outline: none;
    border-color: var(--ox-primary);
    box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.1);
}

/* Matching */

.ox-quiz-matching-area {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ox-quiz-match-pair {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ox-quiz-match-left {
    flex: 1;
    padding: 10px 14px;
    background: var(--ox-light);
    border-radius: var(--ox-radius-sm);
    font-weight: 500;
    text-align: right;
}

.ox-quiz-match-pair select {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--ox-border);
    border-radius: var(--ox-radius-sm);
    font-size: 0.95rem;
    transition: var(--ox-transition);
}

.ox-quiz-match-pair select:focus {
    outline: none;
    border-color: var(--ox-primary);
    box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.1);
}

/* Ordering */

.ox-quiz-ordering-area .ox-form-hint {
    margin-bottom: 8px;
}

.ox-quiz-ordering-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ox-quiz-ordering-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: var(--ox-white);
    border: 1px solid var(--ox-border);
    border-radius: var(--ox-radius-sm);
    margin-bottom: 6px;
    cursor: grab;
    transition: var(--ox-transition);
    user-select: none;
}

.ox-quiz-ordering-item:hover {
    border-color: var(--ox-primary-light);
    background: rgba(30, 58, 95, 0.02);
}

.ox-ordering-grip {
    color: var(--ox-secondary);
    opacity: 0.5;
}

.ox-ordering-grip .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.ox-ordering-text {
    flex: 1;
    font-size: 0.95rem;
}

.ox-ordering-arrows {
    display: flex;
    gap: 4px;
}

/* Teacher Preview Banner */

.ox-quiz-preview-banner {
    background: #fef3cd;
    border: 1px solid #ffc107;
    color: #856404;
    padding: 10px 16px;
    border-radius: var(--ox-radius);
    margin-bottom: 16px;
    font-size: 0.9rem;
}
.ox-quiz-preview-banner .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    vertical-align: text-bottom;
    margin-right: 4px;
}

/* Submit Area */

.ox-quiz-submit-area {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--ox-border);
}

.ox-quiz-submit-warning {
    text-align: center;
    color: var(--ox-warning);
    margin-bottom: 12px;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

/* ===== Section Header (Teacher Editor) ===== */

.ox-quiz-section-header-item {
    background: var(--ox-white);
    border-left: 4px solid var(--ox-primary);
}

.ox-quiz-section-header-item .ox-quiz-question-header {
    margin-bottom: 4px;
}

.ox-quiz-section-icon .dashicons {
    color: var(--ox-primary);
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.ox-quiz-section-title {
    font-size: 1.05em;
    font-weight: 600;
    color: var(--ox-primary);
}

.ox-quiz-section-desc {
    font-size: 0.85em;
    color: var(--ox-secondary);
    margin-top: 4px;
    line-height: 1.4;
    font-style: italic;
}

.ox-quiz-section-example {
    background: #fff8e1;
    border-left: 3px solid #f9a825;
    border-radius: 3px;
    padding: 8px 12px;
    margin-top: 8px;
    font-size: 0.85em;
    line-height: 1.5;
    color: #333;
    font-style: italic;
}

.ox-quiz-section-example::before {
    content: 'Example: ';
    font-weight: 700;
    font-style: normal;
    color: #e65100;
}

/* Batch creation flash */

.ox-quiz-question-form-wrapper.ox-flash-success {
    animation: ox-flash-border 0.6s ease;
}

@keyframes ox-flash-border {
    0% { border-color: var(--ox-primary); }
    30% { border-color: var(--ox-success); box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.15); }
    100% { border-color: var(--ox-primary); box-shadow: none; }
}

/* ===== Section Header (Student Page — Google Forms Style) ===== */

.ox-quiz-section-card {
    background: var(--ox-white);
    border: 1px solid var(--ox-border);
    border-radius: var(--ox-radius);
    border-top: 4px solid var(--ox-primary);
    padding: 24px;
    margin-bottom: 16px;
    margin-top: 8px;
}

.ox-quiz-take-test .ox-quiz-section-card {
    border-top-color: #7c3aed;
}

.ox-quiz-take-worksheet .ox-quiz-section-card {
    border-top-color: #059669;
}

.ox-quiz-section-card-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--ox-dark);
    line-height: 1.3;
}

/* Word bank tables inside section titles */
.ox-quiz-section-card-title table {
    margin-top: 10px;
    border-collapse: collapse;
    width: auto;
    font-weight: 600;
}
.ox-quiz-section-card-title table td {
    border: 1px solid var(--ox-border, #dee2e6);
    padding: 6px 16px;
    text-align: center;
}

.ox-quiz-section-card-desc {
    font-size: 0.95rem;
    color: var(--ox-secondary);
    line-height: 1.5;
    margin-top: 8px;
}

.ox-quiz-section-card-desc table,
.ox-quiz-section-desc table {
    border-collapse: collapse;
    margin: 8px 0;
    width: auto;
    min-width: 50%;
}
.ox-quiz-section-card-desc table th,
.ox-quiz-section-card-desc table td,
.ox-quiz-section-desc table th,
.ox-quiz-section-desc table td {
    border: 1px solid var(--ox-border, #dee2e6);
    padding: 6px 14px;
    text-align: center;
}
.ox-quiz-section-card-desc table th,
.ox-quiz-section-desc table th {
    background: #ebf1fa;
    color: var(--ox-primary, #1e3a5f);
    font-weight: 600;
}

/* First card gets accent top border (Google Forms style) */
#ox-quiz-questions-list > .ox-quiz-question-card:first-child {
    border-top: 4px solid var(--ox-primary);
}

.ox-quiz-take-test #ox-quiz-questions-list > .ox-quiz-question-card:first-child {
    border-top-color: #7c3aed;
}

.ox-quiz-take-worksheet #ox-quiz-questions-list > .ox-quiz-question-card:first-child {
    border-top-color: #059669;
}

/* ===== Crossword — Teacher Preview ===== */

.ox-crossword-preview {
    margin-top: 12px;
    padding: 16px;
    background: var(--ox-light);
    border: 1px solid var(--ox-border);
    border-radius: var(--ox-radius);
    text-align: center;
}

.ox-crossword-table {
    border-collapse: collapse;
    margin: 0 auto 12px;
}

.ox-crossword-cell {
    width: 28px;
    height: 28px;
    border: 1px solid var(--ox-border);
    text-align: center;
    vertical-align: middle;
    position: relative;
    font-size: 12px;
    font-weight: bold;
}

.ox-crossword-cell-active {
    background: #fff;
}

.ox-crossword-cell-blank {
    background: #1e3a5f;
    border-color: #1e3a5f;
}

.ox-crossword-cell-number {
    position: absolute;
    top: 1px;
    left: 2px;
    font-size: 7px;
    font-weight: normal;
    color: var(--ox-secondary);
    line-height: 1;
}

.ox-crossword-cell-letter {
    font-size: 13px;
}

.ox-crossword-clues-preview {
    display: flex;
    gap: 24px;
    justify-content: center;
    text-align: left;
    font-size: 0.85rem;
    margin-top: 8px;
}

.ox-crossword-clues-preview > div {
    flex: 1;
    max-width: 250px;
}

/* Crossword word input rows */
.ox-cw-word-row .ox-cw-word-input {
    flex: 0 0 130px !important;
    font-weight: bold;
    letter-spacing: 1px;
}

.ox-cw-word-row .ox-cw-clue-input {
    flex: 1 !important;
}

/* ===== Crossword — Student Interactive Grid ===== */

.ox-crossword-grid {
    text-align: center;
    margin-bottom: 16px;
    overflow-x: auto;
}

.ox-crossword-grid table {
    border-collapse: separate;
    border-spacing: 0;
    margin: 0 auto;
    border: none;
    table-layout: fixed;
    width: auto !important;
    display: inline-table;
}

.ox-crossword-grid td {
    width: 40px;
    height: 0;
    padding: 0;
    padding-bottom: 40px;
    box-sizing: border-box;
    position: relative;
    border: none;
    overflow: hidden;
}

.ox-crossword-grid td input,
.ox-crossword-grid td .cell-number {
    position: absolute;
}

.ox-crossword-grid td.active {
    background: #fff;
    border: 2px solid #333;
    cursor: pointer;
}

.ox-crossword-grid td.blank {
    background: transparent;
    border: none;
}

.ox-crossword-grid td.highlighted {
    background: #dbeafe;
}

.ox-crossword-grid td .cell-number {
    position: absolute;
    top: 2px;
    left: 3px;
    font-size: 10px;
    font-weight: 600;
    color: #333;
    line-height: 1;
    pointer-events: none;
    z-index: 1;
}

.ox-crossword-grid td input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    background: transparent;
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    text-transform: uppercase;
    padding: 0;
    outline: none;
    caret-color: var(--ox-primary);
}

.ox-crossword-grid td input:focus {
    background: #fff3cd;
}

.ox-crossword-clues {
    display: flex;
    gap: 24px;
    margin-top: 16px;
}

.ox-crossword-clues-col {
    flex: 1;
}

.ox-crossword-clues-col h4 {
    margin: 0 0 8px;
    font-size: 0.95rem;
    color: var(--ox-primary);
    border-bottom: 2px solid var(--ox-primary);
    padding-bottom: 4px;
}

.ox-crossword-clue {
    padding: 4px 8px;
    font-size: 0.9rem;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.15s;
    line-height: 1.4;
}

.ox-crossword-clue:hover {
    background: #f0f4f8;
}

.ox-crossword-clue.active {
    background: #e0edff;
    font-weight: 500;
}

/* Test variant */
.ox-quiz-take-test .ox-crossword-grid td.highlighted {
    background: #ede9fe;
}

.ox-quiz-take-test .ox-crossword-grid td input:focus {
    background: #fef3c7;
}

.ox-quiz-take-test .ox-crossword-clues-col h4 {
    color: #7c3aed;
    border-bottom-color: #7c3aed;
}

.ox-quiz-take-test .ox-crossword-clue.active {
    background: #ede9fe;
}

/* Worksheet crossword variant */
.ox-quiz-take-worksheet .ox-crossword-grid td.highlighted {
    background: #d1fae5;
}

.ox-quiz-take-worksheet .ox-crossword-grid td input:focus {
    background: #fef3c7;
}

.ox-quiz-take-worksheet .ox-crossword-clues-col h4 {
    color: #059669;
    border-bottom-color: #059669;
}

.ox-quiz-take-worksheet .ox-crossword-clue.active {
    background: #d1fae5;
}

/* ===== Word Search — Teacher Preview ===== */

.ox-wordsearch-preview {
    margin-top: 12px;
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
}

.ox-wordsearch-table {
    border-collapse: collapse;
    margin: 0 auto 10px;
}

.ox-wordsearch-cell {
    width: 28px;
    height: 28px;
    text-align: center;
    vertical-align: middle;
    border: 1px solid #cbd5e1;
    font-family: monospace;
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    background: #fff;
}

.ox-wordsearch-wordlist-preview {
    text-align: center;
    margin-top: 8px;
    color: #64748b;
    font-size: 0.9rem;
}

/* ===== Word Search — Student Game ===== */

.ox-wordsearch-game {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    align-items: flex-start;
}

.ox-wordsearch-grid-wrap {
    overflow-x: auto;
}

.ox-wordsearch-grid-table {
    border-collapse: collapse;
    user-select: none;
    -webkit-user-select: none;
}

.ox-ws-cell {
    width: 32px;
    height: 32px;
    text-align: center;
    vertical-align: middle;
    border: 1px solid #e2e8f0;
    font-family: monospace;
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
    background: #fff;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.ox-ws-cell:hover {
    background: #f1f5f9;
}

.ox-ws-cell.ox-ws-selecting {
    background: #bfdbfe;
    color: #1e40af;
}

.ox-ws-cell.ox-ws-found {
    background: #bbf7d0;
    color: #166534;
    font-weight: 700;
}

.ox-wordsearch-wordbank {
    flex: 0 0 auto;
    min-width: 140px;
}

.ox-wordsearch-wordbank h4 {
    margin: 0 0 8px;
    font-size: 0.95rem;
    color: #334155;
}

.ox-ws-word-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ox-ws-word-item {
    display: inline-block;
    padding: 4px 10px;
    background: #f1f5f9;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.9rem;
    font-weight: 600;
    color: #334155;
    letter-spacing: 1px;
    transition: all 0.2s;
}

.ox-ws-word-item.found {
    background: #dcfce7;
    color: #166534;
    text-decoration: line-through;
}

/* Quiz type variants */
.ox-quiz-take-test .ox-ws-cell.ox-ws-selecting {
    background: #c7d2fe;
    color: #3730a3;
}

.ox-quiz-take-test .ox-ws-cell.ox-ws-found {
    background: #c7d2fe;
    color: #3730a3;
}

.ox-quiz-take-worksheet .ox-ws-cell.ox-ws-selecting {
    background: #a7f3d0;
    color: #065f46;
}

.ox-quiz-take-worksheet .ox-ws-cell.ox-ws-found {
    background: #a7f3d0;
    color: #065f46;
}

/* ===== Shared/Utility ===== */

.ox-text-muted {
    color: var(--ox-secondary);
}

.ox-form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--ox-border);
    border-radius: var(--ox-radius-sm);
    font-size: 0.95rem;
}

/* ===== Responsive ===== */

@media (max-width: 768px) {
    .ox-quiz-list {
        grid-template-columns: 1fr;
    }

    .ox-quiz-header {
        flex-direction: column;
    }

    .ox-quiz-card-actions {
        justify-content: flex-start;
    }

    .ox-quiz-match-pair {
        flex-direction: column;
        align-items: stretch;
    }

    .ox-quiz-match-left {
        text-align: left;
    }

    .ox-quiz-take {
        padding: 12px;
    }

    .ox-quiz-question-card {
        padding: 16px;
    }

    .ox-quiz-mc-option {
        padding: 10px 12px;
    }

    .ox-quiz-section-card {
        padding: 16px;
    }

    .ox-quiz-section-card-title {
        font-size: 1.1rem;
    }

    .ox-form-row {
        flex-direction: column;
    }

    .ox-form-half {
        width: 100%;
    }

    .ox-crossword-grid td {
        width: 34px;
        padding-bottom: 34px;
    }

    .ox-crossword-grid td input {
        font-size: 15px;
    }

    .ox-crossword-clues {
        flex-direction: column;
        gap: 12px;
    }

    .ox-crossword-clues-preview {
        flex-direction: column;
        gap: 8px;
    }

    .ox-wordsearch-game {
        flex-direction: column;
    }

    .ox-ws-cell {
        width: 26px;
        height: 26px;
        font-size: 13px;
    }

    .ox-wordsearch-wordbank {
        min-width: auto;
    }

    .ox-ws-word-list {
        flex-direction: row;
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .ox-quiz-progress-info {
        font-size: 0.8em;
    }

    .ox-quiz-timer {
        font-size: 1em;
    }
}

/* ===== Question Media & Content ===== */

/* Teacher dashboard — media section in question form */
.ox-question-media-section {
    border-top: 1px solid #e0e0e0;
    margin-top: 20px;
    padding-top: 16px;
}

.ox-question-media-section > .ox-form-group:first-child > label,
.ox-question-media-section .ox-form-row label {
    font-weight: 600;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #555;
}

.ox-question-media-section #ox-q-long-text {
    width: 100%;
    font-size: 0.95em;
    resize: vertical;
}

.ox-media-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}

.ox-q-image-thumb {
    max-height: 60px;
    max-width: 100px;
    border-radius: 4px;
    border: 1px solid #ddd;
    object-fit: cover;
}

.ox-audio-filename {
    font-size: 0.85em;
    color: #555;
    font-style: italic;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 180px;
}

/* Media indicator badges in question list */
.ox-media-badge {
    display: inline-block;
    font-size: 0.75em;
    padding: 1px 6px;
    border-radius: 10px;
    margin-left: 4px;
    font-weight: 500;
    vertical-align: middle;
}

.ox-badge-example { background: #fff3e0; color: #e65100; }
.ox-badge-text  { background: #e3f2fd; color: #1565c0; }
.ox-badge-image { background: #f3e5f5; color: #6a1b9a; }
.ox-badge-audio { background: #e8f5e9; color: #2e7d32; }

/* Student take view — example block */
.ox-q-example-text {
    background: #fff8e1;
    border-left: 4px solid #f9a825;
    border-radius: 4px;
    padding: 12px 16px;
    margin-top: 12px;
    margin-bottom: 14px;
    font-size: 0.95em;
    line-height: 1.6;
    color: #333;
    font-style: italic;
}

.ox-q-example-text::before {
    content: 'Example: ';
    font-weight: 700;
    font-style: normal;
    color: #e65100;
}

/* Student take view — media blocks */
.ox-q-long-text {
    background: #f8f8f8;
    border-left: 4px solid #b0bec5;
    border-radius: 4px;
    padding: 14px 16px;
    margin-bottom: 14px;
    font-size: 0.95em;
    line-height: 1.7;
    color: #333;
    max-height: 300px;
    overflow-y: auto;
}

.ox-q-image {
    margin-bottom: 12px;
    text-align: center;
}

.ox-q-image img {
    max-width: 100%;
    max-height: 400px;
    object-fit: contain;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.ox-q-audio {
    margin-bottom: 14px;
}

.ox-q-audio audio {
    width: 100%;
    border-radius: 4px;
}

/* =============================================
   Dark Mode Overrides
   ============================================= */

[data-ox-theme="dark"] .ox-quiz-dashboard {
    color: #e2e8f0;
}

[data-ox-theme="dark"] .ox-quiz-view-tab {
    color: #94a3b8;
}

[data-ox-theme="dark"] .ox-quiz-view-tab:hover,
[data-ox-theme="dark"] .ox-quiz-view-tab.active {
    color: #e2e8f0;
}

[data-ox-theme="dark"] .ox-quiz-card,
[data-ox-theme="dark"] .ox-quiz-detail,
[data-ox-theme="dark"] .ox-quiz-take-container,
[data-ox-theme="dark"] .ox-quiz-results {
    background-color: var(--ox-bg-card, #1e293b) !important;
    color: #e2e8f0;
    border-color: var(--ox-border, #334155) !important;
}

[data-ox-theme="dark"] .ox-quiz-type-tabs .ox-quiz-type-tab {
    background-color: var(--ox-bg-inset, #0f172a);
    color: #94a3b8;
}

[data-ox-theme="dark"] .ox-quiz-type-tabs .ox-quiz-type-tab.active {
    background-color: var(--ox-bg-card, #1e293b);
    color: #e2e8f0;
}

[data-ox-theme="dark"] .ox-quiz-filters {
    background-color: var(--ox-bg-inset, #0f172a) !important;
    border-color: var(--ox-border, #334155) !important;
}

[data-ox-theme="dark"] .ox-q-long-text {
    background: var(--ox-bg-inset, #0f172a);
    border-left-color: #475569;
    color: #cbd5e1;
}

[data-ox-theme="dark"] .ox-q-example-text {
    color: #cbd5e1;
}

[data-ox-theme="dark"] .ox-q-image img {
    border-color: var(--ox-border, #334155);
}

[data-ox-theme="dark"] .ox-quiz-question-card {
    background-color: var(--ox-bg-card, #1e293b) !important;
    border-color: var(--ox-border, #334155) !important;
    color: #e2e8f0;
}

[data-ox-theme="dark"] .ox-quiz-option-label {
    background-color: var(--ox-bg-inset, #0f172a);
    border-color: var(--ox-border, #334155);
    color: #cbd5e1;
}

[data-ox-theme="dark"] .ox-quiz-option-label:hover {
    background-color: var(--ox-bg-elevated, #273548);
}

[data-ox-theme="dark"] .ox-quiz-header,
[data-ox-theme="dark"] .ox-quiz-info {
    border-color: var(--ox-border, #334155);
    color: #cbd5e1;
}

/* ==================== SPEAKING TESTS ==================== */

/* Coordinator manage view */
.ox-speaking-manage-group {
    margin-bottom: 20px;
}

.ox-speaking-manage-collection {
    margin: 16px 0 8px;
    font-size: 0.95rem;
    color: var(--ox-primary, #1e3a5f);
}

.ox-speaking-manage-table {
    width: 100%;
    font-size: 0.9rem;
}

.ox-speaking-manage-table .ox-speaking-level {
    width: 45%;
}

.ox-speaking-manage-table .ox-speaking-status {
    width: 20%;
    text-align: center;
}

.ox-speaking-manage-table .ox-speaking-actions {
    text-align: right;
    white-space: nowrap;
}

/* Part B row: slightly indented + muted label so each Part A/B pair reads together */
.ox-speaking-manage-table .ox-speaking-row-b .ox-speaking-level {
    padding-left: 24px;
    color: var(--ox-text-muted, #64748b);
}

.ox-speaking-manage-table .ox-speaking-row-a td {
    border-top: 1px solid var(--ox-border, #e2e8f0);
}

.ox-st-uploaded {
    color: #28a745;
    font-size: 0.8rem;
}

.ox-st-missing {
    color: #dc3545;
    font-size: 0.8rem;
}

[data-ox-theme="dark"] .ox-speaking-manage-collection {
    color: #cbd5e1;
}

/* Shared mark sheet — used for all levels, shown above the per-level entries */
.ox-marksheet-manage,
.ox-marksheet-block {
    padding: 12px 16px;
    margin-bottom: 24px;
    background: var(--ox-surface-alt, #f1f5f9);
    border: 1px solid var(--ox-border, #e2e8f0);
    border-radius: 8px;
}

.ox-marksheet-manage .ox-speaking-manage-collection {
    margin-top: 0;
}

.ox-marksheet-manage .ox-speaking-manage-collection small {
    font-weight: 400;
    color: var(--ox-text-muted, #64748b);
}

[data-ox-theme="dark"] .ox-marksheet-manage,
[data-ox-theme="dark"] .ox-marksheet-block {
    background: var(--ox-surface, #1e293b);
    border-color: var(--ox-border, #334155);
}

/* ==================== AUDIO FILES TAB ==================== */

.ox-audio-level {
    margin-bottom: 28px;
}

.ox-audio-level-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--ox-primary, #1e3a5f);
    padding-bottom: 6px;
    margin-bottom: 12px;
    border-bottom: 2px solid var(--ox-border, #e2e8f0);
}

.ox-audio-quiz {
    margin: 0 0 16px;
    padding: 12px 16px;
    background: var(--ox-surface-alt, #f8fafc);
    border: 1px solid var(--ox-border, #e2e8f0);
    border-radius: 8px;
}

.ox-audio-quiz-title {
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--ox-text, #1e293b);
}

.ox-audio-quiz-unit {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 8px;
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--ox-text-muted, #64748b);
    background: var(--ox-border, #e2e8f0);
    border-radius: 10px;
}

.ox-audio-track {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 8px 0;
    border-top: 1px solid var(--ox-border, #eef2f7);
}

.ox-audio-track:first-of-type {
    border-top: none;
}

.ox-audio-track-label {
    flex: 1 1 220px;
    min-width: 180px;
    font-size: 0.88rem;
    color: var(--ox-text, #334155);
}

.ox-audio-track-q {
    display: inline-block;
    min-width: 30px;
    margin-right: 4px;
    font-weight: 700;
    color: var(--ox-primary, #1e3a5f);
}

.ox-audio-track audio {
    flex: 1 1 280px;
    max-width: 380px;
    height: 36px;
}

[data-ox-theme="dark"] .ox-audio-level-name {
    color: #cbd5e1;
}

[data-ox-theme="dark"] .ox-audio-quiz {
    background: var(--ox-surface, #1e293b);
    border-color: var(--ox-border, #334155);
}

[data-ox-theme="dark"] .ox-audio-quiz-title {
    color: #e2e8f0;
}

[data-ox-theme="dark"] .ox-audio-track-q {
    color: #93c5fd;
}
