/* ===== thi120mophong.css — scoped under #thi120 ===== */

#thi120 {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

/* Video container */
#thi120 #videoBannerContainer {
    position: relative;
    width: 100%;
    overflow: hidden;
    background-color: #000;
    border-radius: 8px;
}
#thi120 #videoBanner {
    width: 100%;
    height: auto;
    display: block;
}
#thi120 #videoPlayer {
    width: 100%;
    height: auto;
    display: block;
}

/* Timeline */
#thi120 .timeline-container {
    position: relative;
    width: 100%;
    height: 20px;
    background: rgba(0,0,0,0.6);
    overflow: hidden;
}
#thi120 #thiTimeline {
    background-color: #22c55e;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    width: 0%;
    transition: width 0.05s linear;
}
#thi120 #reviewSegments {
    position: absolute;
    top: 50%;
    left: 0;
    height: 50%;
    width: 100%;
}
#thi120 #flagArea {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}
#thi120 .flag-huy {
    position: absolute;
    width: 16px;
    top: -2px;
    transform: translateX(-50%);
}

/* Score container overlay on video */
#thi120 #scoreContainer {
    position: absolute;
    bottom: 28px;
    right: 8px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}
#thi120 #nextQuestionBtn {
    background-color: #22c55e;
    border: none;
    border-radius: 8px;
    color: #fff;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
}
#thi120 #nextQuestionBtn:hover {
    background-color: #16a34a;
}
#thi120 #scoreDisplayContainer {
    border: 2px solid rgba(255,255,255,0.8);
    border-radius: 8px;
    padding: 2px 8px;
    background: rgba(0,0,0,0.5);
}
#thi120 #scoreDisplay {
    font-size: 15px;
    color: #4df974;
    font-weight: 600;
}

/* Control buttons row */
#thi120 .thi-controls {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 12px;
}
#thi120 .thi-btn {
    padding: 10px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: background 0.2s, transform 0.15s;
    text-align: center;
}
#thi120 .thi-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
#thi120 .thi-btn-primary {
    background-color: #2563eb;
    color: #fff;
}
#thi120 .thi-btn-primary:hover:not(:disabled) {
    background-color: #1d4ed8;
}
#thi120 .thi-btn-warning {
    background-color: #f59e0b;
    color: #fff;
}
#thi120 .thi-btn-warning:hover:not(:disabled) {
    background-color: #d97706;
}
#thi120 .thi-btn-gray {
    background-color: #6b7280;
    color: #fff;
}
#thi120 .thi-btn-gray:hover:not(:disabled) {
    background-color: #4b5563;
}

/* Retry space button */
#thi120 #retrySpaceBtn {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    margin-bottom: 10px;
    background-color: #f59e0b;
    color: #fff;
}
#thi120 #retrySpaceBtn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Post-exam buttons */
#thi120 .post-exam {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 8px;
}
#thi120 .btn-post {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: transform 0.15s, background 0.2s;
}
#thi120 .btn-post:hover {
    transform: scale(1.03);
}
#thi120 #retryCurrentBtn { background-color: #f05a28; color: #fff; }
#thi120 #retryCurrentBtn:hover { background-color: #d84e23; }
#thi120 #newExamBtn { background-color: #22c55e; color: #fff; }
#thi120 #newExamBtn:hover { background-color: #16a34a; }
#thi120 #review120Btn { background-color: #2563eb; color: #fff; }
#thi120 #review120Btn:hover { background-color: #1d4ed8; }

/* Exam info bar */
#thi120 .exam-info-bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 16px;
    align-items: center;
    background: #fff;
    border: 2px solid #2563eb;
    border-radius: 8px;
    padding: 10px 16px;
    margin-top: 12px;
    font-size: 14px;
}
#thi120 .exam-info-bar span {
    min-width: 0;
    overflow-wrap: break-word;
}
#thi120 .exam-info-bar strong { color: #1f2937; }

