/* Protection CSS (works even if JS disabled) */

/* 1) Prevent text selection globally */
html, body, p, span, li, a, h1, h2, h3, h4, h5, h6 {
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;
}

/* 2) Disable text dragging and image dragging */
img, svg, figure {
    -webkit-user-drag: none !important;
    user-drag: none !important;
    pointer-events: none !important; /* blocks right-click on images (but also blocks clicks) */
}

/* 3) Overlay technique for images: wrap with .protect-img-wrap in HTML */
.protect-img-wrap {
    position: relative;
    display: inline-block;
}
.protect-img-wrap img {
    pointer-events: none; /* prevent direct interaction with the image */
    display: block;
}
.protect-img-wrap::after{
    content: " "; 
    position: absolute;
    inset: 0;
    /* transparent overlay to block context menu on image targets */
    background: rgba(255,255,255,0);
}

/* 4) Prevent selection via ::selection override */
::selection { background: transparent; color: inherit; }

/* 5) Hide content on print (prevents easy "Print to PDF" ) */
@media print {
    html, body {
        display: none !important;
        visibility: hidden !important;
        height: 0 !important;
        overflow: hidden !important;
    }
}

/* 6) Make links non-clickable (avoid direct download links) */
a {
    pointer-events: none !important;
    cursor: default !important;
    text-decoration: none !important;
}

/* 7) Visual deterrent for screenshots (watermark overlay on container) */
.protected-content {
    position: relative;
}
.protected-content::before {
    content: "محمية © " attr(data-user) " - لا تشارك"; /* dynamic via server: data-user attribute */
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 12px;
    opacity: 0.15;
    transform: rotate(-15deg);
    pointer-events: none;
    user-select: none;
}

/* 8) Extra: make text rendered via background image (harder to copy) */
/* Example use: <div class="bg-text" aria-hidden="true" style="background-image:url('/path/to/text-as-image.png')"></div> */
.bg-text {
    background-repeat: no-repeat;
    background-size: cover;
    width: 100%;
    height: auto;
    min-height: 120px; /* adjust */
    text-indent: -9999px; /* hide real text if present */
    overflow: hidden;
}

/* 9) Accessibility note disabled for selection: keep an accessible version off-DOM for screen readers if needed */
.sr-only-accessible {
    position: absolute !important;
    left: -10000px !important;
    top: auto !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
}

