/* Giao diện Ôn Tập & Thi Thử Mô Phỏng - Phong cách Dark-Mode & Glassmorphism */
:root {
    --mp-bg: #d9e2ec;            /* Light greyish-blue canvas background */
    --mp-card-bg: #f8fafc;       /* Pure white/light grey container */
    --mp-sidebar-bg: #e2e8f0;    /* Light grey sidebar */
    --mp-border: #cbd5e1;        /* Defined border line */
    --mp-text: #0f172a;          /* Dark slate text */
    --mp-text-muted: #64748b;    /* Slate muted text */
    --mp-primary: #3b82f6;       /* Blue */
    --mp-primary-glow: rgba(59, 130, 246, 0.15);
    --mp-success: #22c55e;       /* Green */
    --mp-success-glow: rgba(34, 197, 94, 0.15);
    --mp-warning: #f59e0b;       /* Orange/Yellow */
    --mp-danger: #ef4444;        /* Red */
    --mp-danger-glow: rgba(239, 68, 68, 0.15);
    --mp-accent: #8b5cf6;        /* Purple */
    --mp-radius: 8px;
    --mp-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    --mp-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

#mophong-app-root.mophong-app {
    font-family: var(--mp-font);
    background-color: var(--mp-bg);
    color: var(--mp-text);
    border-radius: var(--mp-radius);
    overflow: hidden;
    box-shadow: var(--mp-shadow);
    max-width: 100%;
    margin: 20px auto;
    border: 1px solid var(--mp-border);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* 1. Navigation & Tabs */
.mophong-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(24, 24, 37, 0.95);
    border-bottom: 1px solid var(--mp-border);
    padding: 15px 20px;
    flex-wrap: wrap;
    gap: 15px;
}
.mophong-nav-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 8px;
}
.mophong-nav-icon {
    font-size: 1.5rem;
}
.mophong-nav-tabs {
    display: flex;
    background: #11111b;
    padding: 4px;
    border-radius: 8px;
    border: 1px solid var(--mp-border);
}
.mophong-tab-btn {
    background: transparent !important;
    border: none !important;
    color: rgba(255, 255, 255, 0.6) !important;
    padding: 8px 16px !important;
    font-size: 0.9rem !important;
    font-weight: 600 !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: none !important;
}
.mophong-tab-btn:hover {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.05) !important;
}
.mophong-tab-btn.active {
    color: #11111b !important;
    background: var(--mp-primary) !important;
}

/* 2. Wrapper & Layout */
.mophong-wrapper {
    min-height: 500px;
    position: relative;
}
.mophong-tab-content {
    display: none;
}
.mophong-tab-content.active {
    display: block;
}

/* 3. Study Layout */
.mophong-study-layout {
    display: block;
    height: auto;
}

/* Sidebar Drawer */
.mophong-sidebar {
    background: var(--mp-sidebar-bg);
    border-right: 1px solid var(--mp-border);
    display: flex;
    flex-direction: column;
    height: 100%;
    z-index: 100;
    transition: transform 0.3s ease;
}
.mophong-sidebar-header {
    padding: 15px;
    border-bottom: 1px solid var(--mp-border);
    display: flex;
    align-items: center;
    gap: 10px;
}
.mophong-sidebar-header input {
    flex: 1;
    background: #11111b;
    border: 1px solid var(--mp-border);
    border-radius: 6px;
    padding: 8px 12px;
    color: var(--mp-text);
    font-size: 0.9rem;
    outline: none;
}
.mophong-sidebar-header input:focus {
    border-color: var(--mp-primary);
    box-shadow: 0 0 0 2px var(--mp-primary-glow);
}
.mophong-sidebar-close {
    background: transparent !important;
    border: none !important;
    color: var(--mp-text-muted) !important;
    font-size: 1.1rem !important;
    cursor: pointer !important;
    padding: 5px !important;
    display: none; /* Only visible on mobile */
    box-shadow: none !important;
}
.mophong-sidebar-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

