/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #333;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== MOBILE TOPBAR (HAMBURGER) ===== */
.topbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background: linear-gradient(135deg, #1a237e, #283593);
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px;
    z-index: 10000;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    border-bottom: 3px solid #3949ab;
}

.hamburger-menu {
    background: none;
    border: none;
    color: white;
    font-size: 1.8rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 5px;
    transition: all 0.3s ease;
    display: none;
    min-width: 44px;
    min-height: 44px;
}

.hamburger-menu:hover {
    background: rgba(255,255,255,0.1);
}

.mobile-controls {
    display: none;
    position: fixed;
    top: 60px;
    left: 0;
    width: 100%;
    background: linear-gradient(135deg, #1a237e, #283593);
    z-index: 10001;
    padding: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    border-top: 1px solid rgba(255,255,255,0.1);
    flex-direction: column;
    gap: 10px;
    max-height: 80vh;
    overflow-y: auto;
}

.mobile-controls.active {
    display: flex;
}

.mobile-topbar-actions {
    display: none;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

#mobileLoginBtn, 
#mobileExamSelect {
    padding: 8px 12px !important;
    border: none;
    border-radius: 8px;
    background: rgba(255,255,255,0.15);
    color: white;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    min-height: 40px;
    min-width: 44px;
}

#mobileLoginBtn:hover, 
#mobileExamSelect:hover {
    background: rgba(255,255,255,0.25);
}

#mobileExamSelect option {
    background: #283593;
    color: white;
}

/* ===== TOPBAR DESKTOP ===== */
.desktop-controls select,
.desktop-controls button {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    background: rgba(255,255,255,0.15);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    border: 1px solid rgba(255,255,255,0.1);
}

