﻿/* =========================
   CONTENT SECURITY - Anti-Copy Shield
   Disables text selection, copying on non-admin pages
   ========================= */

/* Block selection everywhere by default (non-admin) */
body:not(.admin-mode) {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

/* Allow selection on admin pages */
body.admin-mode,
body.admin-mode * {
    -webkit-user-select: auto;
    -moz-user-select: auto;
    -ms-user-select: auto;
    user-select: auto;
    -webkit-touch-callout: default;
}

/* Allow selection in input fields and textareas */
input,
textarea,
[contenteditable="true"],
.allow-select {
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
    user-select: text !important;
    -webkit-touch-callout: default !important;
}

/* Disable image dragging and long-press save */
body:not(.admin-mode) img {
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-drag: none;
    pointer-events: auto;
    -webkit-touch-callout: none;
}

/* Disable long-press context menu on all elements */
body:not(.admin-mode) * {
    -webkit-touch-callout: none;
}

/* Disable media download buttons (CSS fallback) */
video::-webkit-media-controls-download-button,
audio::-webkit-media-controls-download-button {
    display: none !important;
}

video::-webkit-media-controls-enclosure {
    overflow: hidden;
}

/* Prevent image selection highlight */
body:not(.admin-mode) img::selection {
    background: transparent;
}

body:not(.admin-mode) img::-moz-selection {
    background: transparent;
}

/* Prevent text selection highlight on protected content */
body:not(.admin-mode) .practice-text::selection,
body:not(.admin-mode) .article-full-content::selection,
body:not(.admin-mode) .card-content::selection {
    background: transparent;
}

/* Mobile: Disable tap highlight */
body:not(.admin-mode) {
    -webkit-tap-highlight-color: transparent;
}

/* Additional protection for media containers */
body:not(.admin-mode) .media-container,
body:not(.admin-mode) .video-wrapper,
body:not(.admin-mode) .audio-wrapper,
body:not(.admin-mode) .image-wrapper {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}
