/* Proteções CSS Anti-Cópia */

/* Desabilitar seleção de texto globalmente */
* {
    -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;
}

/* Permitir seleção apenas em inputs */
input, textarea {
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
    user-select: text !important;
}

/* Proteção contra impressão */
@media print {
    body {
        display: none !important;
    }
    
    body::before {
        content: "🚫 IMPRESSÃO NÃO AUTORIZADA - Este conteúdo é protegido por direitos autorais © MegaEntretenimento 2024" !important;
        font-size: 24px !important;
        font-weight: bold !important;
        color: red !important;
        display: block !important;
        text-align: center !important;
        margin-top: 50px !important;
    }
}

/* Proteção contra screenshots com overlay invisível */
body::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><text y="50" font-size="8" fill="rgba(255,255,255,0.01)">MegaEntretenimento Protected Content</text></svg>') repeat;
    pointer-events: none;
    z-index: 99999;
    mix-blend-mode: difference;
}

/* Ofuscar texto quando ferramentas de dev estão abertas */
@media (max-height: 500px) and (min-width: 800px) {
    body * {
        color: transparent !important;
        text-shadow: 0 0 8px rgba(255,255,255,0.5) !important;
    }
    
    body::before {
        content: "🚫 FERRAMENTAS DE DESENVOLVEDOR DETECTADAS - Feche para continuar" !important;
        position: fixed !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        background: red !important;
        color: white !important;
        padding: 20px !important;
        border-radius: 10px !important;
        font-size: 18px !important;
        font-weight: bold !important;
        z-index: 999999 !important;
        display: block !important;
        text-align: center !important;
    }
}

/* Proteção contra cópia de imagens */
img {
    -webkit-user-drag: none !important;
    -moz-user-drag: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    user-select: none !important;
    pointer-events: none !important;
}

/* Re-abilitar pointer events para elementos interativos */
button, a, input, textarea, select {
    pointer-events: auto !important;
}

/* Marca d'água sutil */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 20%, rgba(255,255,255,0.005) 0%, transparent 2%),
        radial-gradient(circle at 80% 80%, rgba(255,255,255,0.005) 0%, transparent 2%);
    background-size: 200px 200px;
    pointer-events: none;
    z-index: 1;
}

/* Proteção adicional contra debug */
.debug-protection {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.debug-protection::before {
    content: "© MegaEntretenimento 2024 - Conteúdo Protegido - Timestamp: " attr(data-timestamp);
}

/* Ocultar elementos durante tentativas de screenshot */
@media (-webkit-min-device-pixel-ratio: 0) {
    .screenshot-protection {
        filter: blur(0.1px);
        background: linear-gradient(45deg, transparent 49%, rgba(255,255,255,0.01) 50%, transparent 51%);
        background-size: 20px 20px;
    }
}

/* Proteção contra hotlinking */
img[src*="http"]:not([src*="localhost"]):not([src*="127.0.0.1"]) {
    content: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><text y="50" font-size="12" fill="red">HOTLINK BLOQUEADO</text></svg>');
}

/* Animação de proteção */
@keyframes protection-pulse {
    0%, 100% { opacity: 0.01; }
    50% { opacity: 0.03; }
}

.protection-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(255,255,255,0.005) 10px,
        rgba(255,255,255,0.005) 20px
    );
    pointer-events: none;
    z-index: 99998;
    animation: protection-pulse 3s infinite;
}

/* Proteção contra zoom excessivo */
@media (min-zoom: 2) {
    body {
        filter: blur(2px) !important;
    }
    
    body::after {
        content: "🚫 ZOOM EXCESSIVO DETECTADO" !important;
        position: fixed !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        background: red !important;
        color: white !important;
        padding: 20px !important;
        border-radius: 10px !important;
        font-size: 24px !important;
        z-index: 999999 !important;
    }
}

/* Esconder conteúdo se JavaScript estiver desabilitado */
.js-required {
    display: none;
}

html.js-enabled .js-required {
    display: block;
}

/* Proteção contra copiar texto via CSS */
::selection {
    background: transparent !important;
    color: inherit !important;
}

::-moz-selection {
    background: transparent !important;
    color: inherit !important;
}

/* Aviso para ferramentas automatizadas */
@media (prefers-reduced-motion: reduce) {
    body::before {
        content: "⚠️ FERRAMENTA AUTOMATIZADA DETECTADA" !important;
        position: fixed !important;
        bottom: 20px !important;
        right: 20px !important;
        background: orange !important;
        color: black !important;
        padding: 10px !important;
        border-radius: 5px !important;
        font-size: 12px !important;
        z-index: 999999 !important;
        display: block !important;
    }
}