/* Chapters & Items styling */
.mophong-chapter {
    margin-bottom: 8px;
}
.mophong-chapter-header {
    background: rgba(255, 255, 255, 0.03);
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--mp-accent);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid transparent;
    user-select: none;
    transition: all 0.2s;
}
.mophong-chapter-header:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--mp-border);
}
.mophong-chapter-header .chevron {
    transition: transform 0.25s ease;
    font-size: 0.75rem;
}
.mophong-chapter.collapsed .mophong-chapter-header .chevron {
    transform: rotate(-90deg);
}
.mophong-chapter-list {
    margin-top: 5px;
    padding-left: 5px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow: hidden;
    transition: max-height 0.3s ease-in-out;
}
.mophong-chapter.collapsed .mophong-chapter-list {
    max-height: 0 !important;
    margin-top: 0;
}
.mophong-item {
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid transparent;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
}
.mophong-item:hover {
    background: rgba(255, 255, 255, 0.04);
}
.mophong-item.active {
    background: var(--mp-primary-glow);
    border-color: rgba(137, 180, 250, 0.3);
    color: var(--mp-primary);
    font-weight: 700;
}
.mophong-item-badge {
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--mp-text-muted);
}
.mophong-item.active .mophong-item-badge {
    background: var(--mp-primary);
    color: #11111b;
}
.mophong-item.completed .mophong-item-badge-status {
    width: 6px;
    height: 6px;
    background: var(--mp-success);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--mp-success);
}

/* Sidebar Overlay */
.mophong-sidebar-overlay {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 99;
}

/* Main Panel */
.mophong-main-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
    padding: 20px;
    box-sizing: border-box;
}
.mophong-panel-top-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}
.mophong-btn-toggle-menu {
    display: none; /* Mobile only */
    background: var(--mp-card-bg) !important;
    border: 1px solid var(--mp-border) !important;
    color: var(--mp-text) !important;
    padding: 8px 12px !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    font-size: 0.85rem !important;
    font-weight: bold !important;
}
.mophong-btn-toggle-menu:hover {
    background: rgba(255, 255, 255, 0.08) !important;
}
.mophong-user-progress {
    font-size: 0.85rem;
    font-weight: bold;
    color: var(--mp-accent);
    background: rgba(203, 166, 247, 0.1);
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid rgba(203, 166, 247, 0.2);
}

/* 4. Video & Container */
.mophong-video-card {
    background: var(--mp-card-bg);
    border-radius: var(--mp-radius);
    border: 1px solid var(--mp-border);
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.mophong-video-container {
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.05);
}
.mophong-video-container video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.mophong-video-info {
    margin-top: 12px;
}
.mophong-video-info h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.4;
    color: var(--mp-text);
}

/* 5. Quiz Styling */
.mophong-quiz-card {
    background: var(--mp-card-bg);
    border-radius: var(--mp-radius);
    border: 1px solid var(--mp-border);
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.mophong-quiz-header {
    border-bottom: 1px solid var(--mp-border);
    padding-bottom: 15px;
    margin-bottom: 20px;
}
.mophong-quiz-badge {
    font-size: 0.75rem;
    font-weight: bold;
    padding: 3px 8px;
    border-radius: 4px;
    background: var(--mp-accent);
    color: #11111b;
}
.mophong-quiz-questions {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.mophong-quiz-item {
    background: rgba(255, 255, 255, 0.01);
    border-radius: 8px;
}
.mophong-quiz-title {
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 10px;
    color: var(--mp-primary);
    line-height: 1.4;
}
.mophong-options {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.mophong-option-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--mp-border);
    border-radius: 8px;
    padding: 12px 15px;
    cursor: pointer;
    font-size: 0.9rem;
    line-height: 1.4;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.mophong-option-label:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.2);
}
.mophong-option-label input[type="radio"] {
    margin-top: 3px;
    accent-color: var(--mp-primary);
    cursor: pointer;
    flex-shrink: 0;
}
.mophong-option-label.selected {
    background: var(--mp-primary-glow);
    border-color: var(--mp-primary);
    color: #fff;
    box-shadow: 0 0 10px var(--mp-primary-glow);
}
.mophong-option-label.correct {
    background: var(--mp-success-glow) !important;
    border-color: var(--mp-success) !important;
    color: var(--mp-success) !important;
    font-weight: 600;
}
.mophong-option-label.incorrect {
    background: var(--mp-danger-glow) !important;
    border-color: var(--mp-danger) !important;
    color: var(--mp-danger) !important;
}

