/* === CSS HIỆN ĐẠI CHO LAYOUT MCQ-TEST (v1.1) === */

/* Cài đặt gốc */
/*
.quizx-mcq-test-layout {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    background-color: #ffffff;
    border-radius: 16px;
    border: 1px solid #e5e7eb;
    padding: 24px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -4px rgba(0, 0, 0, 0.05); 
}
@media (min-width: 640px) { .quizx-mcq-test-layout { padding: 32px; } }
*/
.quizx-mcq-test-layout{
	padding: 3px;
}

/* Tiêu đề */
.quizx-mcq-test-layout .quizx-title { font-size: 19px; font-weight: 700; margin: 0 0 28px 0; line-height: 1.3; color: #111827; margin-top:10px;}

/* Khối câu hỏi */
.quizx-mcq-test-layout .quizx-question { border-top: 1px dashed #f37e60; padding: 24px 0; }
.quizx-mcq-test-layout .quizx-question:first-child { border-top: none; padding-top: 0; }
.quizx-mcq-test-layout .quizx-question-title { font-size: 14px; font-weight: 600; margin: 0 0 16px 0; color: #1f2937; line-height: 1.5; }

/* Lưới lựa chọn */
.quizx-mcq-test-layout .quizx-options { display: grid; grid-template-columns: 1fr; gap: 12px; }
/* @media (min-width: 600px) { .quizx-mcq-test-layout .quizx-options { grid-template-columns: 1fr 1fr; } } */

/* Nút lựa chọn */
.quizx-mcq-test-layout .quizx-mcq-option { display: flex; align-items: center; width: 100%; padding: 8px 10px; font-size: 13px; text-align: left; background-color: #f9fafb; border: 1px solid #e5e7eb; border-radius: 6px; cursor: pointer; transition: all 0.2s ease-in-out; position: relative; line-height: 1.5; color: #374151; white-space: normal; }
.quizx-mcq-test-layout .quizx-mcq-option::before { content: ''; display: inline-block; width: 20px; height: 20px; border-radius: 50%; border: 2px solid #d1d5db; background-color: #fff; margin-right: 12px; flex-shrink: 0; transition: all 0.2s ease-in-out; }
.quizx-mcq-test-layout .quizx-mcq-option:hover { border-color: #22a565; background-color: #f0fdf6; transform: translateY(-2px); box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.04); }
.quizx-mcq-test-layout .quizx-mcq-option.is-selected { border-color: #22a565; background-color: #e9f7eb; font-weight: 600; color: #155724; }
.quizx-mcq-test-layout .quizx-mcq-option.is-selected::before { border-color: #22a565; background-color: #22a565; color: white; content: '✓'; text-align: center; line-height: 19px; font-weight: bold; }

/* --- Kiểu sau khi chấm điểm --- */
.quizx-mcq-test-layout .quizx-mcq-option:disabled { cursor: not-allowed; opacity: 1; }
.quizx-mcq-test-layout .quizx-mcq-option:disabled:hover { transform: none; box-shadow: none; }
.quizx-mcq-test-layout .quizx-mcq-option.is-correct { border-color: #22a565; background-color: #e9f7eb; color: #155724; font-weight: 600; }
.quizx-mcq-test-layout .quizx-mcq-option.is-correct::before { border-color: #22a565; background-color: #22a565; color: white; content: '✓'; text-align: center; line-height: 19px; font-weight: bold; }
.quizx-mcq-test-layout .quizx-mcq-option.is-user-wrong { border-color: #dc3545; background-color: #fbebed; color: #721c24; text-decoration: line-through; opacity: 0.8; }
.quizx-mcq-test-layout .quizx-mcq-option.is-user-wrong::before { border-color: #dc3545; background-color: #dc3545; color: white; content: '✗'; text-align: center; line-height: 19px; font-weight: bold; }

/* Hộp lời giải */
.quizx-mcq-test-layout .quizx-explanation-box { margin-top: 16px; padding: 16px; background-color: #f8f9fa; border: 1px solid #e5e7eb; border-left: 5px solid #22a565; border-radius: 8px; font-size: 15px; line-height: 1.6; color: #374151; }
.quizx-mcq-test-layout .quizx-explanation-box p { margin: 0; }

/* --- Hộp kết quả tổng quan --- */
.quizx-mcq-test-layout .quizx-results-summary { margin-bottom: 32px; padding: 24px; background-color: #f9fafb; border: 1px solid #e5e7eb; border-radius: 12px; }

.quizx-summary-grid { display: grid; grid-template-columns: 1fr; gap: 20px; align-items: center; text-align: center; }
@media (min-width: 600px) { .quizx-summary-grid { grid-template-columns: 180px 1fr; text-align: left; } } /* Tăng cột biểu đồ */

.quizx-chart-container {
    max-width: 180px; /* << TĂNG KÍCH THƯỚC BIỂU ĐỒ */
    margin: 0 auto;
}

.quizx-score-10-box { background: #22a565; color: white; padding: 12px; border-radius: 12px; text-align: center; max-width: 150px; margin-bottom: 16px; margin-left: auto; margin-right: auto; box-shadow: 0 4px 10px -2px rgba(34, 165, 101, 0.4); }
@media (min-width: 600px) { .quizx-score-10-box { margin-left: 0; } }
.quizx-score-10-label { display: block; font-size: 14px; font-weight: 500; opacity: 0.9; }
.quizx-score-10-value { display: block; font-size: 40px; font-weight: 700; line-height: 1.1; }

.quizx-score-details h3.quizx-score-text { margin: 0 0 8px 0; font-size: 24px; font-weight: 600; color: #111827; }
.quizx-score-details .quizx-result-desc { font-size: 16px; margin: 4px 0 0 0; color: #4b5563; line-height: 1.5; }

/* --- Nút bấm (Footer) --- */

/* Bọc chung */
.quizx-footer,
.quizx-footer-results {
    padding: 40px 0px;
    border-top: 1px solid #f3f4f6;
    text-align: center;
}

/* Các dòng nút trong footer kết quả */
.quizx-footer-row {
    display: flex;
    justify-content: center;
    gap: 12px;
}
.quizx-footer-row + .quizx-footer-row {
    margin-top: 16px; /* Khoảng cách giữa 2 dòng nút */
}

/* Nút bấm chung */
.quizx-submit-button,
.quizx-show-answers-button,
.quizx-retry-button,
.quizx-download-button {
    font-size: 16px;
    font-weight: 600;
    padding: 6px 15px;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

/* Nút chính (Nộp bài / Xem đáp án) */
.quizx-submit-button,
.quizx-show-answers-button {
    background-color: #22a565;
	padding: 6px 100px;
	flex-grow: 1;
    max-width: 400px;
    color: white;
    box-shadow: 0 4px 6px -1px rgba(34, 165, 101, 0.2), 0 2px 4px -2px rgba(34, 165, 101, 0.1);
}
.quizx-submit-button:hover,
.quizx-show-answers-button:hover {
    background-color: #1c8a53;
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(34, 165, 101, 0.5), 0 4px 6px -4px rgba(34, 165, 101, 0.1);
}
.quizx-submit-button:disabled { background-color: #adb5bd; cursor: not-allowed; box-shadow: none; transform: none; }

/* Nút Xem đáp án (chiếm cả dòng) */
.quizx-footer-row-main .quizx-show-answers-button {
    flex-grow: 1; /* Nút chiếm hết chiều rộng */
    max-width: 400px; /* Giới hạn chiều rộng tối đa */
    margin-left: auto;
    margin-right: auto;
}

/* Nút phụ (Làm lại, Tải PNG, Tải PDF) */
.quizx-retry-button,
.quizx-download-button {
    background-color: #fe6432;
    color: #FFFFFF;
    flex-basis: 0; /* Cho phép các nút co giãn đều */
    flex-grow: 1;
}
.quizx-retry-button:hover,
.quizx-download-button:hover {
    background-color: #fe521a;
    border-color: #adb5bd;
}

/* Canh đều 3 nút phụ */
.quizx-footer-row-secondary {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* Chia 3 cột đều */
    max-width: 600px; /* Giới hạn chiều rộng tối đa của nhóm nút */
    margin-left: auto;
    margin-right: auto;
}
.quizx-question-image {
  text-align: center;
  margin: 10px 0;
}

.quizx-question-image img {
  display: inline-block;
  max-width: 100%;
  height: auto;
}
/* * CSS BẢO VỆ MATHJAX KHỎI XUNG ĐỘT THEME
 * Thêm vào file style.css của theme hoặc plugin
*/
mjx-container {
    line-height: normal !important;
    text-align: left !important;
    font-size: 100% !important;
    font-style: normal !important;
    font-weight: normal !important;
    letter-spacing: normal !important;
    text-indent: 0 !important;
    text-transform: none !important;
	display: inline-block !important;
    white-space: normal !important;
    word-spacing: normal !important;
    word-wrap: normal !important;
    box-sizing: content-box !important; /* Rất quan trọng */
    border: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    max-width: none !important;
    max-height: none !important;
    min-width: 0 !important;
    min-height: 0 !important;
    width: auto !important; /* Rất quan trọng */
    height: auto !important; /* Rất quan trọng */
}

/* Đảm bảo SVG bên trong không bị bóp méo */
mjx-container > svg {
    overflow: visible !important;
    display: inline-block !important;
}

/* Bắt SVG luôn hiển thị đúng */
.quizx-mcq-option mjx-container {
    display: inline-block !important;
    vertical-align: middle !important;
    overflow: visible !important;
	line-height: normal !important;
}

/* Fix chiều cao để gạch phân số luôn hiện */
.quizx-mcq-option mjx-container svg {
    overflow: visible !important;
}
