﻿/* ============================================================
   CHEMTUS - BẢO VỆ GIAO DIỆN HỌC SINH
   File độc lập để KHÔNG đụng site.css đang chạy tốt.
   ============================================================ */

/* Không chọn/copy text thông thường. */
html.chemtus-student-protected,
body.chemtus-student-protected,
body.chemtus-student-protected main,
body.chemtus-student-protected header,
body.chemtus-student-protected footer,
body.chemtus-student-protected .lesson-page-section,
body.chemtus-student-protected .student-exam-home,
body.chemtus-student-protected .student-exam-room,
body.chemtus-student-protected .student-exam-result {
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

    /* Nút, link, radio, checkbox, select vẫn thao tác bình thường. */
    body.chemtus-student-protected button,
    body.chemtus-student-protected a,
    body.chemtus-student-protected label,
    body.chemtus-student-protected input,
    body.chemtus-student-protected textarea,
    body.chemtus-student-protected select,
    body.chemtus-student-protected [role="button"] {
        pointer-events: auto;
    }

    /* Ô nhập vẫn đặt caret và gõ bình thường. */
    body.chemtus-student-protected input,
    body.chemtus-student-protected textarea,
    body.chemtus-student-protected [contenteditable="true"] {
        -webkit-user-select: text;
        -moz-user-select: text;
        user-select: text;
    }

    /* Khóa drag ảnh và menu cảm ứng dài. */
    body.chemtus-student-protected img {
        -webkit-user-drag: none;
        user-drag: none;
        -webkit-touch-callout: none;
        user-select: none;
    }

/* Watermark mờ phủ toàn màn hình, không cản click. */
.chemtus-security-watermark {
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    pointer-events: none;
    overflow: hidden;
    display: grid;
    grid-template-columns: repeat(3, minmax(260px, 1fr));
    grid-auto-rows: 180px;
    align-items: center;
    justify-items: center;
    opacity: 1;
}

    .chemtus-security-watermark span {
        display: block;
        max-width: 360px;
        color: rgba(8, 38, 61, 0.065);
        font-size: 14px;
        font-weight: 800;
        letter-spacing: 0.8px;
        white-space: nowrap;
        transform: rotate(-24deg);
        text-transform: uppercase;
    }

/* Thông báo nhỏ khi người dùng thử copy/F12/print. */
.chemtus-security-notice {
    position: fixed;
    left: 50%;
    bottom: 26px;
    z-index: 2147483646;
    max-width: min(520px, calc(100vw - 28px));
    transform: translate(-50%, 20px);
    padding: 11px 16px;
    border-radius: 999px;
    background: rgba(8, 38, 61, 0.94);
    color: #ffffff;
    font-family: "Segoe UI", Arial, sans-serif;
    font-size: 13px;
    font-weight: 700;
    text-align: center;
    box-shadow: 0 12px 32px rgba(8, 38, 61, 0.24);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .16s ease, transform .16s ease, visibility .16s;
}

    .chemtus-security-notice.show {
        opacity: 1;
        visibility: visible;
        transform: translate(-50%, 0);
    }

/* Khi in bằng menu/browser ngoài phím tắt: không xuất nội dung. */
@media print {
    html,
    body,
    body * {
        visibility: hidden !important;
    }

        body::before {
            content: "CHEMTUS - Nội dung không được phép in.";
            visibility: visible !important;
            position: fixed;
            inset: 0;
            display: grid;
            place-items: center;
            font: 700 18px "Segoe UI", Arial, sans-serif;
            color: #08263d;
            background: #ffffff;
        }
}

/* ============================================================
   WATERMARK
   TẮT HOÀN TOÀN để giữ nguyên giao diện CHEMTUS gốc
   ============================================================ */

.chemtus-security-watermark {
    display: none !important;
}

/* ============================================================
   ẨN THÔNG BÁO BẢO VỆ
   Vẫn giữ toàn bộ chức năng chống copy / chuột phải / phím tắt
   ============================================================ */

.chemtus-security-notice,
.chemtus-security-notice.show {
    display: none !important;
}