/* Buttons */
.mophong-btn {
    border: none !important;
    padding: 12px 24px !important;
    font-size: 0.95rem !important;
    font-weight: 700 !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    transition: all 0.2s !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1) !important;
}
.mophong-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15) !important;
}
.mophong-btn:active {
    transform: translateY(0);
}
.mophong-btn-primary {
    background: var(--mp-primary) !important;
    color: #11111b !important;
}
.mophong-btn-primary:hover {
    background: #b4befe !important;
}
.mophong-btn-secondary {
    background: #cbd5e1 !important; /* Màu nền xám sáng giống hình 2 */
    color: #0f172a !important; /* Chữ màu tối nổi bật */
    border: 1px solid #94a3b8 !important;
}
.mophong-btn-secondary:hover {
    background: #e2e8f0 !important;
    color: #000000 !important;
}
.mophong-btn-success {
    background: var(--mp-success) !important;
    color: #11111b !important;
}
.mophong-btn-success:hover {
    background: #cba6f7 !important;
}
.mophong-btn-large {
    padding: 15px 32px !important;
    font-size: 1.05rem !important;
}
.mophong-quiz-actions {
    display: flex;
    gap: 15px;
    margin-top: 20px;
    border-top: 1px solid var(--mp-border);
    padding-top: 20px;
}

/* Feedback Banner */
.mophong-quiz-feedback-banner {
    margin-top: 20px;
    border-radius: 8px;
    padding: 15px 20px;
    border: 1px solid;
    animation: slideDown 0.3s ease;
}
.mophong-quiz-feedback-banner.success {
    background: rgba(166, 227, 161, 0.12);
    border-color: rgba(166, 227, 161, 0.3);
    color: var(--mp-success);
}
.mophong-quiz-feedback-banner.failed {
    background: rgba(243, 139, 168, 0.12);
    border-color: rgba(243, 139, 168, 0.3);
    color: var(--mp-danger);
}
.mophong-feedback-score {
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 10px;
}
.mophong-feedback-detail {
    font-size: 0.85rem;
    color: var(--mp-text);
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    line-height: 1.5;
}

/* 6. Exam Layout & Screen */
.mophong-exam-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 30px 20px;
    min-height: 550px;
    box-sizing: border-box;
}
.mophong-exam-screen {
    animation: fadeIn 0.4s ease;
}
.mophong-exam-welcome {
    text-align: center;
    background: var(--mp-card-bg);
    border: 1px solid var(--mp-border);
    border-radius: var(--mp-radius);
    padding: 40px 30px;
    max-width: 600px;
    margin: 40px auto;
    box-shadow: var(--mp-shadow);
}
.mophong-exam-icon-large {
    font-size: 3.5rem;
    display: inline-block;
    margin-bottom: 15px;
    animation: pulse 2s infinite;
}
.mophong-exam-rules {
    text-align: left;
    background: rgba(0, 0, 0, 0.2);
    padding: 20px;
    border-radius: 8px;
    margin: 25px 0 35px 0;
    border: 1px solid var(--mp-border);
}
.mophong-rule-item {
    margin-bottom: 10px;
    font-size: 0.9rem;
    line-height: 1.5;
}
.mophong-rule-item:last-child {
    margin-bottom: 0;
}

/* Active Exam screen */
.mophong-exam-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(24, 24, 37, 0.8);
    border: 1px solid var(--mp-border);
    border-radius: 8px;
    padding: 10px 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}
