:root {
    --thpt-main: #0284C7;
    --thpt-dark: #1E293B;
    --thpt-accent: #0EA5E9;
    --thpt-success: #10B981;
    --thpt-danger: #EF4444;
    --bg-color: #F8FAFC;
    --border-color: #E2E8F0;
}

* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 
    -webkit-tap-highlight-color: transparent;
}

html, body { 
    width: 100vw; 
    height: 100vh; 
    overflow: hidden; 
    position: fixed; 
    background-color: var(--bg-color); 
}

.fade-in { animation: fadeIn 0.3s ease-in-out; }
@keyframes fadeIn { 
    from { opacity: 0; transform: translateY(10px); } 
    to { opacity: 1; transform: translateY(0); } 
}

/* LOADER */
#global-loader { 
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; 
    background: var(--bg-color); display: flex; justify-content: center; 
    align-items: center; z-index: 99999; font-size: 16px; font-weight: bold; 
    color: var(--thpt-main); flex-direction: column; gap: 15px;
}
.spinner { 
    width: 45px; height: 45px; border: 4px solid #e0f2fe; 
    border-top: 4px solid var(--thpt-main); border-radius: 50%; 
    animation: spin 1s linear infinite; 
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* MÀN HÌNH AUTH */
#auth-screen { 
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; 
    background: var(--bg-color); display: none; justify-content: center; 
    align-items: center; z-index: 10000; padding: 20px; overflow-y: auto;
}
.auth-wrapper { position: relative; width: 100%; max-width: 550px; display: flex; justify-content: center; align-items: center; }
.auth-card { 
    background: white; padding: 40px; border-radius: 16px; 
    box-shadow: 0 10px 40px rgba(0,0,0,0.08); width: 100%; max-width: 380px; 
    text-align: center; border: 1px solid var(--border-color); 
    position: absolute; opacity: 0; visibility: hidden; 
    transform: translateY(30px) scale(0.95); transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.auth-card.active { opacity: 1; visibility: visible; transform: translateY(0) scale(1); position: relative; z-index: 2; }
.register-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 15px; text-align: left; }
.full-width { grid-column: 1 / -1; }
.auth-card h1 { color: var(--thpt-main); font-weight: 900; margin-bottom: 5px; font-size: 28px; }
.auth-card p { color: #64748b; margin-bottom: 25px; font-size: 14px; }
.input-group { text-align: left; margin-bottom: 15px; }
.input-group label { display: block; font-size: 12px; font-weight: bold; color: var(--thpt-dark); margin-bottom: 5px; }
.password-wrapper { position: relative; display: flex; align-items: center; }
.auth-input { 
    width: 100%; padding: 12px 15px; border: 2px solid var(--border-color); 
    border-radius: 8px; outline: none; font-size: 14px; transition: 0.2s; background: #f8fafc; 
}
.auth-input::placeholder { color: #94a3b8; font-style: italic; }
.password-wrapper .auth-input { padding-right: 40px; }
.auth-input:focus { border-color: var(--thpt-main); background: white; box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.1); }
.toggle-password { position: absolute; right: 12px; cursor: pointer; font-size: 18px; user-select: none; opacity: 0.5; transition: 0.2s; }
.toggle-password:hover { opacity: 1; }
input[type="password"]::-ms-reveal, input[type="password"]::-ms-clear { display: none; }
.auth-btn { 
    width: 100%; padding: 14px; border: none; border-radius: 8px; font-weight: bold; 
    font-size: 16px; cursor: pointer; transition: 0.2s; margin-top: 10px; text-transform: uppercase; letter-spacing: 1px;
}
.btn-primary { background: var(--thpt-main); color: white; box-shadow: 0 4px 6px rgba(2, 132, 199, 0.2); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 12px rgba(2, 132, 199, 0.3); }
.auth-error { color: var(--thpt-danger); font-size: 13px; margin-bottom: 15px; display: none; font-weight: bold; background: #fef2f2; padding: 10px; border-radius: 8px; border: 1px solid #fca5a5; }
.auth-success { color: var(--thpt-success); font-size: 13px; margin-bottom: 15px; display: none; font-weight: bold; background: #ecfdf5; padding: 10px; border-radius: 8px; border: 1px solid #86efac; }
.auth-switch { margin-top: 20px; font-size: 14px; color: #64748b; }
.auth-switch span { color: var(--thpt-main); font-weight: bold; cursor: pointer; transition: 0.2s; }
.auth-switch span:hover { text-decoration: underline; }

@media (max-width: 600px) {
    .register-grid { grid-template-columns: 1fr; gap: 0; }
    .auth-card { padding: 30px 20px; max-width: 100%; border-radius: 0; border: none; box-shadow: none;}
    #auth-screen { padding: 0; background: white;}
}

/* HEADER */
header { 
    background: white; padding: 0 20px; display: flex; align-items: center; 
    border-bottom: 2px solid var(--border-color); height: 60px; justify-content: space-between; 
    z-index: 100; flex-shrink: 0; position: relative;
}
.logo-area { display: flex; align-items: center; cursor: pointer; }
header h1 { font-size: 24px; color: var(--thpt-main); font-weight: 900; letter-spacing: -1px;}
.header-right { display: flex; align-items: center; gap: 12px; }
.header-timer-box { display: none; align-items: center; background: #f1f5f9; padding: 6px 12px; border-radius: 8px; border: 1px solid #e2e8f0; }
.time-left { font-size: 16px; font-weight: bold; color: var(--thpt-main); font-variant-numeric: tabular-nums; }
.exit-btn { background: #fef2f2; color: var(--thpt-danger); border: 1px solid #fca5a5; padding: 8px 15px; border-radius: 6px; font-weight: bold; cursor: pointer; transition: 0.2s; font-size: 14px; }
.exit-btn:hover { background: var(--thpt-danger); color: white; }
.user-info { font-weight: bold; color: var(--thpt-dark); display: flex; align-items: center; gap: 15px;}
.logout-btn { background: #f1f5f9; color: #64748b; border: none; padding: 6px 12px; border-radius: 6px; cursor: pointer; font-size: 13px; font-weight: bold; transition: 0.2s;}
.logout-btn:hover { background: #fee2e2; color: var(--thpt-danger); }
.hamburger-btn { display: none; background: none; border: none; font-size: 26px; color: var(--thpt-dark); cursor: pointer; padding: 5px; }
.mobile-dropdown { display: none; position: fixed; top: 60px; right: 20px; background: white; padding: 20px; border-radius: 12px; box-shadow: 0 10px 25px rgba(0,0,0,0.15); border: 1px solid var(--border-color); z-index: 1001; flex-direction: column; width: 200px; }
.mobile-dropdown.show { display: flex; animation: fadeIn 0.2s ease-out; }
.user-name-mobile { font-weight: bold; margin-bottom: 15px; text-align: center; padding-bottom: 15px; border-bottom: 1px solid #e2e8f0; font-size: 15px;}

/* TÌM KIẾM & BỘ LỌC */
.cohort-selector { display: flex; justify-content: center; gap: 15px; margin-bottom: 30px; }
.cohort-btn { padding: 12px 35px; border-radius: 30px; font-weight: 900; font-size: 16px; border: 2px solid var(--border-color); background: white; color: #64748b; cursor: pointer; transition: all 0.3s ease; text-transform: uppercase; letter-spacing: 0.5px; }
.cohort-btn:hover { background: #f1f5f9; color: var(--thpt-dark); }
.cohort-btn.active { background: var(--thpt-main); color: white; border-color: var(--thpt-main); box-shadow: 0 6px 15px rgba(2, 132, 199, 0.35); transform: translateY(-2px); }
.banner-container { max-width: 1200px; margin: 0 auto 25px auto; background: white; border: 1px dashed #cbd5e1; border-radius: 12px; padding: 15px; text-align: center; position: relative; overflow: hidden; box-shadow: 0 2px 5px rgba(0,0,0,0.02); }
.banner-label { font-size: 11px; color: #94a3b8; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; font-weight: bold; display: block; }
.banner-content a { display: block; text-decoration: none; color: var(--thpt-main); font-weight: bold; font-size: 15px; padding: 10px; background: #f0f9ff; border-radius: 8px; transition: 0.2s; }
.banner-content a:hover { background: #e0f2fe; transform: scale(0.99); }
.search-filter-box { max-width: 1200px; margin: 0 auto 25px auto; display: flex; flex-direction: column; gap: 15px; }
.search-bar-wrapper { position: relative; width: 100%; }
.search-input { width: 100%; padding: 14px 20px 14px 45px; border: 2px solid var(--border-color); border-radius: 12px; font-size: 15px; outline: none; transition: 0.2s; background: white; box-shadow: 0 2px 4px rgba(0,0,0,0.02); font-weight: 500; }
.search-input:focus { border-color: var(--thpt-main); box-shadow: 0 4px 12px rgba(2, 132, 199, 0.1); }
.search-icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); font-size: 18px; opacity: 0.4; }
.filter-tags { display: flex; gap: 10px; flex-wrap: wrap; }
.filter-btn { padding: 8px 16px; border: 1px solid var(--border-color); background: white; border-radius: 20px; font-size: 13px; font-weight: bold; color: #64748b; cursor: pointer; transition: 0.2s; }
.filter-btn:hover { background: #f1f5f9; color: var(--thpt-dark); }
.filter-btn.active { background: var(--thpt-main); color: white; border-color: var(--thpt-main); box-shadow: 0 2px 6px rgba(2, 132, 199, 0.3); }
.empty-state { text-align: center; padding: 40px; color: #64748b; font-weight: bold; font-size: 16px; width: 100%; grid-column: 1 / -1;}

/* TRANG CHỦ (DANH SÁCH ĐỀ) */
#home-screen { display: none; height: calc(100vh - 60px); padding: 40px 20px; overflow-y: auto; background: var(--bg-color); touch-action: auto; }
.page-title { text-align: center; color: var(--thpt-dark); margin-bottom: 15px; font-size: 28px;}
.exam-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; max-width: 1200px; margin: 0 auto; padding-bottom: 40px; }
.exam-card { background: white; border-radius: 12px; padding: 20px; border: 1px solid var(--border-color); box-shadow: 0 4px 6px rgba(0,0,0,0.05); transition: 0.3s; cursor: pointer; display: flex; flex-direction: column; position: relative; }
.exam-card:hover { transform: translateY(-5px); box-shadow: 0 10px 15px rgba(0,0,0,0.1); border-color: var(--thpt-main);}
.exam-tag { background: #e0f2fe; color: var(--thpt-main); padding: 4px 10px; border-radius: 20px; font-size: 12px; font-weight: bold; align-self: flex-start; margin-bottom: 15px;}
.exam-title { font-size: 16px; font-weight: bold; color: var(--thpt-dark); margin-bottom: 15px; line-height: 1.4;}
.exam-meta { font-size: 13px; color: #64748b; margin-bottom: 15px; display: flex; justify-content: space-between;}
.start-btn { background: var(--thpt-main); color: white; border: none; padding: 10px; border-radius: 6px; font-weight: bold; width: 100%; transition: 0.2s; font-size: 14px;}
.start-btn:hover { filter: brightness(1.1); }
.action-buttons { display: flex; gap: 8px; width: 100%; }
.action-buttons button { flex: 1; padding: 10px 5px; border: none; border-radius: 6px; font-weight: bold; cursor: pointer; transition: 0.2s; font-size: 13px;}
.btn-retake { background: #fef08a; color: #ca8a04; }
.btn-history { background: #f1f5f9; color: #475569; }
.score-badge { position: absolute; top: 20px; right: 20px; background: var(--thpt-success); color: white; padding: 5px 10px; border-radius: 8px; font-weight: bold; font-size: 16px; box-shadow: 0 2px 4px rgba(16,185,129,0.3);}

/* KHÔNG GIAN LÀM BÀI PDF */
#exam-workspace { display: none; width: 100vw; height: calc(100vh - 60px); overflow: hidden; background: #e2e8f0; position: relative; }
.left-panel { flex: 1; display: flex; flex-direction: column; position: relative; background: #e2e8f0; height: 100%; overflow: hidden;}
.toolbar-wrapper { position: absolute; top: 0; left: 0; width: 100%; z-index: 20; transform: translateY(0); transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
.toolbar-wrapper.hidden { transform: translateY(-100%); }
.pdf-toolbar { display: flex; align-items: center; gap: 10px; padding: 10px 15px; background: white; border-bottom: 1px solid var(--border-color); box-shadow: 0 2px 10px rgba(0,0,0,0.05); overflow-x: auto; white-space: nowrap; }
.pdf-toolbar::-webkit-scrollbar { display: none; }
.toolbar-toggle-container { position: absolute; bottom: -22px; left: 20px; background: white; border: 1px solid var(--border-color); border-top: none; border-radius: 0 0 10px 10px; width: 50px; height: 22px; display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 4px 6px rgba(0,0,0,0.05); z-index: 21; }
.toggle-arrow { font-size: 10px; color: var(--thpt-main); transition: transform 0.3s ease; }
.toolbar-wrapper.hidden .toggle-arrow { transform: rotate(180deg); }
.tool-btn { padding: 6px 12px; border: 1px solid transparent; border-radius: 6px; font-weight: bold; cursor: pointer; font-size: 13px; transition: 0.2s; background: white; color: #475569; display: flex; align-items: center; gap: 5px; flex-shrink: 0; }
.tool-btn:hover { background: #f1f5f9; }
.tool-btn.active { background: #e0f2fe; color: var(--thpt-main); border-color: var(--thpt-accent); }
.tool-btn.eraser-active { background: #fee2e2; color: var(--thpt-danger); border-color: #fca5a5; }
.tool-group { display: flex; align-items: center; gap: 8px; flex-shrink: 0;}
.color-swatch { width: 22px; height: 22px; border-radius: 50%; cursor: pointer; border: 2px solid transparent; transition: 0.2s; flex-shrink: 0;}
.color-swatch.active { transform: scale(1.2); border-color: #94a3b8; box-shadow: 0 0 0 2px white inset;}
.brush-controls { display: flex; align-items: center; gap: 6px; flex-shrink: 0;}
#brush-size { width: 80px; cursor: pointer; accent-color: var(--thpt-main);}
.btn-action-sm { padding: 6px 10px; border: 1px solid #e2e8f0; border-radius: 6px; font-weight: bold; cursor: pointer; font-size: 13px; transition: 0.2s; background: white; color: #475569; flex-shrink: 0;}
.btn-action-sm:hover { background: #f8fafc; }
.btn-undo { display: flex; align-items: center; gap: 5px; margin-left: auto;}
.btn-clear { color: var(--thpt-danger); border-color: transparent;}
#pdf-render-wrapper { flex: 1; overflow: auto; position: relative; background: #e2e8f0; overscroll-behavior: none; -webkit-overflow-scrolling: touch; padding-top: 60px; transition: padding-top 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
#pdf-render-wrapper.toolbar-closed { padding-top: 20px; }
#pdf-zoom-container { position: relative; }
#pdf-scroll-content { position: absolute; top: 0; left: 0; transform-origin: top left; }
.pdf-page-canvas { display: block; background: white; box-shadow: 0 10px 25px rgba(0,0,0,0.1); border-bottom: 2px solid var(--border-color); pointer-events: none; margin: 0 auto; }
.pdf-canvas-layer { position: absolute; top: 0; left: 0; mix-blend-mode: multiply; }
#static-layer { z-index: 4; pointer-events: none; } 
#draw-layer { z-index: 5; touch-action: none; pointer-events: auto; } 
.zoom-controls { position: fixed; bottom: 25px; left: 20px; background: rgba(255, 255, 255, 0.95); padding: 8px 12px; border-radius: 10px; box-shadow: 0 4px 15px rgba(0,0,0,0.15); display: flex; align-items: center; gap: 10px; z-index: 20; border: 1px solid var(--border-color); backdrop-filter: blur(5px); }
.zoom-btn { background: #f1f5f9; border: none; width: 28px; height: 28px; border-radius: 6px; font-weight: bold; cursor: pointer; color: var(--thpt-dark); transition: 0.2s;}
.zoom-btn:hover { background: #e2e8f0; }
#zoom-text { font-size: 13px; font-weight: bold; color: var(--thpt-dark); width: 45px; text-align: center; user-select: none;}

/* BẢNG ĐIỀN ĐÁP ÁN BÊN PHẢI */
.right-panel { width: 450px; flex-shrink: 0; display: flex; flex-direction: column; background: white; border-left: 2px solid var(--border-color); z-index: 1000; height: 100%; }
.timer-header { display: flex; justify-content: space-between; align-items: center; background: white; padding: 15px 20px; border-bottom: 1px solid var(--border-color); box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05); z-index: 11; flex-shrink: 0;}
.submit-btn { background: var(--thpt-success); color: white; border: none; padding: 10px 15px; border-radius: 6px; cursor: pointer; font-weight: bold; font-size: 14px; transition: 0.2s; box-shadow: 0 4px 6px rgba(16, 185, 129, 0.2); white-space: nowrap;}
.btn-close-panel { display: none; background: #f1f5f9; border: none; padding: 8px 12px; border-radius: 6px; font-weight: bold; color: #475569; cursor: pointer; font-size: 13px;}
#sheets-container { flex: 1; overflow-y: auto; padding: 20px; background: #f8fafc; touch-action: auto;}
.section-title { font-weight: 900; color: var(--thpt-main); padding: 15px 0 10px; border-bottom: 2px solid #cbd5e1; margin-bottom: 15px; font-size: 14px; text-transform: uppercase; letter-spacing: 0.5px;}
.section-title:first-child { padding-top: 0; }
.mcq-grid, .tf-grid-compact, .short-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.q-compact-row { background: white; border: 1px solid var(--border-color); border-radius: 8px; padding: 10px; display: flex; align-items: center; flex-wrap: wrap; box-shadow: 0 1px 2px rgba(0,0,0,0.02);}
.q-compact-num { font-weight: bold; color: var(--thpt-dark); font-size: 13px; width: 50px; }
.mcq-options.compact { display: flex; gap: 4px; flex: 1; justify-content: flex-end;}
.mcq-label { cursor: pointer; display: inline-block; }
.mcq-label input { display: none; } 
.mcq-box.round { display: flex; align-items: center; justify-content: center; width: 26px; height: 26px; border: 1px solid #cbd5e1; border-radius: 50%; font-size: 12px; font-weight: bold; transition: all 0.2s ease; color: #475569; background: white;}
.mcq-label:hover .mcq-box { border-color: var(--thpt-main); color: var(--thpt-main); background: #f0f9ff;}
.mcq-label input:checked + .mcq-box { background: var(--thpt-main); border-color: var(--thpt-main); color: white; }
.tf-block { flex-direction: column; align-items: flex-start; }
.tf-items { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.tf-item-row { display: flex; align-items: center; justify-content: space-between; width: 100%; background: #f8fafc; padding: 4px 8px; border-radius: 6px; border: 1px solid #f1f5f9;}
.tf-item-label { font-weight: bold; font-size: 13px; color: #475569;}
.tf-label { cursor: pointer; display: inline-block; }
.tf-label input { display: none; }
.tf-box.small { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 26px; border: 1px solid #cbd5e1; border-radius: 6px; font-weight: bold; font-size: 12px; color: #64748b; background: white; margin-left: 5px;}
.tf-label input:checked + .true-box { background: var(--thpt-success); border-color: var(--thpt-success); color: white; }
.tf-label input:checked + .false-box { background: var(--thpt-danger); border-color: var(--thpt-danger); color: white; }
.short-block { flex-direction: column; align-items: flex-start; }
.short-answer-input.compact { width: 100%; padding: 8px 12px; border: 1px solid #cbd5e1; border-radius: 6px; font-size: 14px; outline: none; font-weight: bold; margin-top: 5px;}

/* BẢNG KẾT QUẢ */
#summary-screen { display: none; padding: 20px; text-align: center; overflow-y: auto; height: 100%;}
.summary-card { background: white; border: 1px solid var(--border-color); border-radius: 12px; padding: 30px 20px; box-shadow: 0 10px 15px -3px rgba(0,0,0,0.05); }
.final-score { font-size: 60px; font-weight: 900; color: var(--thpt-danger); line-height: 1; margin: 15px 0;}
.stat-row { display: flex; justify-content: space-between; padding: 12px; border-bottom: 1px solid #f1f5f9; font-size: 14px;}
.result-feedback { width: 100%; margin-top: 8px; }
.correct-text { color: var(--thpt-success); font-weight: bold; font-size: 12px; display: block; background: #ecfdf5; padding: 6px; border-radius: 6px; border: 1px solid #a7f3d0;}
.wrong-bg { background-color: #fef2f2 !important; border-color: #fca5a5 !important; }
.correct-bg { background-color: #f0fdf4 !important; border-color: #86efac !important; }

/* MODALS - CHUNG CẢ HAI LOẠI */
.modal-overlay { 
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; 
    background: rgba(15, 23, 42, 0.6); z-index: 99999; display: none; 
    justify-content: center; align-items: center; opacity: 0; 
    transition: opacity 0.3s ease; padding: 20px; backdrop-filter: blur(4px);
}
.modal-overlay.show { display: flex; opacity: 1; }
.custom-modal-content { background: white; padding: 30px 25px; border-radius: 16px; width: 100%; max-width: 400px; text-align: center; box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25); transform: scale(0.9); transition: transform 0.3s ease;}
.modal-overlay.show .custom-modal-content { transform: scale(1); }
.modal-title { font-size: 20px; font-weight: 900; color: var(--thpt-dark); margin-bottom: 15px; }
.modal-msg { font-size: 14px; color: #64748b; line-height: 1.5; margin-bottom: 25px; }
.modal-actions { display: flex; gap: 10px; justify-content: center; }
.btn-cancel, .btn-confirm { padding: 10px 15px; border: none; border-radius: 8px; font-weight: bold; cursor: pointer; font-size: 14px; flex: 1;}
.btn-cancel { background: #f1f5f9; color: #475569; }
.btn-confirm { background: var(--thpt-main); color: white; }
.btn-confirm.danger { background: var(--thpt-danger); }
.history-list { max-height: 250px; overflow-y: auto; text-align: left; margin-bottom: 20px; padding-right: 5px; }
.history-item { display: flex; justify-content: space-between; align-items: center; padding: 12px 5px; border-bottom: 1px solid var(--border-color); }
.history-info { display: flex; flex-direction: column; gap: 2px; }
.h-attempt { font-weight: bold; color: var(--thpt-dark); font-size: 14px; }
.h-date { font-size: 11px; color: #64748b; }
.h-score { font-size: 16px; font-weight: 900; color: var(--thpt-success); }
.btn-review-sm { background: #e0f2fe; color: var(--thpt-main); border: none; padding: 6px 10px; border-radius: 6px; font-weight: bold; font-size: 12px; }

/* MODAL THÔNG BÁO TÙY CHỈNH (thay cho alert) */
.modal-box {
    background: #ffffff; padding: 28px 24px; border-radius: 16px; max-width: 380px; width: 90%; text-align: center;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    transform: scale(0.85); transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.modal-overlay.show .modal-box { transform: scale(1); }
.modal-box h3 { margin-top: 8px; color: #1e293b; font-size: 20px; font-weight: 700; }
.modal-box p { color: #475569; margin: 12px 0 20px 0; font-size: 15px; line-height: 1.5; }
#notif-close-btn {
    background: var(--thpt-main); color: #ffffff; border: none; padding: 10px 28px; border-radius: 8px; font-size: 15px; font-weight: 600; cursor: pointer; transition: all 0.2s; width: 100%;
}
#notif-close-btn:hover { background: #0369a1; }

/* MENU AVATAR & DROPDOWN */
.user-profile-dropdown { position: relative; display: inline-block; }
.avatar-trigger { display: flex; align-items: center; gap: 8px; padding: 5px 12px; background: #f1f5f9; border: 1px solid var(--border-color); border-radius: 25px; cursor: pointer; transition: all 0.2s ease; user-select: none; }
.avatar-trigger:hover { background: #e0f2fe; border-color: var(--thpt-main); }
.avatar-circle { width: 32px; height: 32px; background: var(--thpt-main); color: white; font-weight: 900; font-size: 14px; border-radius: 50%; display: flex; align-items: center; justify-content: center; text-transform: uppercase; box-shadow: 0 2px 4px rgba(2, 132, 199, 0.2); }
.user-name-text { font-weight: 700; color: var(--thpt-dark); font-size: 14px; max-width: 110px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dropdown-arrow { font-size: 10px; color: #64748b; transition: transform 0.2s ease; }
.user-profile-dropdown.open .dropdown-arrow { transform: rotate(180deg); }
.profile-dropdown-menu { position: absolute; top: calc(100% + 8px); right: 0; width: 240px; background: white; border: 1px solid var(--border-color); border-radius: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12); display: none; flex-direction: column; padding: 8px 0; z-index: 1002; animation: fadeIn 0.2s ease-out; }
.profile-dropdown-menu.show { display: flex; }
.dropdown-user-header { display: flex; align-items: center; gap: 12px; padding: 12px 16px; }
.avatar-circle-lg { width: 40px; height: 40px; background: var(--thpt-main); color: white; font-weight: 900; font-size: 18px; border-radius: 50%; display: flex; align-items: center; justify-content: center; text-transform: uppercase; flex-shrink: 0; }
.dropdown-user-details { overflow: hidden; }
.dropdown-username { font-weight: 800; color: var(--thpt-dark); font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dropdown-user-email { font-size: 12px; color: #64748b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dropdown-divider { height: 1px; background: #e2e8f0; margin: 6px 0; }
.dropdown-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 16px; border: none; background: transparent; color: var(--thpt-dark); font-weight: 600; font-size: 14px; cursor: pointer; text-align: left; transition: background 0.2s ease; }
.dropdown-item:hover { background: #f1f5f9; }
.dropdown-item.danger { color: var(--thpt-danger); }
.dropdown-item.danger:hover { background: #fef2f2; }
.dropdown-icon { font-size: 16px; }

/* HỒ SƠ MODAL */
.profile-modal-content { max-width: 420px; text-align: left; position: relative; }
.modal-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border-color); padding-bottom: 12px; margin-bottom: 20px; }
.modal-header h2 { font-size: 18px; font-weight: 900; color: var(--thpt-main); margin: 0; }
.close-modal-btn { background: #f1f5f9; border: none; width: 28px; height: 28px; border-radius: 50%; font-weight: bold; color: #64748b; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: 0.2s; }
.close-modal-btn:hover { background: #fee2e2; color: var(--thpt-danger); }
.profile-card-body { display: flex; flex-direction: column; align-items: center; }
.profile-avatar-big { width: 70px; height: 70px; background: linear-gradient(135deg, var(--thpt-main), var(--thpt-accent)); color: white; font-size: 32px; font-weight: 900; border-radius: 50%; display: flex; align-items: center; justify-content: center; text-transform: uppercase; box-shadow: 0 6px 15px rgba(2, 132, 199, 0.3); margin-bottom: 12px; }
.profile-card-body h3 { font-size: 20px; font-weight: 800; color: var(--thpt-dark); margin-bottom: 2px; }
.profile-school-text { font-size: 13px; color: #64748b; margin-bottom: 20px; font-weight: 600; }
.profile-info-list { width: 100%; background: #f8fafc; border: 1px solid var(--border-color); border-radius: 10px; padding: 10px 15px; }
.profile-info-item { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid #e2e8f0; font-size: 14px; }
.profile-info-item:last-child { border-bottom: none; }
.info-label { color: #64748b; font-weight: 600; }
.info-value { color: var(--thpt-dark); font-weight: 700; }

/* RESPONSIVE */
@media (max-width: 1350px) { .ad-banner-side { display: none !important; } }
@media (max-width: 1024px) {
    .right-panel { position: fixed; top: 0; right: -100%; width: 400px; max-width: 90%; height: 100%; transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1); box-shadow: -5px 0 25px rgba(0,0,0,0.2); z-index: 1000; }
    .right-panel.open { right: 0; }
    .btn-close-panel { display: block; } 
    .mobile-fab { display: flex; } 
    .mcq-grid, .tf-grid-compact, .short-grid { grid-template-columns: 1fr; }
}
@media (max-width: 767px) {
    header h1 { font-size: 20px; }
    .header-right { gap: 5px; }
    .exit-btn { font-size: 12px; padding: 6px 10px; }
    .header-timer-box { padding: 6px 8px; }
    .time-left { font-size: 14px; }
    .zoom-controls { display: none !important; }
    .ad-popup-corner { width: calc(100% - 40px); bottom: 10px; }
}

/* QUẢNG CÁO */
.ad-banner-side { position: fixed; top: 120px; width: 160px; height: 600px; background: #f8fafc; border: 2px dashed #cbd5e1; z-index: 90; display: flex; align-items: center; justify-content: center; text-align: center; color: #94a3b8; font-size: 13px; font-weight: bold; border-radius: 8px; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05); transition: 0.3s; }
.ad-left { left: 15px; }
.ad-right { right: 15px; }
.ad-popup-corner { position: fixed; bottom: 20px; right: 20px; width: 320px; background: white; border: 1px solid #e2e8f0; border-radius: 12px; box-shadow: 0 15px 35px rgba(0,0,0,0.2); z-index: 100; overflow: hidden; animation: slideUpAd 0.6s cubic-bezier(0.16, 1, 0.3, 1); }
.ad-popup-header { background: #f1f5f9; color: #475569; padding: 8px 15px; font-size: 11px; font-weight: bold; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #e2e8f0; }
.ad-popup-close { background: #e2e8f0; border: none; color: #64748b; font-weight: bold; cursor: pointer; width: 20px; height: 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 10px; transition: 0.2s; }
.ad-popup-close:hover { background: #ef4444; color: white; }
.ad-popup-content { padding: 15px; text-align: center; }
.ad-popup-content img { max-width: 100%; border-radius: 8px; cursor: pointer; }
@keyframes slideUpAd { from { bottom: -200px; opacity: 0; transform: scale(0.9); } to { bottom: 20px; opacity: 1; transform: scale(1); } }
