/* ═══════════════════════════════════════════════
   Mini Quiz - Frontend CSS
   ═══════════════════════════════════════════════ */

/* ── Wrap ── */
.mq-wrap {
    max-width: 860px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: #333;
}
.mq-title {
    font-size: 1.4em;
    font-weight: 700;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e0e0;
}

/* ── Câu hỏi ── */
.mq-question {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    padding: 20px 24px;
    margin-bottom: 16px;
    transition: border-color .2s;
}
.mq-question.mq-unanswered {
    border-color: #f59e0b;
    background: #fffbf0;
}
.mq-question-text {
    font-weight: 600;
    margin: 0 0 14px;
    display: flex;
    gap: 8px;
}
.mq-q-num { display: none; }

/* ── Options ── */
.mq-options { display: flex; flex-direction: column; gap: 8px; }
.mq-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color .15s, background .15s;
    user-select: none;
}
.mq-option:hover { border-color: #6366f1; background: #f5f3ff; }
.mq-option input[type="radio"] { accent-color: #6366f1; width: 16px; height: 16px; flex-shrink: 0; }
.mq-option input[type="radio"]:checked ~ .mq-option-key,
.mq-option input[type="radio"]:checked ~ .mq-option-text { color: #4f46e5; }
.mq-option:has(input:checked) { border-color: #6366f1; background: #eef2ff; }
.mq-option-key { font-weight: 700; color: #6b7280; min-width: 20px; }

/* ── Nút nộp bài ── */
.mq-submit-wrap { margin-top: 24px; text-align: center; }
.mq-btn-submit {
    background: #6366f1;
    color: #fff;
    border: none;
    padding: 13px 40px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s, transform .1s;
}
.mq-btn-submit:hover { background: #4f46e5; }
.mq-btn-submit:active { transform: scale(.98); }
.mq-btn-submit:disabled { background: #9ca3af; cursor: not-allowed; }

/* ── Notice ── */
.mq-notice {
    padding: 10px 16px;
    border-radius: 6px;
    margin-bottom: 12px;
    font-size: 14px;
}
.mq-notice-warn { background: #fef9c3; border: 1px solid #fcd34d; color: #92400e; }
.mq-notice-err  { background: #fee2e2; border: 1px solid #fca5a5; color: #991b1b; }

/* ── Popup ── */
body.mq-no-scroll { overflow: hidden; }
.mq-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.mq-popup-box {
    background: #fff;
    border-radius: 14px;
    padding: 32px 28px 24px;
    max-width: 540px;
    width: 100%;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,.25);
    animation: mq-popup-in .2s ease;
}
@keyframes mq-popup-in {
    from { transform: translateY(-20px) scale(.97); opacity: 0; }
    to   { transform: translateY(0) scale(1); opacity: 1; }
}
@keyframes mq-shake-kf {
    0%,100% { transform: translateX(0); }
    20%,60% { transform: translateX(-8px); }
    40%,80% { transform: translateX(8px); }
}
.mq-shake { animation: mq-shake-kf .45s ease; }

.mq-popup-close {
    position: absolute;
    top: 12px; right: 14px;
    background: none; border: none;
    font-size: 18px; cursor: pointer;
    color: #9ca3af; line-height: 1;
}
.mq-popup-close:hover { color: #374151; }
.mq-popup-title {
    font-weight: 700;
    font-size: 16px;
    color: #dc2626;
    text-align: center;
    margin: 0 0 18px;
    line-height: 1.4;
}
.mq-code-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}
.mq-code-input {
    flex: 1;
    padding: 11px 14px;
    border: 2px solid #d1d5db;
    border-radius: 8px;
    font-size: 15px;
    transition: border-color .15s;
    outline: none;
}
.mq-code-input:focus { border-color: #6366f1; }
.mq-btn-verify {
    background: #0ea5e9;
    color: #fff;
    border: none;
    padding: 11px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s;
}
.mq-btn-verify:hover { background: #0284c7; }
.mq-btn-verify:disabled { background: #9ca3af; cursor: not-allowed; }
.mq-code-error {
    color: #dc2626;
    font-size: 13px;
    margin-bottom: 10px;
}
.mq-popup-steps {
    font-size: 14px;
    color: #374151;
    line-height: 1.7;
    border-top: 1px solid #f3f4f6;
    padding-top: 16px;
    margin-top: 6px;
}
.mq-popup-steps strong { color: #111; }
.mq-popup-link {
    display: inline-block;
    margin-top: 14px;
    font-size: 13px;
    color: #6366f1;
    text-decoration: none;
}
.mq-popup-link:hover { text-decoration: underline; }

/* ── Kết quả ── */
.mq-result { margin-top: 8px; }
.mq-score-box {
    text-align: center;
    padding: 28px;
    border-radius: 12px;
    margin-bottom: 24px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
}
.mq-score-box.mq-score-high { background: #f0fdf4; border-color: #86efac; }
.mq-score-box.mq-score-mid  { background: #fffbeb; border-color: #fde68a; }
.mq-score-box.mq-score-low  { background: #fef2f2; border-color: #fca5a5; }
.mq-score-pct {
    display: block;
    font-size: 3em;
    font-weight: 800;
    line-height: 1;
    color: #111;
    margin-bottom: 6px;
}
.mq-score-box.mq-score-high .mq-score-pct { color: #16a34a; }
.mq-score-box.mq-score-mid  .mq-score-pct { color: #d97706; }
.mq-score-box.mq-score-low  .mq-score-pct { color: #dc2626; }
.mq-score-label { color: #6b7280; font-size: 15px; }

/* ── Chi tiết từng câu ── */
.mq-result-item {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 18px 20px;
    margin-bottom: 12px;
    background: #fff;
}
.mq-result-item.mq-correct { border-color: #86efac; background: #f0fdf4; }
.mq-result-item.mq-wrong   { border-color: #fca5a5; background: #fef2f2; }
.mq-result-header {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 12px;
}
.mq-result-num { display: none; }
.mq-result-question { flex: 1; font-weight: 600; }
.mq-result-status {
    font-size: 12px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 99px;
    flex-shrink: 0;
}
.mq-correct .mq-result-status { background: #dcfce7; color: #15803d; }
.mq-wrong   .mq-result-status { background: #fee2e2; color: #b91c1c; }

.mq-result-options { display: flex; flex-direction: column; gap: 6px; }
.mq-result-option {
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
}
.mq-answer-correct { background: #dcfce7 !important; border-color: #4ade80 !important; font-weight: 600; }
.mq-answer-wrong   { background: #fee2e2 !important; border-color: #f87171 !important; text-decoration: line-through; }

.mq-result-explain {
    margin-top: 12px;
    padding: 10px 14px;
    background: #eff6ff;
    border-radius: 6px;
    font-size: 13.5px;
    color: #1e40af;
    border-left: 3px solid #3b82f6;
}

/* ── Responsive ── */
@media (max-width: 540px) {
    .mq-popup-box { padding: 24px 16px 20px; }
    .mq-code-row { flex-direction: column; }
    .mq-btn-submit { padding: 12px 28px; font-size: 15px; }
}

/* ── Đồng hồ đếm ngược (sticky floating) ── */
.mq-countdown {
    /* Floating cố định giữa-dưới màn hình — !important để thắng CSS theme */
    position: fixed !important;
    bottom: 24px !important;
    left: 50% !important;
    right: unset !important;
    top: auto !important;
    transform: translateX(-50%) !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    z-index: 99999 !important;

    /* Layout nội dung: icon + label + thời gian xếp ngang */
    display: flex !important;
    flex-direction: row;
    align-items: center;
    gap: 8px;

    /* Kích thước & hình dạng pill */
    width: auto;
    min-width: 200px;
    padding: 10px 20px;
    border-radius: 50px;

    /* Màu mặc định: xanh dương nhẹ */
    background: #f0f9ff;
    border: 2px solid #bae6fd;
    color: #0369a1;
    font-weight: 600;

    /* Đổ bóng để nổi bật trên mọi nền trang */
    box-shadow: 0 4px 20px rgba(0,0,0,.14);

    /* Transition khi chuyển trạng thái màu */
    transition: background .3s, border-color .3s, color .3s;
}

/* Icon đồng hồ */
.mq-countdown .mq-timer-icon {
    font-size: 20px;
    line-height: 1;
}

/* Nhãn "Thời gian còn lại" */
.mq-countdown .mq-timer-label {
    font-size: 10px;
    font-weight: 500;
    color: #64748b;
    letter-spacing: .3px;
    text-align: center;
    white-space: nowrap;
}

/* Số đếm ngược — to, đậm, monospace để không giật layout */
.mq-countdown .mq-timer-time {
    font-size: 26px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    letter-spacing: 1.5px;
    line-height: 1.1;
    text-align: center;
}

/* Cảnh báo: còn <= 60s — chuyển sang vàng */
.mq-countdown.mq-timer-warning {
    background: #fffbeb;
    border-color: #fcd34d;
    color: #92400e;
}
.mq-countdown.mq-timer-warning .mq-timer-label { color: #b45309; }

/* Nguy hiểm: còn <= 10s — chuyển sang đỏ + nhấp nháy */
.mq-countdown.mq-timer-danger {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #b91c1c;
    animation: mq-timer-pulse .6s ease infinite alternate;
}
.mq-countdown.mq-timer-danger .mq-timer-label { color: #dc2626; }

@keyframes mq-timer-pulse {
    from { opacity: 1;    box-shadow: 0 4px 20px rgba(185,28,28,.2); }
    to   { opacity: 0.72; box-shadow: 0 4px 28px rgba(185,28,28,.45); }
}

/* Mobile: thu nhỏ nhẹ, vẫn căn giữa */
@media (max-width: 540px) {
    .mq-countdown {
        bottom: 16px !important;
        left: 50% !important;
        right: unset !important;
        transform: translateX(-50%) !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        min-width: 160px;
        padding: 8px 16px;
        border-radius: 50px;
    }
    .mq-countdown .mq-timer-icon  { font-size: 16px; }
    .mq-countdown .mq-timer-label { font-size: 10px; }
    .mq-countdown .mq-timer-time  { font-size: 20px; }
}

/* ── Question body ── */
.mq-question-text {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-weight: 600;
    margin: 0 0 14px;
}
.mq-q-body {
    flex: 1;
    line-height: 1.7;
}
.mq-q-body p { margin: 0 0 8px; }
.mq-q-body p:last-child { margin-bottom: 0; }
.mq-q-body img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    margin: 8px 0;
    display: block;
}
.mq-q-body ul, .mq-q-body ol {
    margin: 6px 0 6px 20px;
}


/* ═══════════════════════════════════════════════════════════════
   POPUP ĐẸP — mqp-* namespace
   (Tích hợp từ popup-tutorial.html)
   ═══════════════════════════════════════════════════════════════ */

/* Override box để dùng thiết kế mới */
.mq-popup-box.mq-popup-beautiful {
    padding: 0;
    border-radius: 10px;
    max-width: 480px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: 0 8px 40px rgba(0,0,0,.22);
    font-family: 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #fff;
}
/* Scrollbar nhỏ gọn */
.mq-popup-box.mq-popup-beautiful::-webkit-scrollbar { width: 5px; }
.mq-popup-box.mq-popup-beautiful::-webkit-scrollbar-thumb { background: #ddd; border-radius: 4px; }

/* Nút đóng override */
.mq-popup-beautiful .mq-popup-close {
    top: 10px; right: 14px;
    font-size: 22px; color: #888;
    background: none; border: none;
    cursor: pointer; position: absolute;
    z-index: 10; line-height: 1;
}
.mq-popup-beautiful .mq-popup-close:hover { color: #333; }

/* ── Header ── */
.mqp-header {
    background: #fff;
    text-align: center;
    padding: 18px 44px 14px;
    border-bottom: 1px solid #f0f0f0;
}
.mqp-header p {
    color: #e53935;
    font-size: 14.5px;
    font-weight: 600;
    line-height: 1.5;
    margin: 0;
}

/* ── Ô nhập mã ── */
.mqp-code-row {
    padding: 12px 18px 14px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.mqp-input-wrap {
    display: flex;
    gap: 8px;
}
/* Override mq-code-input cho popup đẹp */
.mq-popup-beautiful .mq-code-input {
    flex: 1;
    border: 1.5px solid #d0d0d0;
    border-radius: 6px;
    padding: 9px 13px;
    font-size: 13.5px;
    color: #333;
    font-family: inherit;
    outline: none;
    transition: border-color .2s;
}
.mq-popup-beautiful .mq-code-input:focus { border-color: #1a73e8; }

/* Override mq-btn-verify */
.mq-popup-beautiful .mq-btn-verify {
    background: #1565c0;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 9px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    font-family: inherit;
    transition: background .2s;
}
.mq-popup-beautiful .mq-btn-verify:hover { background: #0d47a1; }
.mq-popup-beautiful .mq-btn-verify:disabled { background: #9ca3af; cursor: not-allowed; }

/* Override mq-code-error */
.mq-popup-beautiful .mq-code-error {
    font-size: 12.5px;
    color: #e53935;
    margin: 0;
    padding: 4px 2px;
}

/* ── Steps container ── */
.mqp-steps { padding: 0 18px 14px; }
.mqp-step  { margin-top: 14px; }
.mqp-step-title {
    font-size: 13.5px;
    font-weight: 600;
    color: #222;
    margin-bottom: 8px;
    line-height: 1.5;
}
.mqp-step-title a { color: #1a73e8; text-decoration: none; }
.mqp-step-title a:hover { text-decoration: underline; }

/* Từ khoá highlight */
.mqp-keyword {
    color: #0d47a1;
    background: #e3f2fd;
    padding: 2px 8px;
    border-radius: 5px;
    font-size: 14px;
    letter-spacing: .2px;
}

/* Copy badge */
.mqp-copy-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 1px 8px;
    font-size: 12px;
    color: #555;
    cursor: pointer;
    margin-left: 4px;
    vertical-align: middle;
    transition: background .15s;
    user-select: none;
}
.mqp-copy-badge:hover  { background: #e8e8e8; }
.mqp-copy-badge.copied { background: #e8f5e9; color: #2e7d32; border-color: #c8e6c9; }

/* ── Google box ── */
.mqp-google-box {
    border: 1.5px solid #e0e0e0;
    border-radius: 10px;
    padding: 14px 16px 16px;
    text-align: center;
    margin-bottom: 4px;
}
.mqp-google-logo {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -1px;
    margin-bottom: 10px;
}
.mqp-google-logo span:nth-child(1) { color: #4285f4; }
.mqp-google-logo span:nth-child(2) { color: #ea4335; }
.mqp-google-logo span:nth-child(3) { color: #fbbc05; }
.mqp-google-logo span:nth-child(4) { color: #4285f4; }
.mqp-google-logo span:nth-child(5) { color: #34a853; }
.mqp-google-logo span:nth-child(6) { color: #ea4335; }

.mqp-search-bar {
    display: flex;
    align-items: center;
    border: 1.5px solid #ccc;
    border-radius: 24px;
    padding: 7px 14px;
    background: #fff;
    gap: 8px;
}
.mqp-query { flex: 1; text-align: left; font-size: 13.5px; color: #333; }
.mqp-icons { display: flex; gap: 10px; color: #9e9e9e; font-size: 16px; }

/* ── Result card ── */
.mqp-result-card {
    border: 2px solid #e53935;
    border-radius: 8px;
    padding: 10px 13px;
    margin-bottom: 6px;
}
.mqp-site-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 3px;
}
.mqp-favicon {
    width: 18px; height: 18px;
    background: #1565c0;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}
.mqp-site-name  { font-size: 12px; color: #555; }
.mqp-site-url   { font-size: 11.5px; color: #777; margin-bottom: 4px; }
.mqp-result-title {
    color: #1a0dab;
    font-size: 14.5px;
    font-weight: 600;
    margin-bottom: 4px;
}
.mqp-snippet { font-size: 12.5px; color: #555; line-height: 1.5; }
.mqp-hint-text {
    text-align: center;
    font-size: 12.5px;
    color: #1a73e8;
    margin: 6px 0 4px;
}

/* ── Bước 3: blurred box ── */
.mqp-step3-box {
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    text-align: center;
    padding: 14px 0 18px;
    background: #fafafa;
    position: relative;
}
.mqp-blurred {
    height: 52px;
    background: repeating-linear-gradient(
        0deg,
        #e8e8e8 0px, #e8e8e8 10px,
        #f4f4f4 10px, #f4f4f4 18px
    );
    margin: 0 16px 14px;
    border-radius: 4px;
    filter: blur(1.5px);
}
.mqp-blurred.mqp-blurred-sm { height: 34px; margin-bottom: 16px; }
.mqp-xem-them {
    display: inline-block;
    background: #29b6f6;
    color: #fff;
    font-size: 13.5px;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    padding: 9px 32px;
    cursor: pointer;
    font-family: inherit;
    transition: background .2s;
}
.mqp-xem-them:hover { background: #0288d1; }
.mqp-arrow-label {
    position: absolute;
    right: 26px; bottom: 26px;
    display: flex;
    align-items: center;
    gap: 6px;
    color: #e53935;
    font-size: 12.5px;
    font-weight: 700;
}
.mqp-arrow-label::before { content: '←'; font-size: 18px; }

/* ── Sau đó ── */
.mqp-after-text {
    font-size: 13px;
    color: #333;
    line-height: 1.65;
    margin: 10px 0 8px;
}
.mqp-after-text strong { color: #e53935; }
.mqp-view-count {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #333;
    margin-bottom: 10px;
}
.mqp-red-box {
    background: #e53935;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 1px 8px;
    border-radius: 3px;
}

/* ── Video card ── */
.mqp-video-card {
    display: block;
    border-radius: 8px;
    overflow: hidden;
    text-decoration: none;
    background: #111827;
}

/* ── iframe embed YouTube ── */
.mqp-video-iframe-wrap {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
    background: #000;
}
.mqp-video-iframe-wrap iframe {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.mqp-video-top {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px 10px;
    background: #111827;
}
.mqp-video-check {
    width: 46px; height: 46px;
    border-radius: 50%;
    background: #43a047;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 24px;
    color: #fff;
}
.mqp-video-info { flex: 1; }
.mqp-video-title { color: #fff; font-size: 13px; font-weight: 700; margin-bottom: 3px; }
.mqp-video-sub   { color: #aaa; font-size: 11.5px; }

.mqp-video-body { padding: 10px 14px 14px; background: #111827; }
.mqp-yt-label {
    color: #aaa;
    font-size: 11px;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: .5px;
}
.mqp-video-big {
    color: #fff;
    font-size: 18px;
    font-weight: 800;
    text-transform: uppercase;
    line-height: 1.25;
    margin-top: 6px;
}
.mqp-video-big span { color: #ffd600; }
.mqp-video-desc-text {
    color: #bbb;
    font-size: 12px;
    margin-top: 10px;
    border-top: 1px solid #2a2a3e;
    padding-top: 8px;
    line-height: 1.5;
}
.mqp-yt-channel { color: #90caf9; }

/* ── Responsive ── */
@media (max-width: 540px) {
    .mq-popup-beautiful .mq-popup-close { font-size: 18px; }
    .mqp-input-wrap { flex-direction: column; }
    .mqp-video-big { font-size: 15px; }
    .mqp-arrow-label { right: 14px; bottom: 16px; font-size: 11px; }
}

/* ══════════════════════════════════════════════════════════════
   Câu hỏi Đúng/Sai – Frontend
══════════════════════════════════════════════════════════════ */

/* Bảng phương án Đúng/Sai */
.mq-tf-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 8px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
}

/* Hàng tiêu đề */
.mq-tf-header {
    display: grid;
    grid-template-columns: 1fr 80px 80px;
    background: #f0f4f8;
    padding: 8px 12px;
    font-weight: 700;
    font-size: 13px;
    color: #444;
    border-bottom: 2px solid #d0d7e2;
}

/* Mỗi hàng phương án */
.mq-tf-row {
    display: grid;
    grid-template-columns: 1fr 80px 80px;
    align-items: center;
    padding: 10px 12px;
    background: #fff;
    border-bottom: 1px solid #eef1f5;
    transition: background .15s;
}
.mq-tf-row:last-child { border-bottom: none; }
.mq-tf-row:hover { background: #f8fafc; }
.mq-tf-row.mq-unanswered { background: #fff8e1; }

.mq-tf-opt-text {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    line-height: 1.5;
}

/* Nút Đúng / Sai */
.mq-tf-col-btn {
    text-align: center;
}
.mq-tf-btn-wrap {
    display: flex;
    justify-content: center;
    cursor: pointer;
}
.mq-tf-btn-wrap input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 0;
    height: 0;
}
.mq-tf-btn {
    display: inline-block;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    border: 2px solid transparent;
    transition: all .18s;
    user-select: none;
    cursor: pointer;
}
.mq-tf-true {
    border-color: #28a745;
    color: #28a745;
    background: #f0fff4;
}
.mq-tf-false {
    border-color: #dc3545;
    color: #dc3545;
    background: #fff5f5;
}

/* Khi radio được chọn → highlight nút */
.mq-tf-btn-wrap input[type="radio"]:checked + .mq-tf-true {
    background: #28a745;
    color: #fff;
    box-shadow: 0 2px 6px rgba(40,167,69,.35);
}
.mq-tf-btn-wrap input[type="radio"]:checked + .mq-tf-false {
    background: #dc3545;
    color: #fff;
    box-shadow: 0 2px 6px rgba(220,53,69,.35);
}

/* ── Kết quả Đúng/Sai ─────────────────────────────────────── */
.mq-tf-result-table {
    width: 100%;
    margin-top: 6px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #e0e0e0;
}
.mq-tf-result-row {
    display: flex;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 6px 12px;
    padding: 8px 12px;
    border-bottom: 1px solid #eee;
    font-size: 13px;
}
.mq-tf-result-row:last-child { border-bottom: none; }
.mq-tf-row-ok  { background: #f0fff4; }
.mq-tf-row-err { background: #fff5f5; }

.mq-tf-opt-body {
    flex: 1;
    min-width: 120px;
}
.mq-tf-user-ans {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 12px;
    white-space: nowrap;
}
.mq-ans-ok  { background: #d4edda; color: #155724; }
.mq-ans-err { background: #f8d7da; color: #721c24; }

.mq-tf-correct-ans {
    font-size: 12px;
    color: #155724;
    white-space: nowrap;
}

/* ── [v1.8.0] Đoạn văn / Ghi chú xen kẽ câu hỏi ── */
.mq-passage-block-front {
    background: #f8f9fa;
    border-left: 4px solid #6c757d;
    border-radius: 0 8px 8px 0;
    padding: 16px 20px;
    margin-bottom: 16px;
    font-size: 14.5px;
    line-height: 1.75;
    color: #444;
}
.mq-passage-block-front p:first-child { margin-top: 0; }
.mq-passage-block-front p:last-child  { margin-bottom: 0; }

/* Khi hiển thị trong phần kết quả */
.mq-passage-in-result {
    margin: 8px 0 12px;
    border-left-color: #adb5bd;
    background: #f5f5f5;
    font-style: italic;
}

/* ── [v1.13.0] Question Navigator ── */
/* ── [v1.13.0] Question Navigator ── */
.mq-wrap .mq-navigator {
    background: #fff !important;
    border: 1.5px solid #e0e0e0 !important;
    border-radius: 10px !important;
    margin: 24px auto 20px !important;
    overflow: hidden !important;
    max-width: 480px !important;
    width: 100% !important;
    box-shadow: none !important;
    padding: 0 !important;
}
.mq-wrap .mq-nav-header {
    background: #3d6b84 !important;
    color: #fff !important;
    font-weight: 700 !important;
    font-size: 13px !important;
    letter-spacing: 0.5px !important;
    padding: 10px 16px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    cursor: default !important;
    user-select: none !important;
    border: none !important;
    border-radius: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    text-transform: none !important;
    line-height: 1.4 !important;
}
.mq-wrap .mq-nav-header.mq-nav-toggleable {
    cursor: pointer !important;
}
.mq-wrap .mq-nav-header.mq-nav-toggleable:hover {
    background: #2f5570 !important;
}
.mq-wrap .mq-nav-progress {
    font-size: 12px !important;
    font-weight: 400 !important;
    opacity: 0.85 !important;
    margin-left: 6px !important;
    color: #fff !important;
}
.mq-wrap .mq-nav-toggle-icon {
    margin-left: auto !important;
    font-style: normal !important;
    font-size: 12px !important;
    transition: transform .2s !important;
    color: #fff !important;
}
.mq-wrap .mq-nav-header.mq-nav-collapsed .mq-nav-toggle-icon {
    transform: rotate(-90deg) !important;
}
.mq-wrap .mq-nav-grid {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    padding: 14px 16px !important;
    justify-content: center !important;
    margin: 0 !important;
    list-style: none !important;
    background: #fff !important;
}
/* Reset hoàn toàn button — thắng mọi theme */
.mq-wrap .mq-nav-btn,
.mq-wrap .mq-nav-btn:link,
.mq-wrap .mq-nav-btn:visited {
    /* Reset */
    all: unset !important;
    /* Kích thước */
    width: 36px !important;
    height: 36px !important;
    border-radius: 6px !important;
    /* Màu mặc định: chưa trả lời */
    border: 1.5px solid #d1d5db !important;
    background: #f9fafb !important;
    color: #374151 !important;
    /* Typography */
    font-size: 13px !important;
    font-weight: 600 !important;
    font-family: inherit !important;
    line-height: 1 !important;
    text-align: center !important;
    text-decoration: none !important;
    /* Layout */
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    /* Interaction */
    cursor: pointer !important;
    transition: background .15s, border-color .15s, color .15s, transform .1s !important;
    box-shadow: none !important;
    outline: none !important;
    -webkit-appearance: none !important;
    appearance: none !important;
}
.mq-wrap .mq-nav-btn:hover {
    border-color: #6366f1 !important;
    color: #4f46e5 !important;
    background: #eef2ff !important;
    transform: scale(1.08) !important;
    box-shadow: none !important;
    text-decoration: none !important;
}
.mq-wrap .mq-nav-btn:focus {
    outline: none !important;
    box-shadow: 0 0 0 2px rgba(99,102,241,0.3) !important;
}
/* Đã trả lời */
.mq-wrap .mq-nav-btn.mq-nav-answered {
    background: #6366f1 !important;
    border-color: #4f46e5 !important;
    color: #fff !important;
}
.mq-wrap .mq-nav-btn.mq-nav-answered:hover {
    background: #4f46e5 !important;
    border-color: #4338ca !important;
    color: #fff !important;
    transform: scale(1.08) !important;
}
/* Chưa trả lời + đã bấm Nộp */
.mq-wrap .mq-nav-btn.mq-nav-unanswered-err {
    border-color: #f59e0b !important;
    background: #fffbf0 !important;
    color: #b45309 !important;
    animation: mq-nav-pulse 0.4s ease !important;
}
@keyframes mq-nav-pulse {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.15); }
    100% { transform: scale(1); }
}
/* Câu đang active */
.mq-wrap .mq-nav-btn.mq-nav-active {
    box-shadow: 0 0 0 3px rgba(99,102,241,0.35) !important;
}

/* ── Mobile ── */
@media (max-width: 540px) {
    .mq-wrap .mq-navigator {
        max-width: 100% !important;
        margin: 20px 0 16px !important;
    }
    .mq-wrap .mq-nav-grid {
        gap: 6px !important;
        padding: 10px 12px !important;
    }
    .mq-wrap .mq-nav-btn,
    .mq-wrap .mq-nav-btn:link,
    .mq-wrap .mq-nav-btn:visited {
        width: 32px !important;
        height: 32px !important;
        font-size: 12px !important;
        border-radius: 5px !important;
    }
    .mq-wrap .mq-navigator.mq-nav-collapsed .mq-nav-grid {
        display: none !important;
    }
}

/* ── [v1.14.0] Fill in the blank ── */
.mq-fill-blank-front {
    padding: 4px 0;
}
.mq-fill-input {
    width: 100%;
    max-width: 420px;
    padding: 10px 14px;
    border: 2px solid #d1d5db;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    transition: border-color .15s, box-shadow .15s;
    outline: none;
    box-sizing: border-box;
}
.mq-fill-input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,.15);
}
.mq-question.mq-unanswered .mq-fill-input {
    border-color: #f59e0b;
}

/* Kết quả fill_blank */
.mq-fill-result {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 10px;
    font-size: 14px;
}
.mq-fill-user-ans,
.mq-fill-correct-ans {
    padding: 7px 12px;
    border-radius: 6px;
}
.mq-fill-user-ans.mq-ans-ok {
    background: #f0fdf4;
    border: 1px solid #86efac;
    color: #166534;
}
.mq-fill-user-ans.mq-ans-err {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    color: #991b1b;
}
.mq-fill-correct-ans {
    background: #f0fdf4;
    border: 1px solid #86efac;
    color: #166534;
}

/* ── [v1.15.0] Matching ── */
.mq-matching-front {
    width: 100%;
}
.mq-matching-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
}
.mq-matching-col-head {
    background: #f3f4f6;
    font-weight: 700;
    font-size: 12px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: .5px;
    padding: 8px 14px;
    border-bottom: 1.5px solid #e5e7eb;
}
.mq-matching-col-left  { border-right: 1.5px solid #e5e7eb; }
.mq-matching-col-select { }

.mq-matching-left-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-bottom: 1px solid #f3f4f6;
    font-size: 14px;
    min-height: 44px;
}
.mq-matching-left-item:last-child { border-bottom: none; }
.mq-matching-item-label {
    font-weight: 700;
    color: #6366f1;
    min-width: 20px;
    flex-shrink: 0;
}
.mq-matching-item-text { flex: 1; }

.mq-matching-select-wrap {
    padding: 6px 10px;
    border-bottom: 1px solid #f3f4f6;
    display: flex;
    align-items: center;
    min-height: 44px;
}
.mq-matching-select-wrap:last-child { border-bottom: none; }
.mq-matching-select {
    width: 100%;
    padding: 7px 10px;
    border: 1.5px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    background: #fff;
    transition: border-color .15s;
    outline: none;
    cursor: pointer;
}
.mq-matching-select:focus { border-color: #6366f1; }
.mq-question.mq-unanswered .mq-matching-select:not([value=""]):not(:valid) {
    border-color: #f59e0b;
}
.mq-question.mq-unanswered .mq-matching-select {
    border-color: #f59e0b;
}

/* Kết quả matching */
.mq-matching-result-table {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 14px;
}
.mq-matching-result-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 7px;
    border: 1px solid transparent;
}
.mq-match-ok {
    background: #f0fdf4;
    border-color: #86efac;
}
.mq-match-err {
    background: #fef2f2;
    border-color: #fca5a5;
}
.mq-matching-left-text {
    font-weight: 600;
    color: #374151;
    flex: 1;
    min-width: 80px;
}
.mq-matching-arrow {
    color: #9ca3af;
    font-size: 16px;
    flex-shrink: 0;
}
.mq-matching-user-right {
    padding: 2px 10px;
    border-radius: 5px;
    font-weight: 600;
    flex: 1;
    min-width: 80px;
}
.mq-matching-correct-right {
    color: #166534;
    font-size: 12px;
    font-style: italic;
    flex-shrink: 0;
}

/* Mobile */
@media (max-width: 540px) {
    .mq-matching-cols {
        grid-template-columns: 1fr;
    }
    .mq-matching-col-left {
        border-right: none;
        border-bottom: 1.5px solid #e5e7eb;
    }
    .mq-matching-result-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
}
