/**
 * NPA Publishing Company - Digital Rights Management (DRM) & Content Security Stylesheet
 * 
 * Scoped STRICTLY to scholarly chapter reading viewports, open-access manuscript viewers,
 * and academic PDF previews to protect intellectual property while preserving natural
 * usability, text selection, and standard navigation across the rest of the website.
 */

/* ==========================================================================
   1. SCHOLARLY READING VIEWPORT TEXT SELECTION LOCKDOWN
   ========================================================================== */
.reader-modal-overlay,
.reader-modal-container,
.reader-viewport,
.reader-article-content,
.reader-abstract-prose,
#readerPdfIframe,
.drm-protected-zone,
.editorial-chapters-preview {
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;
}

/* Allow text selection in search boxes inside the reader TOC */
.reader-toc input,
.reader-toc textarea,
.reader-search-input {
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    user-select: text !important;
}

/* ==========================================================================
   2. MEDIA DRAG & DROP AND TOUCH CALLOUT RESTRICTIONS
   ========================================================================== */
.reader-modal-container img,
.reader-viewport img,
.reader-viewport iframe,
.drm-protected-zone img {
    -webkit-user-drag: none !important;
    user-drag: none !important;
    -webkit-touch-callout: none !important;
}

/* Reader PDF Transparent Interaction Shield (Prevents direct right-click download) */
.reader-pdf-shield {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    pointer-events: none;
}

/* ==========================================================================
   3. ANTI-PRINT LOCKDOWN (ACTIVE WHEN SCHOLARLY READER IS ENGAGED)
   ========================================================================== */
@media print {
    body.reader-active *,
    .reader-modal-overlay.active * {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
    }

    body.reader-active::before {
        content: "RESTRICTED SCHOLARLY ACCESS \2014  PRINTING PROHIBITED\A\A This digital publication and peer-reviewed chapter content are protected by Digital Rights Management (DRM).\A\A Physical reproduction, printing, and exporting to PDF from NPA Publishing Company are strictly prohibited under national and international copyright legislation." !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        white-space: pre-wrap !important;
        font-family: 'Crimson Pro', Georgia, serif !important;
        font-size: 18pt !important;
        line-height: 1.6 !important;
        text-align: center !important;
        color: #991b1b !important;
        border: 3px solid #991b1b !important;
        background: #fef2f2 !important;
        padding: 50px 30px !important;
        margin: 40px auto !important;
        max-width: 600px !important;
        border-radius: 12px !important;
    }
}

/* ==========================================================================
   4. FOCUS-LOSS PRIVACY SHIELD FOR SCHOLARLY READER
   ========================================================================== */
.reader-privacy-shield {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.94);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 30px;
    border-radius: 12px;
}

.reader-privacy-shield.active {
    display: flex;
}

.reader-shield-dialog {
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    padding: 36px 30px;
    max-width: 440px;
    text-align: center;
    color: #f8fafc;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.reader-shield-badge {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(136, 19, 55, 0.25);
    border: 2px solid #881337;
    color: #f43f5e;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 18px;
    font-size: 24px;
}

.reader-shield-heading {
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 8px;
}

.reader-shield-desc {
    font-size: 0.9rem;
    color: #94a3b8;
    line-height: 1.5;
    margin-bottom: 16px;
}

.reader-shield-action {
    font-size: 0.82rem;
    color: #fbbf24;
    font-weight: 600;
}

/* ==========================================================================
   5. FORENSIC WATERMARK OVERLAY (INSIDE READER VIEWPORT ONLY)
   ========================================================================== */
.reader-watermark-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 5;
    opacity: 0.75;
}

/* ==========================================================================
   6. RESPONSIVE SECURITY TOAST NOTIFICATION
   ========================================================================== */
#drmSecurityToast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 999999;
    max-width: 380px;
    background: #0f172a;
    color: #f8fafc;
    border-radius: 12px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
    border-left: 4px solid #881337;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.28s ease, transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
    overflow: hidden;
}

#drmSecurityToast.drm-toast-visible {
    opacity: 1;
    transform: translateY(0);
}

.drm-toast-content {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
}

.drm-toast-icon {
    flex-shrink: 0;
    color: #f43f5e;
}

.drm-toast-title {
    display: block;
    font-size: 0.88rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 2px;
}

.drm-toast-msg {
    display: block;
    font-size: 0.8rem;
    color: #94a3b8;
    line-height: 1.4;
}