.mophong-exam-question-number {
    font-weight: bold;
    font-size: 0.95rem;
    color: #ffffff !important;
}
.mophong-exam-progress-bar-container {
    flex: 1;
    height: 8px;
    background: #11111b;
    border-radius: 4px;
    margin: 0 15px;
    overflow: hidden;
    border: 1px solid var(--mp-border);
}
.mophong-exam-progress-bar {
    height: 100%;
    background: var(--mp-primary);
    border-radius: 4px;
    transition: width 0.3s ease;
}
.mophong-exam-timer {
    font-family: monospace;
    font-weight: bold;
    font-size: 1rem;
    color: var(--mp-warning);
    background: rgba(249, 226, 175, 0.1);
    padding: 4px 10px;
    border-radius: 4px;
}
.mophong-exam-play-layout {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 20px;
}
.mophong-exam-video-panel {
    background: var(--mp-card-bg);
    border: 1px solid var(--mp-border);
    border-radius: var(--mp-radius);
    overflow: hidden;
    height: fit-content;
}
.mophong-exam-quiz-panel {
    background: var(--mp-card-bg);
    border: 1px solid var(--mp-border);
    border-radius: var(--mp-radius);
    padding: 20px;
    display: flex;
    flex-direction: column;
}
.mophong-exam-actions {
    display: flex;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid var(--mp-border);
}

/* Exam Result Card */
.mophong-result-card {
    text-align: center;
    background: var(--mp-card-bg);
    border: 1px solid var(--mp-border);
    border-radius: var(--mp-radius);
    padding: 40px 25px;
    box-shadow: var(--mp-shadow);
}
.mophong-result-badge {
    display: inline-block;
    padding: 8px 24px;
    border-radius: 20px;
    font-weight: 800;
    font-size: 1.1rem;
    letter-spacing: 1px;
}
.mophong-result-badge.pass {
    background: var(--mp-success);
    color: #11111b;
    box-shadow: 0 0 15px rgba(166, 227, 161, 0.3);
}
.mophong-result-badge.fail {
    background: var(--mp-danger);
    color: #11111b;
    box-shadow: 0 0 15px rgba(243, 139, 168, 0.3);
}
.mophong-result-score {
    font-size: 3rem;
    font-weight: 800;
    margin: 15px 0 5px 0;
}
.mophong-result-meta {
    font-size: 0.9rem;
    color: var(--mp-text-muted);
}

/* Exam Review List */
.mophong-exam-review-section {
    margin-top: 40px;
}
.mophong-review-item {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--mp-border);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 12px;
    text-align: left;
}
.mophong-review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 8px;
    margin-bottom: 12px;
    font-weight: bold;
    font-size: 0.9rem;
}
.mophong-review-score {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
}
.mophong-review-score.correct {
    background: rgba(166, 227, 161, 0.15);
    color: var(--mp-success);
}
.mophong-review-score.incorrect {
    background: rgba(243, 139, 168, 0.15);
    color: var(--mp-danger);
}
.mophong-review-q-row {
    margin-bottom: 8px;
    font-size: 0.85rem;
    line-height: 1.4;
}
.mophong-review-q-row strong {
    color: var(--mp-accent);
}

/* 7. Keyframe Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* 8. Responsive Breakpoints */
@media(max-width: 900px) {
    .mophong-exam-play-layout {
        grid-template-columns: 1fr;
    }
}

@media(max-width: 768px) {
    .mophong-study-layout {
        grid-template-columns: 1fr;
        height: auto;
    }
    .mophong-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 290px;
        transform: translateX(-100%);
        box-shadow: 5px 0 25px rgba(0,0,0,0.5);
    }
    .mophong-sidebar.open {
        transform: translateX(0);
    }
    .mophong-sidebar-close {
        display: block;
    }
    .mophong-sidebar-overlay.open {
        display: block;
    }
    .mophong-btn-toggle-menu {
        display: block;
    }
    .mophong-main-panel {
        height: auto;
        padding: 12px;
    }
    .mophong-video-card, .mophong-quiz-card {
        padding: 10px;
    }
    .mophong-quiz-actions {
        flex-direction: column;
    }
    .mophong-quiz-actions button {
        width: 100%;
    }
}