.desktop-controls select:hover,
.desktop-controls button:hover {
    background: rgba(255,255,255,0.25);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.desktop-controls select option {
    background: #283593;
    color: white;
}

/* ===== SCROLL PROGRESS ===== */
.scroll-progress {
    position: fixed;
    top: 60px;
    left: 0;
    width: 100%;
    height: 3px;
    background: #e0e0e0;
    z-index: 9999;
}

.scroll-progress-bar {
    height: 100%;
    background: linear-gradient(135deg, #1a237e, #3949ab);
    width: 0%;
    transition: width 0.3s ease;
}

/* ===== PAGE CONTAINER ===== */
.page-container {
    position: fixed;
    top: 63px;
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -5px 30px rgba(0,0,0,0.1);
    overflow-y: auto;
    padding: 20px;
    z-index: 1;
}

/* ===== SLIDES CONTAINER ===== */
.slides {
    font-size: 1.4rem;
    color: #2c3e50;
    max-width: 1200px;
    margin: 0 auto;
    padding-bottom: 50px;
    line-height: 1.6;
}

/* ===== SLIDE SECTIONS ===== */
.slide-section {
    padding: 30px 40px;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #f8f9ff 0%, #eef1ff 100%);
    border-radius: 14px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
    min-height: 200px;
}

.slide-section.active-section {
    background: linear-gradient(135deg, #f0f2ff 0%, #e6e9ff 100%);
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
    border-left: 6px solid #ffd54f;
    transform: translateY(-2px);
}

.slide-section h2 {
    color: #1a237e;
    margin-bottom: 25px;
    border-bottom: 3px solid #1a237e;
    padding-bottom: 15px;
    font-weight: 700;
    font-size: 1.8rem;
}

.slide-section h3 {
    color: #3949ab;
    margin: 20px 0 15px 0;
    font-weight: 600;
    font-size: 1.4rem;
}

.slide-section p, .slide-section li {
    color: #34495e;
    line-height: 1.7;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.slide-section ul, .slide-section ol {
    margin-left: 30px;
    margin-bottom: 20px;
}

/* ===== QUESTION STYLES - TỐI ƯU TRUE/FALSE ===== */
/* ===== QUESTION STYLES ===== */
.question {
    margin: 25px 0;
    padding: 20px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9ff 100%);
    border-radius: 15px;
    border-left: 6px solid #1a237e;
    color: #2c3e50;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    transition: transform 0.3s ease;
}

.question:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}

.question-title {
    margin-bottom: 20px;
    font-weight: 700;
    color: #1a237e;
    font-size: 1.1em;
    line-height: 1.5;
}

/* ===== MULTIPLE CHOICE OPTIONS (GIỮ NGUYÊN GỐC) ===== */
.option-row {
    margin: 12px 0;
    padding: 12px 15px;
    background: rgba(255,255,255,0.9);
    border-radius: 10px;
    color: #2c3e50;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
}

.option-row:hover {
    background: rgba(255,255,255,1);
    border-color: #1a237e;
    transform: translateX(5px);
}

.option-row label {
    margin-left: 10px;
    cursor: pointer;
    font-weight: 500;
    flex: 1;
}

.option-row input[type="radio"] {
    transform: scale(1.2);
    margin-right: 8px;
    cursor: pointer;
}

/* ===== TRUE/FALSE SPECIFIC (CHỈ THÊM CHO MOBILE) ===== */
/* Style đặc biệt cho True/False - chỉ trên mobile */
@media (max-width: 768px) {
    /* Khi option-row có nhiều hơn 1 phần tử con (True/False) */
    .option-row:has(> div) {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .option-row:has(> div) > div:first-child {
        width: 100%;
        margin-bottom: 15px;
        font-size: 1.05rem;
    }
    
    .option-row:has(> div) > div:last-child {
        display: flex;
        gap: 15px;
        width: 100%;
    }
    
    .option-row:has(> div) label {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 10px 15px;
        background: white;
        border: 2px solid #ddd;
        border-radius: 8px;
        min-width: 80px;
        justify-content: center;
    }
}

/* ===== ANSWER CHECK INPUT ===== */
.answer-check {
    margin-top: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.answer-check input {
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 10px;
    background: white;
    color: #2c3e50;
    width: 250px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.answer-check input:focus {
    outline: none;
    border-color: #1a237e;
    box-shadow: 0 0 0 3px rgba(26, 35, 126, 0.1);
}

.answer-check button {
    padding: 12px 25px;
    background: linear-gradient(135deg, #1a237e, #3949ab);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.answer-check button:hover {
    background: linear-gradient(135deg, #3949ab, #1a237e);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(26, 35, 126, 0.3);
}

/* ===== SOLUTION BOX ===== */
.solution-title {
    color: #1976d2;
    font-weight: 700;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.2rem;
}

.solution-title::before {
    content: "💡";
    font-size: 1.3em;
}

.solution-content {
    color: #1565c0;
    line-height: 1.7;
    padding: 20px;
    background: #f8f9ff;
    border-radius: 12px;
    border: 1px solid #e0e0e0;
    overflow-x: auto;
    max-width: 100%;
    word-wrap: break-word;
    font-size: 1.1rem;
}

.solution-content::-webkit-scrollbar {
    height: 6px;
}

.solution-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.solution-content::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.solution-content::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.solution-box { 
    display: none; 
    margin-top: 20px;
}

/* ===== TABLES - TĂNG KÍCH THƯỚC CHỮ ===== */
.table-container {
    max-height: 60vh;
    overflow-y: auto;
    border-radius: 15px;
    border: 2px solid #f0f0f0;
    position: relative;
    margin: 20px 0;
}

.table-container::-webkit-scrollbar {
    width: 8px;
}

.table-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.table-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 10px;
}

.table-container::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 16px; /* Tăng kích thước chữ */
}

th, td {
    padding: 18px 20px; /* Tăng padding */
    border: 1px solid #e0e0e0;
    text-align: left;
    color: #333;
    line-height: 1.6; /* Tăng line-height */
}

th {
    background: linear-gradient(135deg, #1a237e, #3949ab);
    color: white;
    position: sticky;
    top: 0;
    font-weight: 600;
    font-size: 17px; /* Tiêu đề lớn hơn */
    z-index: 10;
}

tr:nth-child(even) {
    background: #f8f9ff;
}

tr:hover {
    background: #e8eaff;
    transition: all 0.2s ease;
}

/* Cell chứa số liệu thống kê */
.stats-cell {
    font-size: 17px !important;
    font-weight: 600 !important;
    color: #1a237e !important;
}

/* ===== SLIDE MENU ===== */
.slide-menu {
    position: fixed;
    top: 0;
    left: -400px;
    width: 400px;
    height: 100vh;
    background: linear-gradient(135deg, #1a237e 0%, #283593 100%);
    z-index: 11000;
    transition: left 0.4s ease;
    box-shadow: 5px 0 25px rgba(0,0,0,0.3);
    color: white;
}

.slide-menu.active {
    left: 0;
}

.menu-header {
    padding: 25px;
    background: rgba(0,0,0,0.2);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid rgba(255,255,255,0.1);
}

.menu-header h3 {
    color: white;
    margin: 0;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.close-btn:hover {
    background: rgba(255,255,255,0.1);
}

.menu-content {
    padding: 20px;
    height: calc(100% - 80px);
    overflow-y: auto;
}

.slide-item {
    padding: 15px 20px;
    margin-bottom: 10px;
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
    border: 1px solid rgba(255,255,255,0.1);
    font-size: 1rem;
}

.slide-item:hover {
    background: rgba(255,255,255,0.2);
    transform: translateX(10px);
}

.slide-item.active {
    background: rgba(255,255,255,0.25);
    border-left: 5px solid #ffd54f;
    font-weight: 600;
}

.slide-number {
    display: inline-block;
    width: 35px;
    height: 35px;
    text-align: center;
    line-height: 35px;
    margin-right: 15px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    font-weight: bold;
}

.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 10500;
    display: none;
    backdrop-filter: blur(5px);
}

.menu-overlay.active {
    display: block;
}

/* ===== MODAL SYSTEM ===== */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 12000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    color: #333;
    padding: 30px;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.2);
    animation: modalAppear 0.4s ease;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

@keyframes modalAppear {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(-50px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ===== NOTIFICATION SYSTEM ===== */
.notification {
    position: fixed;
    top: 70px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 10px;
    color: white;
    font-weight: 600;
    z-index: 100000;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    transform: translateX(400px);
    transition: transform 0.4s ease;
    font-size: 1rem;
}

.notification.show {
    transform: translateX(0);
}

/* ===== RESPONSIVE DESIGN - TỐI ƯU MOBILE ===== */
@media (max-width: 1024px) {
    .slides {
        font-size: 1.3rem !important;
    }
    .slide-section {
        padding: 20px 25px !important;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .topbar {
        height: 60px;
        padding: 0 15px;
    }
    
    .hamburger-menu {
        display: block !important;
    }
    
    .mobile-topbar-actions {
        display: flex !important;
    }
    
    .desktop-controls {
        display: none !important;
    }
    
    .page-container {
        top: 63px;
        padding: 15px;
        border-radius: 0;
    }
    
    .scroll-progress {
        top: 60px;
    }
    
    .slide-section {
        padding: 20px !important;
        margin-bottom: 15px;
        border-radius: 12px;
    }
    
    .slide-section h2 {
        font-size: 1.4rem;
        margin-bottom: 15px;
    }
    
    .slide-section h3 {
        font-size: 1.2rem;
        margin: 15px 0 10px;
    }
    
    /* TỐI ƯU TRUE/FALSE CHO MOBILE */
    .option-row {
        flex-direction: column !important;
        align-items: flex-start !important;
        padding: 15px !important;
    }
    
    .option-row > div:first-child {
        width: 100% !important;
        margin-bottom: 15px !important;
        font-size: 1.05rem !important;
        min-width: unset !important;
    }
    
    .option-row > div:last-child {
        justify-content: flex-start !important;
        width: 100% !important;
        gap: 15px !important;
        min-width: unset !important;
    }
    
    .option-row label {
        min-width: 80px !important;
        padding: 10px 15px !important;
        font-size: 0.95rem !important;
    }
    
    /* QUESTION OPTIMIZATION */
    .question {
        padding: 20px !important;
        margin: 20px 0;
    }
    
    .question-title {
        font-size: 1.1rem;
    }
    
    /* ANSWER CHECK - TỐI ƯU CHO MOBILE */
    .answer-check {
        flex-direction: column !important;
        gap: 12px !important;
        margin-top: 20px !important;
    }
    
    .answer-check input {
        width: 100% !important;
        min-width: unset !important;
        padding: 14px !important;
        font-size: 16px !important;
    }
    
    .answer-check button {
        width: 100% !important;
        padding: 16px !important;
        font-size: 1.1rem !important;
    }
    
    /* TABLES - TĂNG CHỮ CHO MOBILE */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        font-size: 15px;
    }
    
    table {
        font-size: 15px !important;
        min-width: unset !important;
    }
    
    th, td {
        padding: 14px 16px !important;
        font-size: 15px !important;
    }
    
    th {
        font-size: 16px !important;
        padding: 16px !important;
    }
    
    .stats-cell {
        font-size: 16px !important;
    }
    
    /* SLIDE MENU */
    .slide-menu { 
        width: 85vw !important;
        max-width: 320px;
        left: -85vw;
    }
    
    .slide-item {
        padding: 14px 16px;
        font-size: 1rem;
    }
    
    /* SOLUTION */
    .solution-content {
        font-size: 1rem;
        padding: 16px;
    }
}

/* Small phones */
@media (max-width: 480px) {
    .topbar-title {
        font-size: 1rem;
    }
    
    .slides {
        font-size: 1.1rem !important;
    }
    
    .slide-section h2 {
        font-size: 1.3rem;
    }
    
    /* TRUE/FALSE EVEN SMALLER */
    .option-row > div:last-child {
        gap: 10px !important;
    }
    
    .option-row label {
        min-width: 70px !important;
        padding: 8px 12px !important;
        font-size: 0.9rem !important;
    }
    
    /* TABLES - HIỆN ÍT CỘT HƠN */
    .table-container {
        font-size: 14px;
    }
    
    table {
        font-size: 14px !important;
    }
    
    th, td {
        padding: 12px 10px !important;
        font-size: 14px !important;
    }
    
    /* Ẩn cột không quan trọng trên mobile rất nhỏ */
    .mobile-hide {
        display: none !important;
    }
    
    /* Giảm khoảng cách */
    .question {
        padding: 18px !important;
        margin: 15px 0 !important;
    }
}

/* Mobile gestures */
@media (hover: none) and (pointer: coarse) {
    button, 
    .option-row label,
    .slide-item {
        min-height: 44px !important;
    }
    
    .option-row:active,
    .slide-item:active,
    button:active {
        opacity: 0.7;
        transform: scale(0.98) !important;
    }
    
    .option-row:hover {
        transform: none !important;
        background: inherit !important;
    }
    
    /* Tăng kích thước touch target cho radio */
    input[type="radio"] {
        width: 24px !important;
        height: 24px !important;
    }
}

/* Landscape mode */
@media (max-height: 500px) and (orientation: landscape) {
    .topbar {
        height: 50px;
    }
    
    .page-container {
        top: 53px;
    }
    
    .scroll-progress {
        top: 50px;
    }
    
    /* Trong landscape, true/false có thể nằm ngang với câu hỏi */
    .option-row {
        flex-direction: row !important;
        align-items: center !important;
    }
    
    .option-row > div:first-child {
        margin-bottom: 0 !important;
        min-width: 200px !important;
    }
    
    .option-row > div:last-child {
        min-width: 150px !important;
    }
}

/* Safe area for iPhone */
@supports (padding: max(0px)) {
    .topbar,
    .page-container {
        padding-left: max(15px, env(safe-area-inset-left));
        padding-right: max(15px, env(safe-area-inset-right));
    }
    
    .topbar {
        padding-top: max(5px, env(safe-area-inset-top));
    }
    
    .page-container {
        padding-bottom: max(20px, env(safe-area-inset-bottom));
    }
}

/* Table responsive */
.table-responsive {
    overflow-x: auto;
    width: 100%;
    margin: 20px 0;
    -webkit-overflow-scrolling: touch;
}

.table-responsive table {
    width: 100%;
    border-collapse: collapse;
    font-size: 16px; /* Tăng kích thước chữ */
}

.table-responsive th,
.table-responsive td {
    border: 1px solid #ddd;
    padding: 14px 16px; /* Tăng padding */
    text-align: left;
    vertical-align: top;
    font-size: 15px; /* Tăng font-size */
}

.table-responsive th {
    background-color: #f8f9fa;
    font-weight: 600;
    font-size: 16px; /* Tiêu đề lớn hơn */
    color: #1a237e;
}

/* ===== CÁC STYLE KHÁC TỪ FILE GỐC - GIỮ NGUYÊN ===== */
.modal-content-scrollable {
    max-width: 900px;
    display: flex;
    flex-direction: column;
    max-height: 85vh;
    overflow-y: hidden;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: #f0f0f0;
    color: #333;
}

/* ===== CANVAS DRAWING ===== */
#drawCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9000;
    display: none;
    pointer-events: none;
    background: transparent;
}

.toolbar {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.9);
    padding: 15px 25px;
    border-radius: 15px;
    display: none;
    align-items: center;
    gap: 15px;
    z-index: 9100;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1);
}

.toolbar select,
.toolbar input,
.toolbar button {
    padding: 8px 15px;
    border: none;
    border-radius: 8px;
    background: white;
    color: #333;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.toolbar select:hover,
.toolbar input:hover,
.toolbar button:hover {
    background: #f0f0f0;
    transform: translateY(-2px);
}

.toolbar input[type="color"] {
    padding: 4px;
    height: 40px;
    width: 60px;
}

.toolbar input[type="range"] {
    width: 100px;
}

/* ===== TEACHER MONITOR ===== */
#teacher-monitor {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 25px 80px rgba(0,0,0,0.3);
    z-index: 20000;
    width: 95vw;
    height: 85vh;
    overflow: auto;
    color: #333;
    border: 1px solid rgba(255,255,255,0.2);
}

/* ===== FIREBASE STATUS ===== */
.firebase-status {
    position: fixed;
    top: 65px;
    right: 15px;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    z-index: 10001;
    font-weight: 600;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
}

.firebase-connected {
    background: rgba(40, 167, 69, 0.9);
    color: white;
}

.firebase-disconnected {
    background: rgba(220, 53, 69, 0.9);
    color: white;
}

.notification.success {
    background: linear-gradient(135deg, #28a745, #20c997);
}

.notification.error {
    background: linear-gradient(135deg, #dc3545, #c82333);
}

.notification.warning {
    background: linear-gradient(135deg, #ffc107, #e0a800);
    color: #000;
}

.notification.info {
    background: linear-gradient(135deg, #17a2b8, #138496);
}

/* ===== CONFIRM MODAL ===== */
.confirm-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 13000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.confirm-modal.active {
    display: flex;
}

.confirm-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.confirm-content h3 {
    color: #1a237e;
    margin-bottom: 15px;
}

.confirm-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

.confirm-buttons button {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.confirm-yes {
    background: #dc3545;
    color: white;
}

.confirm-no {
    background: #6c757d;
    color: white;
}

.confirm-yes:hover {
    background: #c82333;
    transform: translateY(-2px);
}

.confirm-no:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

/* ===== BUTTON VISIBILITY BY ROLE ===== */
body.student-role #classManagementBtn,
body.student-role #teacherMonitorBtn,
body.student-role #create-class-btn,
body.student-role #assign-student-btn-main,
body.student-role #view-student-codes-btn {
    display: none !important;
}

body.teacher-role #classManagementBtn,
body.teacher-role #teacherMonitorBtn,
body.teacher-role #create-class-btn,
body.teacher-role #assign-student-btn-main,
body.teacher-role #view-student-codes-btn {
    display: inline-block !important;
}

/* ===== DARK MODE ===== */
.dark-mode body,
.dark-mode .page-container {
    background: #000 !important;
    color: #fff !important;
}

.dark-mode .slide-section {
    background: rgba(20, 20, 20, 0.9) !important;
    color: #fff !important;
    border-left: 6px solid #00bcd4 !important;
}

.dark-mode .slide-section h1,
.dark-mode .slide-section h2,
.dark-mode .slide-section h3,
.dark-mode .slide-section p,
.dark-mode .slide-section li,
.dark-mode .slide-section strong {
    color: #fff !important;
    font-weight: 700 !important;
}

.dark-mode .question {
    background: rgba(20, 20, 20, 0.9) !important;
    color: #fff !important;
    border-left: 6px solid #00bcd4 !important;
}

.dark-mode .option-row {
    background: rgba(40,40,40,0.9) !important;
    color: #fff !important;
    border: 1px solid #555 !important;
}

.dark-mode .option-row:hover {
    background: rgba(80,80,80,1) !important;
}

.dark-mode .topbar {
    background: linear-gradient(135deg, #000, #333) !important;
}

.dark-mode .topbar-controls button {
    background: rgba(255,255,255,0.15) !important;
    color: #fff !important;
}

.dark-mode .slide-menu {
    background: #111 !important;
}

.dark-mode .MathJax {
    color: #fff !important;
}

.dark-mode #toggleStyleBtn {
    background: linear-gradient(135deg, #4caf50, #2e7d32) !important;
    color: #fff !important;
}

/* ===== TABLES IN DARK MODE ===== */
.dark-mode .slide-section table {
    background: #000 !important;
    color: #fff !important;
}

.dark-mode .slide-section table th {
    background: linear-gradient(135deg, #1a237e, #3949ab) !important;
    color: #fff !important;
}

.dark-mode .slide-section table td {
    background: #111 !important;
    color: #fff !important;
}

/* ===== LOGIN LOCK ===== */
.not-logged-in .page-container,
.not-logged-in .topbar-controls select,
.not-logged-in .topbar-controls button:not(#loginBtn),
.not-logged-in #scoreBtn,
.not-logged-in #studentInteractBtn,
.not-logged-in #teacherMonitorBtn,
.not-logged-in #classManagementBtn {
    pointer-events: none;
    opacity: 0.5;
}

.not-logged-in .modal,
.not-logged-in .modal-content,
.not-logged-in #login-modal,
.not-logged-in #login-modal * {
    pointer-events: auto !important;
    opacity: 1 !important;
}

.not-logged-in .slide-section {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
}

/* ===== LOADING SPINNER ===== */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #1a237e;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== FULLSCREEN STYLES ===== */
body:fullscreen .topbar,
body:-webkit-full-screen .topbar,
body:-moz-full-screen .topbar,
body:-ms-fullscreen .topbar {
    display: none;
}

body:fullscreen .page-container,
body:-webkit-full-screen .page-container,
body:-moz-full-screen .page-container,
body:-ms-fullscreen .page-container {
    top: 0;
    height: 100vh;
    border-radius: 0;
}

body:fullscreen .scroll-progress,
body:-webkit-full-screen .scroll-progress,
body:-moz-full-screen .scroll-progress,
body:-ms-fullscreen .scroll-progress {
    top: 0;
}

/* Desktop */
@media (min-width: 769px) {
    .hamburger-menu {
        display: none !important;
    }
    .mobile-controls {
        display: none !important;
    }
    .desktop-controls {
        display: flex !important;
    }
}
/* ==== KHÓA XEM LỜI GIẢI - XÓA DÒNG NÀY KHI MUỐN MỞ ==== */
button[onclick*="toggleSolution"], 
.solution-toggle-btn, 
.solution-summary { 
    display: none !important; 
}