/**
 * Advanced CSS Protection Styles
 * Prevents image theft, right-click, selection, and other protection bypasses
 */

/* Allow normal interaction with buttons and form elements */
button, input, select, textarea, [role="button"], .btn {
    -webkit-user-select: auto !important;
    -moz-user-select: auto !important;
    -ms-user-select: auto !important;
    user-select: auto !important;
    -webkit-touch-callout: auto !important;
    -webkit-tap-highlight-color: rgba(0,0,0,0.1) !important;
    pointer-events: auto !important;
    cursor: pointer !important;
}

/* Disable selection and dragging on images, but allow clicking */
img, .image-container, .gallery-img, #main-content img {
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;
    -webkit-touch-callout: none !important;
    -webkit-tap-highlight-color: transparent !important;
    -webkit-user-drag: none !important;
    -khtml-user-drag: none !important;
    -moz-user-drag: none !important;
    -o-user-drag: none !important;
    user-drag: none !important;
    /* Allow clicking for lightbox functionality */
    pointer-events: auto !important;
    cursor: pointer !important;
}

/* Specific image protection - allow clicking but prevent dragging/saving */
img {
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;
    -webkit-user-drag: none !important;
    -khtml-user-drag: none !important;
    -moz-user-drag: none !important;
    -o-user-drag: none !important;
    user-drag: none !important;
    -webkit-touch-callout: none !important;
    draggable: false !important;
    /* Allow clicking for lightbox */
    pointer-events: auto !important;
    cursor: pointer !important;
}

/* Disable image context menu */
img::selection {
    background: transparent !important;
}

img::-moz-selection {
    background: transparent !important;
}

/* Prevent image highlighting but allow clicking */
img:hover {
    outline: none !important;
    border: none !important;
    cursor: pointer !important;
}

/* Disable print styles */
@media print {
    * {
        display: none !important;
    }
    
    body::before {
        content: "🚫 CONTENT PROTECTED - PRINTING DISABLED";
        display: block !important;
        text-align: center !important;
        font-size: 24px !important;
        padding: 50px !important;
    }
}

/* Hide content when developer tools might be open */
@media (max-height: 500px) and (min-width: 800px) {
    .gallery-img,
    #main-content img {
        opacity: 0 !important;
        visibility: hidden !important;
    }
    
    body::after {
        content: "🚫 Content Hidden - Developer Tools Detected";
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        background: #000;
        color: #fff;
        padding: 20px;
        border-radius: 10px;
        z-index: 999999;
        font-size: 18px;
    }
}

/* Disable text cursor on images */
img {
    cursor: default !important;
}

/* Prevent image overlay attacks */
.image-container {
    position: relative !important;
    overflow: hidden !important;
}

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

.image-container img {
    position: relative;
    z-index: 0;
}

/* Watermark overlay for all images */
.image-container::after {
    content: "EMARIZ.COM";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-45deg);
    color: rgba(255, 255, 255, 0.1);
    font-size: 2rem;
    font-weight: bold;
    pointer-events: none;
    z-index: 1;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    white-space: nowrap;
}

/* Disable outline and focus */
*:focus {
    outline: none !important;
    box-shadow: none !important;
}

/* Prevent image caching indicators */
img {
    image-rendering: -webkit-optimize-contrast !important;
    image-rendering: crisp-edges !important;
}

/* Hide scrollbars when screenshot tools might be active */
.screenshot-protection-active {
    overflow: hidden !important;
}

.screenshot-protection-active * {
    visibility: hidden !important;
}

/* Protection for lightbox images - prevent saving but allow viewing */
#lightbox img {
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    user-select: none !important;
    -webkit-user-drag: none !important;
    user-drag: none !important;
    -webkit-touch-callout: none !important;
    /* Allow pointer events for lightbox functionality */
    pointer-events: auto !important;
    /* Remove blur in lightbox */
    filter: none !important;
    -webkit-filter: none !important;
}

/* Disable image save shortcuts */
body {
    -webkit-touch-callout: none !important;
    -webkit-user-select: none !important;
    -khtml-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;
}

/* Prevent canvas extraction */
canvas {
    pointer-events: none !important;
    -webkit-user-select: none !important;
    user-select: none !important;
}

/* Mobile-specific protections */
@media (max-width: 768px) {
    * {
        -webkit-touch-callout: none !important;
        -webkit-user-select: none !important;
        -webkit-tap-highlight-color: transparent !important;
    }
    
    img {
        -webkit-touch-callout: none !important;
        pointer-events: none !important;
    }
}

/* Disable image filters that might reveal content */
img {
    filter: none !important;
    -webkit-filter: none !important;
}

/* Protection against CSS injection */
img[style*="background"] {
    background: none !important;
}

/* Disable image transitions that might be exploited */
img {
    transition: none !important;
    -webkit-transition: none !important;
}

/* Prevent image replacement attacks */
img[src=""] {
    display: none !important;
}

/* Hide images during potential screenshot attempts */
.hide-content img,
.hide-content .image-container {
    opacity: 0 !important;
    visibility: hidden !important;
    transform: scale(0) !important;
}

/* Blank page protection styles */
.protection-blank-page {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: #000 !important;
    z-index: 999999 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: white !important;
    font-family: Arial, sans-serif !important;
    font-size: 24px !important;
}

/* Disable browser zoom on images */
img {
    max-width: 100% !important;
    height: auto !important;
    object-fit: cover !important;
}

/* Prevent image URL extraction via CSS */
img::before,
img::after {
    content: none !important;
}

/* Additional mobile protections */
@media (hover: none) and (pointer: coarse) {
    img {
        -webkit-touch-callout: none !important;
        -webkit-user-select: none !important;
        pointer-events: none !important;
    }
}

/* Disable image animations that might be exploited */
@keyframes * {
    from { opacity: 1; }
    to { opacity: 1; }
}

img {
    animation: none !important;
}

/* Protection against browser extensions */
img[data-*] {
    pointer-events: none !important;
}

/* Disable image lazy loading indicators */
img[loading] {
    pointer-events: auto !important;
}

/* Blur effect for nude/mature content */
.blurred,
img.blurred,
#cover-nude,
#grid-nude img,
.nude-category img {
    filter: blur(10px) !important;
    -webkit-filter: blur(10px) !important;
    transition: filter 0.3s ease !important;
}

/* Remove blur on hover for preview */
.blurred:hover,
img.blurred:hover,
#cover-nude:hover,
#grid-nude img:hover {
    filter: blur(5px) !important;
    -webkit-filter: blur(5px) !important;
}

/* Lightbox images should not be blurred */
#lightbox img {
    filter: none !important;
    -webkit-filter: none !important;
}

/* Final catch-all protection */
.protected-content {
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;
    -webkit-touch-callout: none !important;
    -webkit-user-drag: none !important;
    -khtml-user-drag: none !important;
    -moz-user-drag: none !important;
    -o-user-drag: none !important;
    user-drag: none !important;
    pointer-events: none !important;
}