/* 9. Licensing Lock Screen */
.mophong-locked-state {
    min-height: 450px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 30px;
    box-sizing: border-box;
}
.mophong-lock-screen {
    text-align: center;
    background: var(--mp-card-bg);
    border: 1px solid var(--mp-border);
    border-radius: var(--mp-radius);
    padding: 40px 30px;
    max-width: 500px;
    margin: 30px auto;
    box-shadow: var(--mp-shadow);
    backdrop-filter: blur(10px);
}
.mophong-lock-icon {
    font-size: 4rem;
    display: inline-block;
    margin-bottom: 20px;
    filter: drop-shadow(0 0 10px rgba(243, 139, 168, 0.4));
    animation: lockPulse 2.5s infinite;
}
.mophong-lock-desc {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--mp-text-muted);
    margin: 15px 0 25px 0;
}
.mophong-lock-site-box {
    background: rgba(0, 0, 0, 0.3);
    border: 1px dashed var(--mp-border);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}
.mophong-lock-site-id {
    font-family: monospace;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--mp-warning);
    letter-spacing: 2px;
    margin-top: 5px;
}
@keyframes lockPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.08); }
    100% { transform: scale(1); }
}

/* Custom C# GroupBox-style questions outline (giống Hình 1 và Hình 2) */
.mophong-quiz-item {
    border: 1px solid #3b82f6 !important; /* Blue border outline */
    border-radius: 6px;
    padding: 15px 15px 12px 15px !important; /* Nhỏ lại để tiêu đề chiếm không gian dọc tự nhiên */
    margin-bottom: 20px !important;
    background: #fff !important;
    position: relative;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}
.mophong-quiz-title {
    font-weight: 800 !important;
    font-size: 1.05rem !important;
    color: #0f172a !important;
    background: #f8fafc !important; /* Trùng với nền container bên dưới */
    padding: 0 8px !important;
    position: relative !important; /* Relative giúp đẩy nội dung đáp án xuống tự động khi chữ dài */
    margin-top: -24px !important; /* Kéo tiêu đề đè lên viền trên */
    margin-bottom: 12px !important; /* Khoảng cách an toàn đến đáp án đầu tiên */
    left: 15px !important;
    display: inline-block !important;
    z-index: 2 !important;
    line-height: 1.4 !important;
}

.mophong-options {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 5px !important; /* Giảm khoảng cách giữa các đáp án từ 8px xuống 5px */
    margin-top: 5px !important; /* Tăng khoảng cách từ câu hỏi đến đáp án đầu tiên */
}

/* Options choices layout styling */
.mophong-option-label {
    background: #fff !important;
    border: 1px solid #cbd5e1 !important;
    color: #334155 !important;
    font-size: 0.95rem !important;
    font-weight: 500 !important;
    box-shadow: none !important;
    padding: 8px 12px !important; /* Giảm padding của từng đáp án */
}
.mophong-option-label:hover {
    background: #f1f5f9 !important;
    border-color: #94a3b8 !important;
}
.mophong-option-label.selected {
    background: #ed7d31 !important; /* Màu cam nổi bật khi học viên chọn đáp án */
    border-color: #c55a11 !important;
    color: #000000 !important;
    font-weight: bold !important;
}
.mophong-option-label.correct {
    background: #a6e3a1 !important; /* Green highlight like C# */
    border-color: #22c55e !important;
    color: #11111b !important;
    font-weight: bold !important;
}
.mophong-option-label.incorrect {
    background: #f07233 !important; /* Orange highlight like C# */
    border-color: #ea580c !important;
    color: #11111b !important;
    font-weight: bold !important;
}

/* Bottom status bar styling (giống hệt thanh điều khiển C#) */
.mophong-bottom-bar {
    background: #1e293b !important;
    border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
    padding: 15px 25px !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    color: #fff !important;
    flex-wrap: wrap !important;
    gap: 15px !important;
}

