/*
Theme Name: On Thi GPLX Theme
Theme URI: http://example.com/on-thi-gplx-theme
Author: Antigravity
Author URI: http://example.com
Description: Theme for On Thi GPLX based on static design.
Version: 1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: on-thi-gplx-theme
*/

/* Reset & Base */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f5f5f5;
    color: #333;
    font-size: 13px;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Header */
.main-header {
    background-color: #343a40;
    color: #fff;
    padding: 0 20px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo a {
    color: #ffc107;
    font-weight: bold;
    text-decoration: none;
    font-size: 16px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    margin-left: 20px;
}

.main-nav a {
    color: #ddd;
    text-decoration: none;
    margin-left: 20px;
    padding: 15px 0;
    font-size: 13px;
}

.main-nav a:hover,
.main-nav a.active {
    color: #fff;
    border-bottom: 2px solid #fff;
}

/* Common Layout */
.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Home Page Styles */
.home-container {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    padding: 20px;
}

.hero-banner {
    background: linear-gradient(135deg, #0056b3 0%, #004494 100%);
    color: white;
    padding: 40px;
    border-radius: 8px;
    margin-bottom: 30px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.hero-banner h1 {
    font-size: 28px;
    margin-bottom: 15px;
    font-weight: 700;
}

.hero-banner p {
    font-size: 16px;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

.section-title {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 20px;
    border-left: 5px solid #ffc107;
    padding-left: 10px;
    color: #343a40;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.feature-card {
    background: white;
    border-radius: 8px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid #eee;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 200px;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
    border-color: #ffc107;
}

.feature-icon {
    font-size: 40px;
    margin-bottom: 15px;
    color: #0056b3;
}

.feature-card h3 {
    font-size: 18px;
    margin-bottom: 10px;
    color: #333;
}

.feature-card p {
    color: #666;
    font-size: 13px;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.news-item {
    background: white;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #eee;
    display: flex;
    gap: 15px;
}

.news-thumb {
    width: 100px;
    height: 70px;
    background-color: #ddd;
    border-radius: 4px;
    flex-shrink: 0;
    overflow: hidden;
}

.news-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.news-content h4 {
    margin: 0 0 5px 0;
    font-size: 15px;
    color: #0056b3;
}

.news-content p {
    margin: 0;
    font-size: 12px;
    color: #777;
}

/* Theory Page Specifics */
.theory-container {
    display: flex;
    max-width: 1400px;
    margin: 20px auto;
    background: #fff;
    position: relative;
    overflow: hidden;
}

.watermark-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-content: center;
    opacity: 0.05;
    transform: rotate(-30deg) scale(1.2);
}

.watermark {
    font-size: 30px;
    font-weight: bold;
    margin: 50px;
    white-space: nowrap;
}

.question-text-wrapper {
    position: relative;
    z-index: 1;
}

.q-text-red {
    color: #d32f2f;
    font-size: 24px;
    font-weight: bold;
    line-height: 1.4;
    margin-bottom: 20px;
}

.q-options {
    font-size: 18px;
    line-height: 1.6;
}

.q-option {
    margin-bottom: 10px;
}

.question-action-bar {
    border-top: 1px solid #ddd;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
}

.action-left {
    font-size: 14px;
}

.action-center {
    display: flex;
    gap: 5px;
}

.ans-btn {
    width: 40px;
    height: 40px;
    background-color: #f0ad4e;
    color: white;
    border: none;
    font-weight: bold;
    font-size: 16px;
    cursor: pointer;
    border-radius: 2px;
}

.ans-btn:hover {
    background-color: #ec971f;
}

.btn-guide {
    background-color: #5bc0de;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 3px;
    cursor: pointer;
}

/* Theory Sidebar */
.theory-sidebar {
    width: 400px;
    padding: 15px;
    background: #fff;
}

.rating-section {
    text-align: right;
    color: #ffc107;
    margin-bottom: 15px;
}

.sidebar-box {
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 15px;
    padding: 10px;
}

.box-header {
    font-weight: bold;
    margin-bottom: 10px;
    font-size: 12px;
}

.question-matrix {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 3px;
}

.matrix-btn {
    aspect-ratio: 1;
    border: 1px solid #ccc;
    background: #f0f0f0;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
}

.matrix-btn:hover {
    background: #e0e0e0;
}

.matrix-btn.active {
    background: #d9534f;
    color: white;
    border-color: #d43f3a;
}

.matrix-btn.paralysis {
    border: 1px solid red;
    color: red;
    font-weight: bold;
}

/* Trạng thái đã trả lời - chỉ tô màu nền */
.matrix-btn.answered-correct {
    background: #28a745 !important;
    color: white !important;
    border-color: #1e7e34 !important;
}

.matrix-btn.answered-wrong {
    background: #dc3545 !important;
    color: white !important;
    border-color: #c82333 !important;
}

/* Khi đang active và đã trả lời */
.matrix-btn.active.answered-correct {
    background: #1e7e34 !important;
    box-shadow: 0 0 0 2px #28a745;
}

.matrix-btn.active.answered-wrong {
    background: #bd2130 !important;
    box-shadow: 0 0 0 2px #dc3545;
}

/* Câu liệt đã trả lời */
.matrix-btn.paralysis.answered-correct {
    border-color: #28a745 !important;
}

.matrix-btn.paralysis.answered-wrong {
    border-color: #dc3545 !important;
}

.instructions p {
    margin: 5px 0;
    font-size: 12px;
    color: #555;
}

.red-text {
    color: red;
}

.topic-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.tag {
    padding: 4px 8px;
    color: white;
    font-size: 11px;
    border-radius: 2px;
    cursor: pointer;
}

.tag.orange {
    background-color: #f0ad4e;
}

.tag.blue {
    background-color: #5bc0de;
}

.tag.dark-blue {
    background-color: #337ab7;
}

.tag.red {
    background-color: #d9534f;
}

.support-text {
    text-align: center;
    font-size: 12px;
    color: #777;
    margin-top: 20px;
}

/* Simulation Styles */
.sim-container {
    display: flex;
    max-width: 1400px;
    margin: 20px auto;
    background: #fff;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    min-height: 800px;
}

.sim-main {
    flex: 1;
    background-color: #000;
    display: flex;
    flex-direction: column;
    position: relative;
}

.video-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.video-player {
    flex: 1;
    background: #000;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 500px;
}

.countdown-overlay {
    width: 300px;
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.circle-timer {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    border: 20px solid #333;
    border-top-color: #3498db;
    border-left-color: #3498db;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 100px;
    font-weight: bold;
    color: #3498db;
}

.video-controls-bottom {
    background: #fff;
    padding: 10px;
    border-top: 1px solid #ddd;
}

.timeline-bar {
    height: 10px;
    background: #e9ecef;
    margin-bottom: 10px;
    position: relative;
    cursor: pointer;
}

.timeline-bar .progress {
    background: #28a745;
    height: 100%;
}

.status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

.status-left strong {
    text-decoration: underline;
}

.status-center {
    color: #dc3545;
    font-weight: bold;
    display: flex;
    gap: 15px;
}

.btn-sm {
    padding: 5px 10px;
    border: 1px solid #17a2b8;
    background: #17a2b8;
    color: white;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
}

.sim-sidebar {
    width: 400px;
    border-left: 1px solid #ddd;
    background: #fff;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.chapter-list-container {
    flex: 1;
    overflow-y: auto;
    border: 1px solid #eee;
    padding: 5px;
    max-height: 400px;
}

.chapter-group {
    margin-bottom: 15px;
}

.chapter-title {
    font-weight: bold;
    margin-bottom: 5px;
    font-size: 12px;
    cursor: pointer;
}

.chapter-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
}

.th-btn {
    width: 30px;
    height: 25px;
    border: 1px solid #ddd;
    background: #f8f9fa;
    font-size: 11px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.th-btn:hover {
    background: #e2e6ea;
}

.th-btn.active {
    background: #dc3545;
    color: white;
    border-color: #dc3545;
}

.settings-box {
    border: 1px solid #eee;
    padding: 10px;
    background: #fdfdfd;
}

.setting-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.btn-expand {
    background: #17a2b8;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
}

.time-options {
    display: flex;
    gap: 5px;
}

.time-btn {
    flex: 1;
    padding: 5px;
    border: 1px solid #ffc107;
    background: #fff;
    color: #ffc107;
    cursor: pointer;
    font-weight: bold;
}

.time-btn.active {
    background: #ffc107;
    color: white;
}

.playback-controls {
    border: 1px solid #eee;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.control-buttons {
    display: flex;
    gap: 5px;
}

.ctrl-btn {
    width: 35px;
    height: 30px;
    background: #343a40;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
}

.topic-review h4 {
    margin: 0 0 10px 0;
    font-size: 13px;
    border-left: 3px solid #343a40;
    padding-left: 5px;
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

/* Footer */
.main-footer {
    background-color: #343a40;
    color: #aaa;
    padding: 20px;
    text-align: center;
    margin-top: auto;
    font-size: 12px;
}

/* =====================================================
   QUESTION IMAGE & ANSWER STYLES (Ly Thuyet 600 cau)
   ===================================================== */

.question-image-box {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    background: #fafafa;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.question-image-box img {
    width: 100%;
    height: auto;
    display: block;
}

.answer-section-ly-thuyet {
    margin-top: 25px;
    animation: fadeSlideIn 0.4s ease;
}

@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(-15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.answer-divider {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.answer-divider span {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    padding: 8px 20px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 3px 10px rgba(40, 167, 69, 0.3);
}

.answer-image-box {
    border: 3px solid #28a745;
    border-radius: 8px;
    overflow: hidden;
    background: #f0fff4;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.2);
}

.answer-image-box img {
    width: 100%;
    height: auto;
    display: block;
}

.btn-answer {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    font-size: 13px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-right: 10px;
}

.btn-answer:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.4);
}

.btn-answer.active {
    background: linear-gradient(135deg, #dc3545, #e74c3c);
}

.ans-btn.selected {
    background-color: #337ab7;
    box-shadow: 0 0 0 3px rgba(51, 122, 183, 0.3);
}

.action-right {
    display: flex;
    align-items: center;
}

.question-nav-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 12px 20px;
    background: #f8f9fa;
    border-top: 1px solid #eee;
}

.nav-arrow {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-arrow:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.nav-arrow:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.nav-info {
    font-size: 14px;
    font-weight: bold;
    color: #333;
    background: white;
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid #ddd;
}

.chapter-selector {
    padding: 8px;
}

.chapter-tabs-sidebar {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.ch-tab {
    flex: 1;
    min-width: 80px;
    padding: 8px 5px;
    border: 1px solid #ddd;
    background: #f8f9fa;
    color: #333;
    font-size: 11px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.ch-tab:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.ch-tab.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-color: transparent;
}

.instructions kbd {
    background: #e9ecef;
    border: 1px solid #ddd;
    border-radius: 3px;
    padding: 2px 6px;
    font-family: monospace;
    font-size: 11px;
}

.topic-tag {
    transition: all 0.2s ease;
}

.topic-tag:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.question-matrix {
    max-height: 300px;
    overflow-y: auto;
}

.question-matrix::-webkit-scrollbar {
    width: 6px;
}

.question-matrix::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.question-matrix::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

@media (max-width: 1000px) {
    .theory-container {
        flex-direction: column;
    }

    .theory-sidebar {
        width: 100%;
        order: 2;
    }

    .theory-main {
        border-right: none;
        border-bottom: 1px solid #eee;
    }

    .question-action-bar {
        flex-wrap: wrap;
        gap: 10px;
    }

    .action-left {
        width: 100%;
        text-align: center;
    }

    .action-center {
        margin-left: 87px;
        justify-content: center;
    }

    .action-right {
        width: 100%;
        justify-content: center;
    }

    .question-nav-bar {
        flex-wrap: nowrap;
        gap: 8px;
        padding: 10px 15px;
    }

    .question-nav-bar .nav-arrow {
        padding: 8px 12px;
        font-size: 12px;
    }

    .question-nav-bar .nav-info {
        padding: 6px 10px;
        font-size: 12px;
        white-space: nowrap;
    }
}

/* =====================================================
   QUESTION IMAGE & ANSWER STYLES
   ===================================================== */

.question-image-box {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    background: #fafafa;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.question-image-box img {
    width: 100%;
    height: auto;
    display: block;
}

.answer-section-ly-thuyet {
    margin-top: 25px;
    animation: fadeSlideIn 0.4s ease;
}

@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(-15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.answer-divider {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.answer-divider span {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    padding: 8px 20px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.answer-image-box {
    border: 3px solid #28a745;
    border-radius: 8px;
    overflow: hidden;
    background: #f0fff4;
}

.answer-image-box img {
    width: 100%;
    height: auto;
    display: block;
}

.btn-answer {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    font-size: 13px;
    margin-right: 10px;
}

.btn-answer.active {
    background: linear-gradient(135deg, #dc3545, #e74c3c);
}

.ans-btn.selected {
    background-color: #337ab7;
}

.action-right {
    display: flex;
    align-items: center;
}

.question-nav-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 12px 20px;
    background: #f8f9fa;
    border-top: 1px solid #eee;
}

.nav-arrow {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
}

.nav-arrow:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.nav-info {
    font-size: 14px;
    font-weight: bold;
    color: #333;
    background: white;
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid #ddd;
}

.chapter-selector {
    padding: 8px;
}

.chapter-tabs-sidebar {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.ch-tab {
    flex: 1;
    min-width: 80px;
    padding: 8px 5px;
    border: 1px solid #ddd;
    background: #f8f9fa;
    color: #333;
    font-size: 11px;
    border-radius: 4px;
    cursor: pointer;
}

.ch-tab.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-color: transparent;
}

.instructions kbd {
    background: #e9ecef;
    border: 1px solid #ddd;
    border-radius: 3px;
    padding: 2px 6px;
    font-family: monospace;
    font-size: 11px;
}

.topic-tag:hover {
    transform: scale(1.05);
}

.question-matrix {
    max-height: 300px;
    overflow-y: auto;
}

/* Fix Answer Section Position */
.answer-section-ly-thuyet {
    position: relative;
    z-index: 10;
    background: white;
    padding: 20px;
    margin: 0 40px 20px 40px;
    border-radius: 8px;
}

.question-content-area {
    overflow: visible;
}

/* Result Message Styles */
.result-message {
    padding: 15px 20px;
    border-radius: 8px;
    margin: 0 20px 15px 20px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-message.result-correct {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    border: 2px solid #28a745;
    color: #155724;
}

.result-message.result-wrong {
    background: linear-gradient(135deg, #f8d7da, #f5c6cb);
    border: 2px solid #dc3545;
    color: #721c24;
}

.result-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.result-icon {
    font-size: 24px;
}

.result-correct .result-icon {
    color: #28a745;
}

.result-wrong .result-icon {
    color: #dc3545;
}

.result-text {
    font-size: 14px;
    line-height: 1.5;
}

.highlight-correct {
    color: #28a745;
    font-weight: bold;
    text-transform: uppercase;
}

.highlight-wrong {
    color: #dc3545;
    font-weight: bold;
    text-transform: uppercase;
}

/* Answer Button States */
.ans-btn.correct {
    background-color: #28a745 !important;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.4);
}

.ans-btn.wrong {
    background-color: #dc3545 !important;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.4);
}

/* Info Modal Styles */
.info-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    cursor: pointer;
}

.modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    background: white;
    border-radius: 10px;
    padding: 10px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    z-index: 1;
}

.modal-content img {
    max-width: 100%;
    max-height: 80vh;
    display: block;
    border-radius: 5px;
}

.modal-close {
    position: absolute;
    top: -15px;
    right: -15px;
    width: 40px;
    height: 40px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s;
}

.modal-close:hover {
    transform: scale(1.1);
}

/* Info Image Box in Sidebar */
.info-image-box {
    margin-top: 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    overflow: hidden;
}

.info-image-box img {
    width: 100%;
    height: auto;
    display: block;
}

/* Info Header Styles */
.info-header {
    font-weight: bold;
    font-size: 12px;
    padding: 10px;
    background: #f5f5f5;
    border-bottom: 1px solid #ddd;
}

.info-tip {
    background: #fff3cd;
    color: #856404;
    font-family: monospace;
    font-size: 11px;
}

.topic-tag:hover {
    transform: scale(1.05);
}

.question-matrix {
    max-height: 300px;
    overflow-y: auto;
}

/* Fix Answer Section Position */
.answer-section-ly-thuyet {
    position: relative;
    z-index: 10;
    background: white;
    padding: 20px;
    margin: 0 40px 20px 40px;
    border-radius: 8px;
}

.question-content-area {
    overflow: visible;
}

/* Result Message Styles */
.result-message {
    padding: 15px 20px;
    border-radius: 8px;
    margin: 0 20px 15px 20px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-message.result-correct {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    border: 2px solid #28a745;
    color: #155724;
}

.result-message.result-wrong {
    background: linear-gradient(135deg, #f8d7da, #f5c6cb);
    border: 2px solid #dc3545;
    color: #721c24;
}

.result-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.result-icon {
    font-size: 24px;
}

.result-correct .result-icon {
    color: #28a745;
}

.result-wrong .result-icon {
    color: #dc3545;
}

.result-text {
    font-size: 14px;
    line-height: 1.5;
}

.highlight-correct {
    color: #28a745;
    font-weight: bold;
    text-transform: uppercase;
}

.highlight-wrong {
    color: #dc3545;
    font-weight: bold;
    text-transform: uppercase;
}

/* Answer Button States */
.ans-btn.correct {
    background-color: #28a745 !important;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.4);
}

.ans-btn.wrong {
    background-color: #dc3545 !important;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.4);
}

/* Info Modal Styles */
.info-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    cursor: pointer;
}

.modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    background: white;
    border-radius: 10px;
    padding: 10px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    z-index: 1;
}

.modal-content img {
    max-width: 100%;
    max-height: 80vh;
    display: block;
    border-radius: 5px;
}

.modal-close {
    position: absolute;
    top: -15px;
    right: -15px;
    width: 40px;
    height: 40px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s;
}

.modal-close:hover {
    transform: scale(1.1);
}

/* Info Image Box in Sidebar */
.info-image-box {
    margin-top: 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    overflow: hidden;
}

.info-image-box img {
    width: 100%;
    height: auto;
    display: block;
}

/* Info Header Styles */
.info-header {
    font-weight: bold;
    font-size: 12px;
    padding: 10px;
    background: #f5f5f5;
    border-bottom: 1px solid #ddd;
}

.info-tip {
    background: #fff3cd;
    color: #856404;
    padding: 10px;
    font-size: 12px;
    border-bottom: 1px solid #ffc107;
}

.info-tip i {
    color: #ffc107;
    margin-right: 5px;
}

/* =====================================================
   SIMULATION PAGE STYLES (Moved from page-mo-phong.php)
   ===================================================== */
.exam-note {
    color: #dc3545;
    font-size: 11px;
    font-weight: normal;
}

.chapter-list-container {
    max-height: 280px;
    overflow-y: auto;
}

/* Overrides for specific page layout */
.sim-container {
    min-height: auto;
}

.sim-main {
    min-height: auto;
}

.video-player {
    position: relative;
    height: 350px;
    background: #000;
}

#situationVideo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

/* Hide video controls */
#situationVideo::-webkit-media-controls-volume-slider,
#situationVideo::-webkit-media-controls-mute-button,
#situationVideo::-webkit-media-controls-fullscreen-button,
#situationVideo::-webkit-media-controls-overflow-button,
#situationVideo::-webkit-media-controls-download-button,
#situationVideo::-webkit-media-controls-toggle-closed-captions-button,
#situationVideo::-webkit-media-controls-picture-in-picture-button {
    display: none !important;
}

video::-webkit-media-controls-volume-slider,
video::-webkit-media-controls-mute-button,
video::-webkit-media-controls-fullscreen-button,
video::-webkit-media-controls-overflow-button,
video::-webkit-media-controls-download-button,
video::-webkit-media-controls-toggle-closed-captions-button,
video::-webkit-media-controls-picture-in-picture-button {
    display: none !important;
}

video::-internal-media-controls-overflow-button {
    display: none !important;
}

.countdown-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.circle-timer {
    width: 150px;
    height: 150px;
    font-size: 70px;
    border-radius: 50%;
    border: 10px solid #333;
    border-top-color: #3498db;
    border-left-color: #3498db;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #3498db;
}

.play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    color: white;
    font-size: 16px;
    gap: 10px;
}

.play-overlay i {
    font-size: 50px;
    color: #3498db;
}

.play-overlay:hover i {
    color: #5dade2;
}

.sim-sidebar {
    width: 500px;
}

.chapter-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
}

.th-btn {
    width: 28px;
    height: 24px;
    font-size: 10px;
}

/* Timeline styles */
.video-controls-bottom {
    background: #444;
    padding: 0;
}

.timeline-row {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    background: #333;
}

.timeline-bar {
    flex: 1;
    height: 8px;
    background: #666;
    position: relative;
    border-radius: 4px;
    overflow: hidden;
    margin-right: 10px;
    margin-bottom: 0;
    /* Reset */
}

.timeline-bar .progress {
    height: 100%;
    background: #28a745;
    position: absolute;
    top: 0;
    left: 0;
    border-radius: 4px;
}

.time-display {
    margin-top: 0;
    /* Reset */
    font-size: 12px;
    color: #ccc;
    white-space: nowrap;
}

/* Answer bar */
.answer-row {
    padding: 8px 10px;
    background: #555;
}

.answer-bar {
    height: 12px;
    background: #888;
    position: relative;
    border-radius: 2px;
    overflow: visible;
}

/* Flag zone */
.flag-zone {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.flag-zone .zone {
    position: absolute;
    top: 0;
    height: 100%;
}

.flag-zone .zone-1-left,
.flag-zone .zone-1-right {
    background: #f44336;
}

.flag-zone .zone-2-left,
.flag-zone .zone-2-right {
    background: #ff9800;
}

.flag-zone .zone-3-left,
.flag-zone .zone-3-right {
    background: #ffeb3b;
}

.flag-zone .zone-4-left,
.flag-zone .zone-4-right {
    background: #8bc34a;
}

.flag-zone .zone-5 {
    background: #4caf50;
}

/* Flag marker */
.flag-marker {
    position: absolute;
    top: -16px;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.flag-marker i {
    font-size: 12px;
    color: #dc3545;
}

.flag-marker .flag-time {
    font-size: 9px;
    color: #fff;
    background: #dc3545;
    padding: 1px 3px;
    border-radius: 2px;
    white-space: nowrap;
}

.flag-marker.score-5 i {
    color: #4caf50;
}

.flag-marker.score-5 .flag-time {
    background: #4caf50;
}

.flag-marker.score-4 i {
    color: #8bc34a;
}

.flag-marker.score-4 .flag-time {
    background: #8bc34a;
}

.flag-marker.score-3 i {
    color: #ffeb3b;
}

.flag-marker.score-3 .flag-time {
    background: #ffeb3b;
    color: #333;
}

.flag-marker.score-2 i {
    color: #ff9800;
}

.flag-marker.score-2 .flag-time {
    background: #ff9800;
}

.flag-marker.score-1 i {
    color: #f44336;
}

.flag-marker.score-1 .flag-time {
    background: #f44336;
}

.flag-marker.score-0 i {
    color: #6c757d;
}

.flag-marker.score-0 .flag-time {
    background: #6c757d;
}

/* Status bar */
.status-bar {
    padding: 8px 10px;
    background: #f5f5f5;
    border-top: 1px solid #ddd;
}

/* Achievement colors */
.th-btn.th-pass {
    background: #28a745 !important;
    color: white !important;
    border-color: #1e7e34 !important;
}

.th-btn.th-fail {
    background: #dc3545 !important;
    color: white !important;
    border-color: #c82333 !important;
}

.th-btn.active.th-pass {
    background: #1e7e34 !important;
    box-shadow: 0 0 0 2px #28a745;
}

.th-btn.active.th-fail {
    background: #bd2130 !important;
    box-shadow: 0 0 0 2px #dc3545;
}

/* =====================================================
   MOBILE RESPONSIVE DESIGN
   ===================================================== */
@media (max-width: 768px) {
    .sim-container {
        flex-direction: column;
        margin: 0;
        width: 100%;
        box-shadow: none;
    }

    .sim-main {
        width: 100%;
        height: auto;
    }

    .video-player {
        height: auto;
        aspect-ratio: 16/9;
        min-height: auto;
    }

    .countdown-overlay .circle-timer {
        width: 100px;
        height: 100px;
        font-size: 40px;
    }

    .sim-sidebar {
        width: 100%;
        border-left: none;
        border-top: 1px solid #ddd;
        padding: 10px;
    }

    .chapter-list-container {
        max-height: 250px;
    }

    .th-btn {
        width: 35px;
        height: 35px;
        font-size: 12px;
    }

    .status-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .status-right {
        width: 100%;
        display: flex;
        justify-content: space-between;
    }

    .video-controls-bottom {
        padding: 5px;
    }

    .timeline-row,
    .answer-row {
        padding: 5px;
    }

    .settings-box {
        margin-top: 10px;
    }

    .playback-controls {
        flex-direction: column;
        gap: 10px;
    }

    .playback-controls .instruction {
        font-size: 11px;
        text-align: center;
    }

    .control-buttons {
        width: 100%;
        justify-content: center;
    }

    .ctrl-btn {
        width: 50px;
        height: 40px;
    }
}