/* Score table (Bảng điểm) */
#thi120 .thi-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0;
    border: 2px solid #2563eb;
    border-radius: 10px;
    overflow: hidden;
    margin-top: 8px;
    background: #fff;
    font-size: 14px;
}
#thi120 .thi-table th,
#thi120 .thi-table td {
    padding: 8px 10px;
    text-align: center;
    border-bottom: 1px solid #d1d5db;
    border-right: 1px solid #d1d5db;
    vertical-align: middle;
}
#thi120 .thi-table th:last-child,
#thi120 .thi-table td:last-child {
    border-right: none;
}
#thi120 .thi-table tbody tr:last-child td {
    border-bottom: none;
}
#thi120 .thi-table thead tr {
    background-color: #2563eb;
    color: #fff;
    font-weight: 700;
}
#thi120 .thi-table tbody tr:nth-child(even) {
    background-color: #f8fafc;
}
#thi120 .thi-table tbody tr:hover {
    background-color: #eff6ff;
}
#thi120 .thi-table th:nth-child(1),
#thi120 .thi-table td:nth-child(1) { width: 25%; }
#thi120 .thi-table th:nth-child(2),
#thi120 .thi-table td:nth-child(2) { width: 25%; }
#thi120 .thi-table th:nth-child(3),
#thi120 .thi-table td:nth-child(3) { width: 50%; }
#thi120 .thi-table .btn-sm {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    margin: 2px;
    display: inline-block;
}
#thi120 .thi-table .btn-review {
    background-color: #2563eb;
    color: #fff;
}
#thi120 .thi-table .btn-retry-q {
    background-color: #f59e0b;
    color: #fff;
}

/* Exam selection buttons */
#thi120 .exam-section-title {
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
    margin: 24px 0 12px;
}
#thi120 .exam-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 8px;
}
#thi120 .exam-btn {
    height: 42px;
    background: #ededed;
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    border: 1px solid rgba(29,156,235,0.6);
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    transition: background 0.2s;
}
#thi120 .exam-btn:hover {
    background: #dbeafe;
    border-color: #2563eb;
}

/* History table (Lịch sử thi) */
#thi120 #historyTable {
    width: 100%;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0;
    border: 2px solid #2563eb;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    font-size: 14px;
}
#thi120 #historyTable th,
#thi120 #historyTable td {
    padding: 10px 12px;
    text-align: center;
    border-bottom: 1px solid #d1d5db;
    border-right: 1px solid #d1d5db;
    vertical-align: middle;
    word-wrap: break-word;
}
#thi120 #historyTable th:last-child,
#thi120 #historyTable td:last-child {
    border-right: none;
}
#thi120 #historyTable tbody tr:last-child td {
    border-bottom: none;
}
#thi120 #historyTable thead tr {
    background-color: #2563eb;
    color: #fff;
    font-weight: 700;
}
#thi120 #historyTable tbody tr:nth-child(even) {
    background-color: #f8fafc;
}
#thi120 #historyTable tbody tr:hover {
    background-color: #eff6ff;
}
#thi120 #historyTable th:nth-child(1) { width: 130px; }
#thi120 #historyTable th:nth-child(2) { width: auto; }
#thi120 #historyTable th:nth-child(3) { width: 120px; }
#thi120 #historyTable td:nth-child(2) {
    text-align: left;
    font-size: 13px;
    line-height: 1.4;
}
#thi120 .retry-btn {
    padding: 3px 8px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    background-color: #2563eb;
    color: #fff;
    margin-left: 6px;
}

/* Pagination */
#thi120 #paginationControls {
    display: flex;
    justify-content: center;
    gap: 4px;
    flex-wrap: wrap;
}
#thi120 .page-btn {
    min-width: 36px;
    height: 36px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    background-color: #DDE8F3;
    color: #000;
}
#thi120 .page-btn:hover {
    background-color: #2563eb;
    color: #fff;
}
#thi120 .page-btn.active {
    background-color: #2563eb;
    color: #fff;
}

/* Notification overlay */
#thi120 .notification-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0,0,0,0.7);
    color: #fff;
    padding: 16px 24px;
    border-radius: 10px;
    z-index: 10000;
    font-size: 15px;
    font-weight: 500;
}

/* Score ghost animation */
.score-ghost {
    position: absolute;
    font-size: 20px;
    color: #4df974;
    transition: transform 0.7s ease, opacity 0.7s ease;
    pointer-events: none;
    z-index: 1000;
    font-weight: 700;
}