/* Left: Candidate block */
.mophong-candidate-info {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
}
.mophong-candidate-photo {
    width: 50px !important;
    height: 60px !important;
    background: #334155 !important;
    border: 1px solid #475569 !important;
    border-radius: 4px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 1.5rem !important;
    color: #94a3b8 !important;
}
.mophong-candidate-details {
    display: flex !important;
    flex-direction: column !important;
    gap: 2px !important;
}
.mophong-candidate-name {
    font-weight: 800 !important;
    font-size: 0.95rem !important;
    color: #3b82f6 !important; /* Blue text */
    text-transform: uppercase !important;
}
.mophong-candidate-meta {
    font-size: 0.8rem !important;
    color: #94a3b8 !important;
}

/* Center: Paged grid navigation */
.mophong-bottom-navigation {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
}
.mophong-question-grid {
    display: flex !important;
    gap: 6px !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
}
.mophong-question-grid.exam-grid-layout {
    display: grid !important;
    grid-template-columns: repeat(5, 1fr) !important;
    grid-gap: 4px !important;
}
.mophong-q-btn {
    width: 32px !important;
    height: 32px !important;
    border: 1px solid #475569 !important;
    background: #1e293b !important;
    color: #fff !important;
    font-weight: bold !important;
    font-size: 0.85rem !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.2s !important;
}
.mophong-q-btn:hover {
    background: #334155 !important;
}
.mophong-q-btn.active {
    background: #3b82f6 !important; /* Active is Blue */
    border-color: #3b82f6 !important;
    color: #fff !important;
}
.mophong-q-btn.completed {
    background: #22c55e !important; /* Completed is Green */
    border-color: #22c55e !important;
    color: #fff !important;
}

/* Custom styled buttons */
.mophong-btn-orange {
    background: #f07233 !important;
    color: #fff !important;
}
.mophong-btn-orange:hover {
    background: #ea580c !important;
}
.mophong-btn-blue {
    background: #3b82f6 !important;
    color: #fff !important;
}
.mophong-btn-blue:hover {
    background: #2563eb !important;
}
.mophong-btn-pink {
    background: #f472b6 !important;
    color: #fff !important;
}
.mophong-btn-pink:hover {
    background: #db2777 !important;
}

.mophong-exam-timer-v2 {
    font-family: monospace !important;
    font-weight: 800 !important;
    font-size: 1.1rem !important;
    color: #f59e0b !important;
    margin-right: 15px !important;
    background: rgba(245, 158, 11, 0.1) !important;
    padding: 6px 12px !important;
    border-radius: 6px !important;
    border: 1px solid rgba(245, 158, 11, 0.2) !important;
}

/* Layout kết quả thi thử chia đôi & Bảng thông tin chi tiết */
.mophong-result-top-block {
    display: grid !important;
    grid-template-columns: 1.2fr 1fr 1fr !important;
    gap: 15px !important;
    margin-bottom: 20px !important;
}
.mophong-result-info-panel {
    background: #fff !important;
    border: 1px solid var(--mp-border) !important;
    border-radius: 4px !important;
    padding: 15px !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02) !important;
}
.mophong-result-badge-v2 {
    font-weight: 800 !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
}
.mophong-result-badge-v2.pass {
    background: #22c55e !important;
}
.mophong-result-badge-v2.fail {
    background: #ef4444 !important;
}

/* Review list item in result screen sidebar */
.mophong-res-list-item {
    padding: 8px 12px !important;
    border: 1px solid var(--mp-border) !important;
    border-radius: 4px !important;
    background: #fff !important;
    cursor: pointer !important;
    transition: all 0.2s !important;
}
.mophong-res-list-item:hover {
    background: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
}
.mophong-res-list-item.active {
    background: #e0f2fe !important;
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15) !important;
}
.mophong-res-list-title {
    font-weight: 700 !important;
    font-size: 0.85rem !important;
    color: var(--mp-text) !important;
    margin-bottom: 6px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}
.mophong-res-dots-container {
    display: flex !important;
    gap: 6px !important;
}
.mophong-res-dot {
    width: 20px !important;
    height: 20px !important;
    border-radius: 50% !important;
    color: #fff !important;
    font-weight: bold !important;
    font-size: 0.75rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}
