body {
    font-family: 'M PLUS Rounded 1c', sans-serif;
    background-color: #f0f4f8;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    color: #333;
}
.container {
    background-color: white;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    padding: 30px 40px;
    width: 90%;
    max-width: 500px;
    text-align: center;
    border: 3px solid #e0e0e0;
    position: relative;
}
header h1 {
    font-size: 28px;
    font-weight: 800;
    color: #0056b3;
    margin-bottom: 5px;
}
.tagline {
    font-size: 16px;
    color: #555;
    margin-bottom: 30px;
}
/* --- Bố cục lưới cho Menu chính --- */
.main-menu {
    display: grid;
    grid-template-columns: 1fr 1fr;
    /* Tạo 2 cột bằng nhau */
    gap: 15px;
}

/* Nút bấm chung trong lưới */
.main-menu .btn {
    padding: 15px 10px;
    /* Điều chỉnh lại padding */
    font-size: 16px;
    height: 80px;
    /* Cho các nút cao bằng nhau */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

#start-fraud-check-btn {
    height: auto;
    /* Chiều cao tự động */
    flex-direction: row;
    /* Icon và chữ nằm ngang */
    gap: 10px;
}

/* --- Style màu cho các nút chính (đã sắp xếp lại) --- */

/* 1. Luyện tập chống Tin giả (Vàng cam) */
#start-practice-btn {
    background-color: #ffc107;
    color: #333;
}

#start-practice-btn:hover {
    background-color: #ffca2c;
}

/* 2. Luyện tập chống Lừa đảo (Xanh dương) */
#start-fraud-check-btn {
    background-color: #f64d4d;
    color: white;
}

#start-fraud-check-btn:hover {
    background-color: #008cff;
}

/* 3. Bài được giao (Xanh lá) */
#view-assignments-btn-student {
    background-color: #28a745;
    color: white;
}

#view-assignments-btn-student:hover {
    background-color: #2dbc4e;
}

/* 4. Kiểm tra Tin tự do (Tím) */
#start-free-check-btn {
    background-color: #6f42c1;
    color: white;
}

#start-free-check-btn:hover {
    background-color: #8358d3;
}

/* 5. Nút Tiến độ (Xám) - Nút cuối cùng, trải dài */
#show-profile-btn {
    grid-column: 1 / -1;
    /* Trải dài hết chiều rộng */
    height: auto;
    flex-direction: row;
    gap: 10px;
    background-color: #6c757d;
    color: white;
}

#show-profile-btn:hover {
    background-color: #7a848c;
}

#start-fraud-check-btn:hover {
    background-color: #8358d3;
}
.btn {
    padding: 15px 20px;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 700;
    font-family: 'M PLUS Rounded 1c', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}
#start-practice-btn {
    background-color: #ffc107;
    color: #333;
}
#start-practice-btn:hover {
    background-color: #ffca2c;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}
#view-assignments-btn-student {
    background-color: #007bff;
    color: white;
}
#view-assignments-btn-student:hover {
    background-color: #008cff;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}
#start-free-check-btn {
    background-color: #28a745;
    color: white;
}
#start-free-check-btn:hover {
    background-color: #2dbc4e;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}
#show-profile-btn {
    background-color: #6c757d;
    color: white;
}
#show-profile-btn:hover {
    background-color: #7a848c;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}