/* Modal — outside #thi120 scope */
.thi-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    background-color: rgba(0,0,0,0.55);
    padding: 16px;
}
.thi-modal.is-open {
    display: flex;
}
.thi-modal-box {
    background: #fff;
    border-radius: 10px;
    max-width: 95vw;
    width: 100%;
    max-height: 95vh;
    overflow-y: auto;
    box-shadow: 0 16px 48px rgba(0,0,0,0.25);
    animation: thiFadeIn 0.2s ease;
}
@keyframes thiFadeIn {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
.thi-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid #e5e7eb;
}
.thi-modal-body {
    padding: 16px;
}
.thi-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 10px 16px;
    border-top: 1px solid #e5e7eb;
}
.thi-modal-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    width: 100%;
}
@media (min-width: 768px) {
    .thi-modal-grid { grid-template-columns: 1fr 1fr; }
}
.thi-modal-grid img,
.thi-modal-grid video {
    width: 100%;
    height: auto;
    border-radius: 6px;
    display: block;
}
.thi-btn-close {
    background: none;
    border: none;
    font-size: 22px;
    line-height: 1;
    color: #9ca3af;
    cursor: pointer;
}
.thi-btn-close:hover { color: #4b5563; }
.thi-modal-btn {
    padding: 8px 20px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border: none;
}
.thi-modal-btn-blue { background: #2563eb; color: #fff; }
.thi-modal-btn-blue:hover { background: #1d4ed8; }
.thi-modal-btn-gray { background: #6b7280; color: #fff; }
.thi-modal-btn-gray:hover { background: #4b5563; }
.thi-modal-btn-red { background: #dc2626; color: #fff; }
.thi-modal-btn-red:hover { background: #b91c1c; }

/* Exam result modal */
#examResultModal .exam-info {
    border: 2px solid #e0e0e0;
    padding: 15px;
    border-radius: 10px;
    background-color: #f5f5f5;
    margin-bottom: 16px;
}
#examResultModal .exam-info p {
    font-size: 15px;
    color: #333;
    margin: 4px 0;
}
#examResultModal .exam-info p span:first-child {
    font-weight: 700;
}
#examResultModal .score-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0;
    border: 2px solid #2563eb;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 16px;
    background: #fff;
    font-size: 15px;
}
#examResultModal .score-table th,
#examResultModal .score-table td {
    padding: 8px 12px;
    text-align: center;
    border-bottom: 1px solid #d1d5db;
    border-right: 1px solid #d1d5db;
    vertical-align: middle;
}
#examResultModal .score-table th:last-child,
#examResultModal .score-table td:last-child {
    border-right: none;
}
#examResultModal .score-table tbody tr:last-child td {
    border-bottom: none;
}
#examResultModal .score-table thead tr {
    background-color: #2563eb;
    color: #fff;
    font-weight: 700;
}
#examResultModal .score-table tbody tr:nth-child(even) {
    background-color: #f8fafc;
}
#examResultModal .score-table th:nth-child(1),
#examResultModal .score-table td:nth-child(1) {
    width: 60%;
    text-align: left;
    padding-left: 16px;
}
#examResultModal .score-table th:nth-child(2),
#examResultModal .score-table td:nth-child(2) {
    width: 40%;
}
#examResultModal .community-section {
    margin-top: 16px;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 10px;
    border: 1px solid #e0e0e0;
}
#examResultModal .community-section p {
    font-size: 14px;
    color: #333;
    line-height: 1.6;
    margin: 4px 0;
}
#examResultModal .community-section a {
    color: #2563eb;
    text-decoration: none;
    font-weight: 700;
}
#examResultModal .community-section a:hover {
    text-decoration: underline;
}

/* Link to hoc button */
#thi120 #chuyensanghoc {
    background-color: #FFD700;
    color: #000;
    border: none;
    padding: 10px 20px;
    font-size: 15px;
    font-weight: 700;
    text-align: center;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s;
    width: 100%;
}
#thi120 #chuyensanghoc:hover {
    transform: scale(1.02);
}

/* Responsive */
@media (max-width: 768px) {
    #thi120 .thi-controls {
        grid-template-columns: 1fr;
    }
    #thi120 .post-exam {
        grid-template-columns: 1fr;
    }
    #thi120 .exam-buttons {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }
}