.mophong-res-dot.correct {
    background: #22c55e !important;
}
.mophong-res-dot.incorrect {
    background: #ef4444 !important;
}
.mophong-res-dot.unanswered {
    background: #94a3b8 !important;
}

/* Review option card styling (giống ảnh đính kèm) */
.mophong-review-option {
    padding: 10px 15px !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 4px !important;
    margin-bottom: 8px !important;
    font-size: 0.9rem !important;
    background: #fff !important;
}
.mophong-review-option.correct-chosen {
    background: #e2f0d9 !important;
    border-color: #a9d18e !important;
    color: #385723 !important;
    font-weight: 600 !important;
}
.mophong-review-option.incorrect-chosen {
    background: #fce4d6 !important;
    border-color: #f4b183 !important;
    color: #c55a11 !important;
    font-weight: 600 !important;
}
.mophong-review-option.correct-not-chosen {
    background: #e2f0d9 !important;
    border-color: #a9d18e !important;
    color: #385723 !important;
}

/* Print CSS to format scorecard layout beautifully */
@media print {
    body * {
        visibility: hidden !important;
    }
    #exam-result-screen, #exam-result-screen * {
        visibility: visible !important;
    }
    #exam-result-screen {
        position: absolute !important;
        left: 0 !important;
        top: 0 !important;
        width: 100% !important;
        background: #fff !important;
        color: #000 !important;
    }
    .mophong-btn, .mophong-bottom-bar, .mophong-nav, .mophong-result-badge-v2 button {
        display: none !important;
    }
    .mophong-result-top-block {
        grid-template-columns: 1fr 1fr 1fr !important;
    }
    .mophong-result-info-panel {
        border: 1px solid #000 !important;
        color: #000 !important;
    }
}

/* Mobile Responsive Styling (Khớp giao diện điện thoại giống hình) */
.mophong-mobile-only {
    display: none !important;
}

/* Thanh câu hỏi cố định ở đáy điện thoại - luôn ẩn trên desktop */
.mophong-fixed-bottom-bar {
    display: none !important;
}

/* Hai nút mũi tên nổi cố định giữa màn hình điện thoại - luôn ẩn trên desktop */
.mophong-mobile-nav-arrow {
    display: none !important;
}