.btn-primary {
    background-color: #ffc107;
    color: #333;
}
.btn-primary:hover {
    background-color: #ffca2c;
}
.btn-secondary {
    background-color: #6c757d;
    color: white;
}
.btn-secondary:hover {
    background-color: #7a848c;
}
.progress-summary {
    display: flex;
    justify-content: space-around;
    gap: 20px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px dashed #ddd;
}
.stat-card {
    background-color: #f8f9fa;
    border-radius: 12px;
    padding: 10px 15px;
    width: 45%;
}
.stat-card p {
    margin: 0;
    font-size: 14px;
    color: #666;
}
.stat-card span {
    font-size: 20px;
    font-weight: 800;
    color: #007bff;
    display: block;
    margin: 5px 0;
}
.hidden {
    display: none !important;
}
#practice-screen h2 {
    font-size: 24px;
    color: #0056b3;
    margin-bottom: 25px;
}
.topic-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}
.btn-topic {
    background-color: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 12px;
    padding: 20px;
    font-size: 16px;
    font-weight: 700;
    font-family: 'M PLUS Rounded 1c', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
}
.btn-topic:hover {
    transform: translateY(-4px);
    border-color: #007bff;
    background-color: #e9f3ff;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.1);
}
.btn-back {
    position: absolute;
    top: 15px;
    left: 20px;
    background: none;
    border: none;
    font-size: 16px;
    font-weight: 700;
    font-family: 'M PLUS Rounded 1c', sans-serif;
    color: #555;
    cursor: pointer;
    transition: color 0.2s;
}
.btn-back:hover {
    color: #0056b3;
}
#logout-btn {
    top: 15px;
    right: 20px;
    left: auto;
}
.tab-buttons {
    display: flex;
    border: 1px solid #ddd;
    border-radius: 12px;
    margin: 20px 0;
    overflow: hidden;
}
.tab-btn {
    flex: 1;
    padding: 12px;
    background-color: #f8f9fa;
    border: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: 700;
    transition: background-color 0.2s, color 0.2s;
}
.tab-btn.active {
    background-color: #007bff;
    color: white;
}
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.auth-form input {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    font-family: 'M PLUS Rounded 1c', sans-serif;
    border-radius: 10px;
    border: 1px solid #ccc;
    box-sizing: border-box;
}
.auth-form .form-note {
    font-size: 12px;
    color: #666;
    margin: -10px 0 0 5px;
    text-align: left;
}
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.toast {
    padding: 15px 20px;
    border-radius: 8px;
    color: white;
    font-size: 16px;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transform: translateX(100%);
    animation: slideIn 0.5s forwards, fadeOut 0.5s 3s forwards;
}
.toast.success {
    background-color: #28a745;
}
.toast.error {
    background-color: #dc3545;
}
.toast.info {
    background-color: #17a2b8;
}
@keyframes slideIn {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}
@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}
.article-topic-header {
    background-color: #007bff;
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    display: inline-block;
    font-size: 14px;
    margin-bottom: 15px;
}
.article-container {
    text-align: left;
    margin-bottom: 25px;
    max-height: 50vh;
    overflow-y: auto;
    padding-right: 15px;
}
.article-container h2 {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 15px;
    color: #333;
}
.article-container img {
    width: 100%;
    border-radius: 10px;
    margin-bottom: 15px;
}
.article-container p {
    font-size: 16px;
    line-height: 1.7;
    color: #444;
}
.analysis-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px dashed #ddd;
    padding-bottom: 10px;
    margin-bottom: 20px;
}
.analysis-header h3 {
    margin: 0;
    font-size: 22px;
    color: #0056b3;
}
#question-progress {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    background-color: #e9ecef;
    padding: 5px 15px;
    border-radius: 20px;
}
.question-container {
    text-align: left;
    margin-bottom: 20px;
}
#question-text {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.6;
}
.question-hint {
    font-size: 14px;
    color: #555;
    background-color: #f8f9fa;
    border-left: 4px solid #ffc107;
    padding: 10px;
    margin-top: 10px;
    border-radius: 4px;
}
.answer-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}
#answer-textarea {
    width: 100%;
    min-height: 100px;
    padding: 12px;
    font-size: 16px;
    font-family: 'M PLUS Rounded 1c', sans-serif;
    border-radius: 10px;
    border: 1px solid #ccc;
    box-sizing: border-box;
    resize: vertical;
}
.analysis-layout {
    display: flex;
    gap: 25px;
    width: 100%;
    max-width: 900px;
}
#analysis-screen {
    max-width: 950px;
    width: 90%;
}
.article-preview-panel {
    flex: 1;
    background-color: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #e0e0e0;
}
.article-preview-panel h4 {
    margin-top: 0;
    margin-bottom: 15px;
    border-bottom: 1px solid #ccc;
    padding-bottom: 10px;
}
.article-preview-content {
    max-height: 400px;
    overflow-y: auto;
    text-align: left;
    padding-right: 10px;
}
.article-preview-content h5 {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 10px;
}
.article-preview-content p {
    font-size: 15px;
    line-height: 1.6;
    color: #333;
}
.question-panel {
    flex: 1;
}
@media (max-width: 800px) {
    .analysis-layout {
        flex-direction: column;
    }
    #analysis-screen {
        width: 90%;
    }
    .article-preview-content {
        max-height: 200px;
    }
}
#preview-image {
    width: 100%;
    max-width: 100%;
    border-radius: 8px;
    margin-bottom: 15px;
}
#ai-feedback-container {
    margin-top: 15px;
    padding: 15px;
    border-radius: 8px;
    background-color: #e9f3ff;
    border: 1px solid #b8d8f8;
    text-align: left;
    animation: fadeIn 0.5s ease;
}
#ai-feedback-container p {
    margin: 0 0 10px 0;
    line-height: 1.6;
}
#ai-feedback-container p:last-child {
    margin-bottom: 0;
}
#ai-feedback-container .feedback-title {
    font-weight: 800;
    color: #0056b3;
    display: block;
    margin-bottom: 5px;
}
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}
.loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}
.loading::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 20px;
    height: 20px;
    margin-left: -10px;
    margin-top: -10px;
    border: 3px solid rgba(255, 255, 255, 0.5);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
