/* Print Protection CSS */

/* Hide all content when printing and show copyright notice */
@media print {
    body * {
        visibility: hidden !important;
        display: none !important;
    }
    
    body::before {
        content: "© حق چاپ و کپی برداری محفوظ است - علی حسینی\A\A محتوای این وب‌سایت تحت حمایت قانون کپی‌رایت می‌باشد.\A برای دریافت نسخه چاپی با ناشر تماس بگیرید.";
        visibility: visible !important;
        display: block !important;
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        text-align: center;
        font-size: 24px;
        font-family: 'B Nazanin', 'Tahoma', sans-serif;
        white-space: pre-wrap;
        direction: rtl;
        line-height: 2;
    }
    
    /* Add watermark background */
    body::after {
        content: "";
        visibility: visible !important;
        display: block !important;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: repeating-linear-gradient(
            45deg,
            transparent,
            transparent 30px,
            rgba(0,0,0,0.05) 30px,
            rgba(0,0,0,0.05) 60px
        );
        pointer-events: none;
    }
}

/* Disable text selection on protected content */
.no-select,
.protected-content,
.chapter-content,
.blog-post-content,
article,
main {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

/* Disable image dragging and right-click */
img {
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-drag: none;
    pointer-events: none;
}

/* Allow link clicking but not text selection */
a {
    pointer-events: auto;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Warning overlay style */
.print-warning {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 30px;
    border-radius: 10px;
    z-index: 10000;
    text-align: center;
    font-family: 'B Nazanin', 'Tahoma', sans-serif;
    direction: rtl;
}

.print-warning h3 {
    margin: 0 0 15px 0;
    font-size: 24px;
}

.print-warning p {
    margin: 0;
    font-size: 18px;
}

/* Transparent overlay on images to prevent easy saving */
.image-container {
    position: relative;
    display: inline-block;
}

.image-container::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    pointer-events: none;
}

/* Style for copyright notice */
.copyright-notice {
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    padding: 20px;
    margin: 20px 0;
    text-align: center;
    direction: rtl;
    font-family: 'B Nazanin', 'Tahoma', sans-serif;
    border-radius: 8px;
}

/* Blur content for screenshot protection (optional) */
.screenshot-protection {
    filter: blur(0px);
    transition: filter 0.3s;
}

body.screenshot-active .screenshot-protection {
    filter: blur(5px);
}