@media (max-width: 768px) {
    .mophong-mobile-only {
        display: flex !important;
    }
    
    /* Ẩn các thành phần desktop trong thanh chân trang (cả Ôn Luyện và Thi Thử) */
    .mophong-candidate-info,
    #btnPrevExam,
    #btnNextExam,
    #btnPrevStudy,
    #btnNextStudy,
    .mophong-bottom-actions {
        display: none !important;
    }
    
    /* Ẩn hoàn toàn thanh chân trang cũ ở trong container trên mobile */
    .mophong-bottom-bar {
        display: none !important;
    }

    /* Hiển thị và style thanh câu hỏi ngoài body cố định ở đáy điện thoại */
    body.mophong-study-active #mophong-fixed-study-bar,
    body.mophong-exam-play-active #mophong-fixed-exam-bar {
        display: block !important;
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        z-index: 99999 !important; /* Đặt z-index cực cao để đè lên mọi menu WP */
        margin: 0 !important;
        border-radius: 0 !important;
        background: #ffffff !important; /* Nền trắng giống Hình 2/3 */
        border-top: 1px solid #e2e8f0 !important;
        box-shadow: 0 -4px 12px rgba(0,0,0,0.08) !important;
        padding: 10px 15px !important;
    }
    
    .mophong-bottom-navigation {
        width: 100% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 8px !important;
    }
    
    /* Grid câu hỏi - Thi thử hiển thị lưới 2x5, Ôn luyện hiển thị hàng ngang 5 câu */
    .mophong-question-grid {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        overflow: hidden !important; /* Ôn luyện: ẩn câu ngoài viewport, JS điều khiển trang */
        flex-grow: 1 !important;
        justify-content: flex-start !important;
        gap: 8px !important;
        padding: 4px 0 !important;
    }

    /* Thi thử: lưới 2 hàng × 5 cột */
    .mophong-question-grid.exam-grid-layout {
        display: grid !important;
        grid-template-columns: repeat(5, 1fr) !important;
        grid-gap: 6px !important;
        flex-grow: 1 !important;
        overflow: visible !important;
    }

    .mophong-q-btn {
        width: 44px !important;
        height: 44px !important;
        min-width: 44px !important;
        background: #fff !important;
        border: 1px solid #cbd5e1 !important;
        color: #0f172a !important;
        border-radius: 10px !important;
        font-size: 1rem !important;
        font-weight: bold !important;
        flex-shrink: 0 !important;
    }
    .mophong-q-btn.active {
        background: #3b82f6 !important;
        color: #fff !important;
        border-color: #3b82f6 !important;
    }
    
    .mophong-grid-toggle-btn {
        width: 44px !important;
        height: 44px !important;
        min-width: 44px !important;
        background: #2563eb !important;
        color: #fff !important;
        border: none !important;
        border-radius: 10px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        flex-shrink: 0 !important;
        box-shadow: 0 4px 8px rgba(37, 99, 235, 0.2) !important;
    }

    /* Nút mũi tên chuyển câu nổi NEO Ở GIỮA MÀN HÌNH (position: fixed) */
    .mophong-mobile-nav-arrow {
        position: fixed !important; /* Định vị fixed để neo theo màn hình khi scroll */
        top: 50% !important;
        transform: translateY(-50%) !important;
        width: 44px !important;
        height: 44px !important;
        border-radius: 50% !important;
        background: #2563eb !important;
        color: #fff !important;
        border: none !important;
        font-size: 1.2rem !important;
        font-weight: bold !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        z-index: 99999 !important; /* Đè lên toàn màn hình */
        box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4) !important;
        cursor: pointer !important;
    }
    .mophong-mobile-nav-arrow.mophong-left {
        left: 10px !important; /* Neo sát mép trái màn hình */
    }
    .mophong-mobile-nav-arrow.mophong-right {
        right: 10px !important; /* Neo sát mép phải màn hình */
    }

    /* Nút Nộp bài màu xanh lá to ở giữa */
    .mophong-mobile-submit-btn {
        width: 100% !important;
        max-width: 450px !important;
        background: #0f9f59 !important; /* Màu xanh lá cây của nút nộp bài giống hình */
        color: #fff !important;
        font-size: 1.1rem !important;
        font-weight: bold !important;
        padding: 14px 20px !important;
        border-radius: 12px !important;
        margin: 20px auto 10px auto !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 8px !important;
        box-shadow: 0 4px 10px rgba(15, 159, 89, 0.2) !important;
        border: none !important;
    }
    
    /* Chỉnh lề dưới cùng của trang để tránh bị che bởi thanh footer cố định (cả Ôn Luyện và Thi Thử) */
    #exam-play-screen, #study-play-screen {
        padding-bottom: 120px !important;
    }
    .mophong-quiz-questions {
        padding-bottom: 160px !important; /* Đẩy hẳn đáp án cuối cùng lên trên thanh footer khi cuộn tới câu cuối */
    }

    /* Tối ưu hóa giao diện kết quả thi thử trên điện thoại (Mobile Result View) */
    .mophong-result-top-block {
        display: flex !important;
        flex-direction: column !important;
        gap: 12px !important;
    }
    .mophong-result-info-panel {
        padding: 12px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    .mophong-result-table-container {
        width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        border: 1px solid var(--mp-border) !important;
        border-radius: 6px !important;
    }
    .mophong-result-score-table {
        min-width: 650px !important; /* Đảm bảo không bị bóp méo cột điểm từ 1-10 */
    }
    .mophong-result-split-review {
        display: flex !important;
        flex-direction: column !important;
        gap: 15px !important;
        margin-top: 15px !important;
    }
    .mophong-result-left-review {
        width: 100% !important;
        padding: 12px !important;
        box-sizing: border-box !important;
    }
    .mophong-result-right-list {
        width: 100% !important;
        padding: 12px !important;
        box-sizing: border-box !important;
    }
}