#result-screen h1 {
    font-size: 32px;
}
.result-summary {
    background-color: #fff3cd;
    border: 2px solid #ffeeba;
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
}
.result-summary p {
    margin: 0;
    font-size: 16px;
}
.result-summary h2 {
    margin: 10px 0 0 0;
    font-size: 28px;
}
.verdict-low {
    color: #dc3545;
}
.result-details {
    text-align: left;
    margin-bottom: 25px;
}
.result-details p {
    font-weight: 700;
}
#signs-list {
    list-style-type: none;
    padding-left: 0;
}
#signs-list li {
    background-color: #f8f9fa;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 10px;
    font-size: 16px;
    display: flex;
    align-items: center;
}
#signs-list li::before {
    content: '❌';
    font-size: 20px;
    margin-right: 12px;
}
.result-advice {
    background-color: #e9f3ff;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 25px;
    text-align: left;
}
.result-advice h3 {
    margin-top: 0;
    color: #0056b3;
}
.performance-evaluation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}
.performance-summary {
    flex-grow: 1;
    background-color: #f8f9fa;
    border-radius: 12px;
    padding: 15px;
    text-align: center;
}
.performance-summary h3 {
    margin: 0 0 5px 0;
    font-size: 18px;
}
.performance-summary p {
    margin: 0;
    font-size: 16px;
}
#performance-score {
    font-weight: 800;
    color: #007bff;
}
.exp-gain {
    background-color: #28a745;
    color: white;
    font-size: 28px;
    font-weight: 800;
    padding: 20px 25px;
    border-radius: 12px;
    animation: popIn 0.5s ease-out forwards;
}
@keyframes popIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    80% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}
#signs-list li.all-correct::before {
    content: '✅';
}
.profile-level-card {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    padding: 20px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 20px;
    margin: 20px 0;
}
#user-level-icon {
    font-size: 50px;
}
.level-info p {
    margin: 0;
    font-size: 16px;
    opacity: 0.9;
}
.level-info h2 {
    margin: 0;
    font-size: 28px;
}
.profile-exp-bar {
    width: 100%;
    height: 20px;
    background-color: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    margin-top: 5px;
}
#exp-bar-progress {
    width: 0%;
    height: 100%;
    background-color: #ffc107;
    border-radius: 10px;
    transition: width 0.5s ease-in-out;
}
#exp-text {
    font-size: 14px;
    font-weight: 700;
    color: #555;
    text-align: right;
}
.profile-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin: 25px 0;
}
.profile-badges {
    margin-top: 20px;
    text-align: center;
}
.coming-soon {
    color: #888;
    font-style: italic;
}
#level-up-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.75);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
#level-up-screen:not(.hidden) {
    opacity: 1;
    pointer-events: auto;
}
.level-up-card {
    background-color: white;
    padding: 30px;
    border-radius: 20px;
    text-align: center;
    max-width: 500px;
    width: 90%;
    animation: zoomIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.level-up-card h1 {
    color: #007bff;
}
#level-up-meme {
    max-width: 100%;
    height: 250px;
    object-fit: contain;
    margin: 15px 0;
    border-radius: 10px;
}
.level-up-card p {
    margin: 0;
    font-size: 18px;
}
.level-up-card h2 {
    color: #28a745;
    font-size: 32px;
    margin: 5px 0 25px 0;
}
@keyframes zoomIn {
    from {
        transform: scale(0.5);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}
/* --- Khu vực Huy hiệu --- */
#badges-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    /* Giảm khoảng cách giữa các huy hiệu */
    justify-content: center;
    margin-top: 15px;
}

.badge {
    width: 70px;
    /* Giảm chiều rộng của mỗi huy hiệu */
    text-align: center;
}

.badge img {
    width: 55px;
    /* Giảm kích thước ảnh cho phù hợp */
    height: 55px;
    background-color: #f0f0f0;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.badge p {
    font-size: 12px;
    font-weight: 700;
    margin-top: 5px;
    color: #333;
}

/* Style cho huy hiệu chưa đạt được */
.badge.locked img {
    filter: grayscale(100%);
    opacity: 0.5;
}

.badge.locked p {
    color: #999;
}
#article-list-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}
.article-choice-btn {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 15px;
    font-size: 16px;
    text-align: left;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.article-choice-btn:hover {
    border-color: #007bff;
    background-color: #e9f3ff;
}
.verdict-high {
    color: #28a745;
}
.article-choice-btn {
    justify-content: space-between;
}
.completed-tag {
    background-color: #e9ecef;
    color: #6c757d;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 6px;
    white-space: nowrap;
}
#free-check-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    text-align: left;
    margin-top: 20px;
}
.form-group {
    display: flex;
    flex-direction: column;
}
.form-group label,
.custom-checkbox label {
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 6px;
    color: #333;
}
.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px;
    font-size: 16px;
    font-family: 'M PLUS Rounded 1c', sans-serif;
    border-radius: 8px;
    border: 1px solid #ccc;
    box-sizing: border-box;
}
.form-group textarea {
    resize: vertical;
}
.form-section-title {
    font-weight: 800;
    color: #0056b3;
    border-top: 1px dashed #ccc;
    padding-top: 15px;
    margin-top: 10px;
}
.form-group-inline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}
.form-group-inline .form-group {
    flex-grow: 1;
}
.custom-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 18px;
}
#fc-verified {
    width: 18px;
    height: 18px;
    accent-color: #007bff;
}
#fc-image-links-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.btn-add {
    background-color: #e9ecef;
    color: #333;
    border: 1px solid #ccc;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 10px;
    align-self: flex-start;
}
.btn-add:hover {
    background-color: #dde1e5;
}
.result-content-box {
    text-align: left;
    background-color: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
}
.result-content-box h3 {
    color: #0056b3;
    border-bottom: 1px solid #ccc;
    padding-bottom: 5px;
}
.exp-toast {
    margin-top: 20px;
    font-weight: 700;
    color: #28a745;
    background-color: #e9f7ec;
    padding: 10px;
    border-radius: 8px;
}
.form-group label:has(+ [required])::after {
    content: ' *';
    color: red;
    font-weight: bold;
}
.result-content-box ul {
    list-style: none;
    padding-left: 0;
    margin-top: 10px;
}
.result-content-box li {
    position: relative;
    padding-left: 28px;
    margin-bottom: 12px;
    line-height: 1.5;
}
.result-content-box li::before {
    position: absolute;
    left: 0;
    top: 0px;
    font-size: 18px;
}
.result-content-box .good-points li::before {
    content: '🟢';
}
.result-content-box .bad-points li::before {
    content: '🔴';
}
.daily-quest-container {
    background-color: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 15px;
    margin: 20px 0;
}
.daily-quest-container h4 {
    margin-top: 0;
    margin-bottom: 10px;
}
#daily-quest-text {
    margin: 0;
    font-size: 16px;
    min-height: 40px;
}
.quest-progress-bar {
    width: 100%;
    height: 10px;
    background-color: #e9ecef;
    border-radius: 5px;
    overflow: hidden;
    margin: 10px 0 5px 0;
}
#daily-quest-progress {
    width: 0%;
    height: 100%;
    background-color: #28a745;
    border-radius: 5px;
    transition: width 0.5s ease;
}
#daily-quest-status {
    text-align: right;
    font-size: 12px;
    font-weight: 700;
    margin: 0;
}
#bonus-exp-toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 3000;
    pointer-events: none;
}
.bonus-exp-content {
    color: #ffc107;
    font-size: 48px;
    font-weight: 800;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    animation: floatUp 2s ease-out forwards;
}
@keyframes floatUp {
    0% {
        transform: translateY(0) scale(0.5);
        opacity: 1;
    }
    100% {
        transform: translateY(-100px) scale(1.5);
        opacity: 0;
    }
}
.role-selection {
    display: flex;
    justify-content: space-around;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #ddd;
    padding: 5px;
}
.role-selection input[type="radio"] {
    display: none;
}
.role-selection label {
    flex: 1;
    text-align: center;
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 700;
    transition: all 0.2s ease;
}
.role-selection input[type="radio"]:checked+label {
    background-color: #007bff;
    color: white;
    box-shadow: 0 2px 5px rgba(0, 123, 255, 0.3);
}
#student-list-section {
    margin-top: 30px;
    text-align: left;
}
#student-list-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 15px;
}
.student-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 10px;
}
.student-name {
    font-weight: 700;
    font-size: 16px;
}
.student-level {
    font-size: 14px;
    font-weight: 700;
    color: #007bff;
    /* THÊM CÁC DÒNG NÀY */
    min-width: 280px;
    /* Tạo một "cột" có độ rộng tối thiểu */
    text-align: right;
    /* Căn phải nội dung bên trong cột đó */
    white-space: nowrap;
    /* Đảm bảo không bị xuống dòng */
}
.teacher-actions {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
}
.modal-content {
    background-color: white;
    padding: 25px;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
}
.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}
#assignment-list-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
    text-align: left;
}
.assignment-item {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 15px;
    cursor: pointer;
    transition: background-color 0.2s;
}
.assignment-item:hover {
    background-color: #e9f3ff;
}
.assignment-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.assignment-item-header p {
    font-weight: 700;
    margin: 0;
}
.assignment-status {
    font-size: 12px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 6px;
    color: white;
}
.status-todo {
    background-color: #007bff;
}
.status-submitted {
    background-color: #6c757d;
}
.status-expired {
    background-color: #dc3545;
}
.status-graded {
    background-color: #28a745;
}
.assignment-prompt {
    font-size: 14px;
    color: #555;
    margin: 0;
}
.vibrating {
    animation: vibrate 0.5s linear infinite;
}
@keyframes vibrate {
    0%,
    100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-2px);
    }
    75% {
        transform: translateX(2px);
    }
}
#submission-list-title {
    font-weight: bold;
    background-color: #f8f9fa;
    padding: 10px;
    border-radius: 8px;
}
#submission-list-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
    text-align: left;
}
.submission-item {
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 15px;
}
.submission-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    padding-bottom: 10px;
    border-bottom: 1px dashed #ccc;
    margin-bottom: 10px;
}
.submission-student-name {
    font-size: 16px;
}
.submission-time {
    font-size: 12px;
    color: #6c757d;
}
.submission-answer {
    font-size: 15px;
    line-height: 1.6;
    white-space: pre-wrap;
}
.grading-section {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}
.grading-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.grading-form .form-group {
    margin-bottom: 0;
}
.grading-form input[type="number"] {
    max-width: 100px;
}
.grading-form textarea {
    min-height: 60px;
}
.save-grade-btn {
    align-self: flex-end;
    padding: 8px 15px;
    font-size: 14px;
}
.graded-section {
    margin-top: 15px;
}
.graded-score {
    font-size: 18px;
    font-weight: 800;
    color: #28a745;
}
.graded-feedback {
    background-color: #f8f9fa;
    border-left: 4px solid #007bff;
    padding: 10px;
    margin-top: 10px;
    white-space: pre-wrap;
}
#global-tooltip {
    position: fixed;
    z-index: 2000;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 320px;
    background-color: #333;
    color: #fff;
    text-align: left;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    pointer-events: none;
    white-space: pre-wrap;
    opacity: 0;
    transition: opacity 0.2s ease;
}
#global-tooltip:not(.hidden) {
    opacity: 1;
}
#global-tooltip .tooltip-exp {
    font-weight: bold;
    color: #ffc107;
    margin-top: 10px;
    border-top: 1px dashed #777;
    padding-top: 8px;
}
.profile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}
.btn-guide {
    background-color: #e9ecef;
    color: #333;
    border: none;
    border-radius: 20px;
    padding: 8px 15px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s;
}
.btn-guide:hover {
    background-color: #dde1e5;
}
.guide-list {
    list-style: none;
    padding-left: 0;
    text-align: left;
}
.guide-list li {
    background-color: #f8f9fa;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 10px;
    line-height: 1.6;
}
.disclaimer-note {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    text-align: left;
}

/* === BẢNG XẾP HẠNG === */
.leaderboard-container {
    margin: 2rem 0;
}

#leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 1.2rem;
    border-radius: 15px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
}

.leaderboard-item:hover {
    transform: translateY(-3px);
}

.leaderboard-item.top1 {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border: 3px solid #ffd700;
}

.leaderboard-item.top2 {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    border: 3px solid #c0c0c0;
}

.leaderboard-item.top3 {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    border: 3px solid #cd7f32;
}

.rank-number {
    font-size: 2rem;
    font-weight: 800;
    color: white;
    min-width: 50px;
    text-align: center;
}

.rank-info {
    flex: 1;
    margin-left: 1rem;
}

.rank-info h3 {
    margin: 0;
    color: white;
    font-size: 1.2rem;
}

.rank-info p {
    margin: 0.3rem 0 0 0;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
}

.rank-exp {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    text-align: right;
}

.my-rank-card {
    margin-top: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    text-align: center;
    color: white;
}

.my-rank-card h3 {
    margin-top: 0;
    font-size: 1.3rem;
}

#my-rank-info {
    display: flex;
    justify-content: space-around;
    margin-top: 1rem;
}

#my-rank-info p {
    font-size: 1.1rem;
}

#my-rank-number {
    font-size: 2rem;
    font-weight: 800;
    color: #ffd700;
}

#my-rank-exp {
    font-weight: 700;
}

/* === SCAM CHATBOT === */
.chat-warning {
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    color: #333;
    font-size: 0.95rem;
}

.chat-container {
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    height: 400px;
    overflow-y: auto;
    margin-bottom: 1rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.chat-message {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-message.bot {
    justify-content: flex-start;
}

.chat-message.user {
    justify-content: flex-end;
}

.chat-bubble {
    max-width: 70%;
    padding: 0.8rem 1rem;
    border-radius: 15px;
    word-wrap: break-word;
    position: relative;
}

.chat-message.bot .chat-bubble {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom-left-radius: 5px;
}

.chat-message.user .chat-bubble {
    background: #e0e0e0;
    color: #333;
    border-bottom-right-radius: 5px;
}

.chat-avatar {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.chat-input-container {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

#scam-chat-input {
    flex: 1;
    padding: 0.8rem;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-family: 'M PLUS Rounded 1c', sans-serif;
    font-size: 1rem;
    resize: none;
}

#scam-chat-input:focus {
    outline: none;
    border-color: #667eea;
}

#scam-chat-send-btn {
    padding: 0.8rem 1.5rem;
    white-space: nowrap;
}

.chat-actions {
    text-align: center;
}

/* === SCAM CHAT RESULT === */
.scam-result-summary {
    margin: 2rem 0;
}

.verdict-box {
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
    font-size: 1.3rem;
    font-weight: 700;
    color: white;
}

.verdict-box.safe {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.verdict-box.warning {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.verdict-box.danger {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.scam-result-details,
.scam-result-advice {
    background: white;
    padding: 1.5rem;
    border-radius: 15px;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.scam-result-details h3,
.scam-result-advice h3 {
    margin-top: 0;
    color: #667eea;
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

#scam-result-feedback,
#scam-result-tips {
    line-height: 1.8;
    color: #333;
}

/* CSS cho danh sách bullet */
#scam-result-feedback ul,
#scam-result-tips ul {
    padding-left: 0;
    list-style: none;
    margin: 0;
}

#scam-result-feedback li,
#scam-result-tips li {
    margin-bottom: 1rem;
    padding-left: 2rem;
    position: relative;
    text-align: left;
}

/* Icon bullet đẹp hơn */
#scam-result-feedback li:before {
    content: "✓";
    position: absolute;
    left: 0;
    top: 0;
    width: 1.5rem;
    height: 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9rem;
}

#scam-result-tips li:before {
    content: "💡";
    position: absolute;
    left: 0;
    top: 0;
    font-size: 1.3rem;
}

/* Box container căn trái */
.scam-result-details,
.scam-result-advice {
    text-align: left;
}

#scam-result-feedback ul,
#scam-result-tips ul {
    padding-left: 1.5rem;
}

#scam-result-feedback li,
#scam-result-tips li {
    margin-bottom: 0.5rem;
}

.chat-typing-indicator {
    display: flex;
    gap: 5px;
    padding: 0.8rem 1rem;
}

.chat-typing-indicator span {
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.chat-typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.chat-typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {

    0%,
    60%,
    100% {
        transform: translateY(0);
    }

    30% {
        transform: translateY(-10px);
    }
}

#scam-chat-input,
#scam-chat-send-btn {
    display: none;
}

.chat-input-container {
    display: none;
}

/* === BATTLE MODE === */

/* Lobby */
.battle-options {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin: 2rem 0;
    align-items: center;
}

.divider {
    color: #999;
    font-size: 0.9rem;
    text-align: center;
    position: relative;
    width: 100%;
}

.divider:before,
.divider:after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: #ddd;
}

.divider:before {
    left: 0;
}

.divider:after {
    right: 0;
}

.join-room-form {
    display: flex;
    gap: 0.5rem;
    width: 100%;
    max-width: 400px;
}

#room-code-input {
    flex: 1;
    padding: 0.8rem;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 1rem;
    text-transform: uppercase;
    text-align: center;
    font-family: 'M PLUS Rounded 1c', sans-serif;
}

/* Waiting Room */
.room-code-display {
    text-align: center;
    margin: 1rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.room-code-display h2 {
    font-size: 2.5rem;
    color: #667eea;
    letter-spacing: 0.3rem;
    margin: 0;
}

.btn-icon {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    transition: transform 0.2s;
}

.btn-icon:hover {
    transform: scale(1.2);
}

.players-waiting {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    margin: 3rem 0;
}

.player-card {
    text-align: center;
    padding: 1.5rem;
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    min-width: 150px;
}

.player-card.host {
    border: 3px solid #667eea;
}

.player-card.guest {
    border: 3px solid #f093fb;
}

.player-avatar {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.player-avatar.waiting {
    opacity: 0.3;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 0.3;
    }

    50% {
        opacity: 0.6;
    }
}

.player-badge {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    margin-top: 0.5rem;
}

.vs-divider {
    font-size: 2rem;
    font-weight: 800;
    color: #f5576c;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.waiting-message {
    text-align: center;
    color: #999;
    font-size: 0.9rem;
}

/* Game Screen */
#battle-game-screen {
    padding: 1rem;
    max-width: 800px;
}

.battle-header {
    margin-bottom: 2rem;
}

.battle-score {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 1rem;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.player-score {
    text-align: center;
}

.score-label {
    display: block;
    font-size: 0.9rem;
    color: #666;
}

.score-value {
    display: block;
    font-size: 2rem;
    font-weight: 800;
    margin-top: 0.3rem;
}

.player-score.me .score-value {
    color: #667eea;
}

.player-score.opponent .score-value {
    color: #f093fb;
}

.round-info {
    font-size: 1.2rem;
    font-weight: 700;
    color: #333;
}

/* Countdown */
.battle-countdown {
    text-align: center;
    margin: 4rem 0;
}

#countdown-number {
    font-size: 8rem;
    font-weight: 800;
    color: #667eea;
    animation: countdownPulse 1s ease-in-out;
}

@keyframes countdownPulse {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Question Box */
.battle-question-container {
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.battle-question-box {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#battle-question-text {
    color: white;
    font-size: 1.3rem;
    line-height: 1.8;
    margin: 0;
    text-align: center;
}

/* Danger Word Highlighting */
.danger-word {
    background: rgba(245, 87, 108, 0.9);
    padding: 0.2rem 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-block;
    position: relative;
    animation: glow 1.5s infinite;
}

.danger-word:hover {
    transform: scale(1.05);
    background: rgba(245, 87, 108, 1);
    box-shadow: 0 0 20px rgba(245, 87, 108, 0.8);
}

@keyframes glow {

    0%,
    100% {
        box-shadow: 0 0 5px rgba(245, 87, 108, 0.5);
    }

    50% {
        box-shadow: 0 0 20px rgba(245, 87, 108, 0.8);
    }
}

/* Feedback */
.battle-feedback {
    text-align: center;
    padding: 1.5rem;
    border-radius: 15px;
    font-size: 1.5rem;
    font-weight: 700;
    animation: fadeIn 0.3s;
}

.battle-feedback.win {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
}

.battle-feedback.lose {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    color: white;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Timer */
.battle-timer {
    margin-top: 2rem;
    height: 8px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
}

.timer-bar {
    height: 100%;
    background: linear-gradient(90deg, #11998e 0%, #38ef7d 100%);
    width: 100%;
    transition: width 0.1s linear;
}

/* Result Screen */
.battle-result-card {
    text-align: center;
    padding: 2rem;
}

.result-icon {
    font-size: 6rem;
    margin-bottom: 1rem;
    animation: bounceIn 0.8s;
}

@keyframes bounceIn {
    0% {
        transform: scale(0);
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
    }
}

#battle-result-title {
    font-size: 2.5rem;
    margin-bottom: 2rem;
}

.final-scores {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    margin: 2rem 0;
}

.final-score-item {
    text-align: center;
}

.final-score-item p {
    color: #666;
    margin-bottom: 0.5rem;
}

.final-score-item h2 {
    font-size: 3rem;
    margin: 0;
}

.final-score-divider {
    font-size: 2rem;
    color: #ddd;
}

.exp-reward {
    margin: 2rem 0;
    font-size: 2rem;
    font-weight: 800;
    color: #667eea;
}

/* Responsive */
@media (max-width: 600px) {
    .players-waiting {
        flex-direction: column;
        gap: 1rem;
    }

    .vs-divider {
        transform: rotate(90deg);
    }

    #battle-question-text {
        font-size: 1.1rem;
    }

    .battle-score {
        font-size: 0.9rem;
    }
}
.battle-instruction {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 0.8rem;
    border-radius: 10px;
    text-align: center;
    font-size: 0.95rem;
    margin-bottom: 1rem;
    animation: fadeIn 0.5s;
}

.battle-choices {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 2rem;
}

.choice-btn {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1rem;
    font-family: 'M PLUS Rounded 1c', sans-serif;
    transition: all 0.2s;
    text-align: left;
}

.choice-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.02);
}

.choice-btn:disabled {
    cursor: not-allowed;
}

.choice-btn.correct {
    background: #38ef7d !important;
    border-color: #38ef7d !important;
    color: white !important;
    font-weight: 800;
    opacity: 1 !important;
    box-shadow: 0 0 15px rgba(56, 239, 125, 0.5);
}

.choice-btn.wrong {
    background: #f5576c !important;
    border-color: #f5576c !important;
    color: white !important;
    font-weight: 700;
    opacity: 0.8 !important;
    box-shadow: 0 0 10px rgba(245, 87, 108, 0.3);
}

@media (max-width: 600px) {
    .battle-choices {
        grid-template-columns: 1fr;
    }
}

/* Checkbox custom cho "Chưa có học sinh" */
.custom-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
}

.custom-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #007bff;
    cursor: pointer;
}

.custom-checkbox label {
    margin: 0;
    cursor: pointer;
    user-select: none;
}

.btn-text {
    font-family: 'M PLUS Rounded 1c', sans-serif;
    font-size: 14px;
    background: none;
    border: none;
    color: #667eea;
    cursor: pointer;
    text-decoration: underline;
    padding: 5px;
}

.btn-text:hover {
    color: #764ba2;
}

/* --- Thông báo cập nhật PWA --- */
#update-notification {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #333;
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    z-index: 5000;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

#reload-page-btn {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 5px 15px;
    border-radius: 15px;
    cursor: pointer;
}