/* 🛡️ CSS de Protección Anti-Inspección */
/* G&O Soluciones TI - Seguridad Visual */

/* Deshabilitar selección de texto */
* {
    -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;
}

/* Inputs y textareas pueden ser seleccionables */
input[type="text"], 
input[type="email"], 
input[type="tel"], 
input[type="password"], 
textarea, 
select {
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
    user-select: text !important;
}

/* Protección contra arrastrar elementos */
img, 
video, 
audio {
    -webkit-user-drag: none !important;
    -moz-user-drag: none !important;
    user-drag: none !important;
    pointer-events: none !important;
}

/* Links mantienen funcionalidad pero no se pueden arrastrar */
a {
    -webkit-user-drag: none !important;
    -moz-user-drag: none !important;
    user-drag: none !important;
    pointer-events: auto !important;
}

/* Protección contra impresión */
@media print {
    * {
        display: none !important;
    }
    
    body::before {
        content: "⚠️ DOCUMENTO PROTEGIDO - G&O Soluciones TI Chile Ltda. - Impresión no autorizada" !important;
        display: block !important;
        font-size: 24px !important;
        color: red !important;
        text-align: center !important;
        margin-top: 50vh !important;
    }
}

/* Ofuscación de elementos críticos */
.obfuscate {
    filter: blur(0px);
    transition: filter 0.3s ease;
}

.obfuscate.protected {
    filter: blur(10px) !important;
}

/* Overlay de protección */
.security-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0, 0, 0, 0.95) !important;
    z-index: 999999 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #ff4444 !important;
    font-family: Arial, sans-serif !important;
    font-size: 24px !important;
    text-align: center !important;
}

/* Protección watermark invisible */
body::before {
    content: "G&O Soluciones TI - Propiedad Intelectual Protegida";
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-45deg);
    font-size: 48px;
    color: rgba(255, 255, 255, 0.005);
    z-index: -1;
    pointer-events: none;
    white-space: nowrap;
}

/* Protección contra screenshot en navegadores compatibles */
.screenshot-protected {
    -webkit-user-select: none !important;
    -webkit-touch-callout: none !important;
    -webkit-user-drag: none !important;
}

/* Blur automático al detectar herramientas de desarrollo */
.devtools-blur {
    filter: blur(8px) !important;
    transition: filter 0.2s ease !important;
}

/* Protección de contenido sensible */
.sensitive-content {
    position: relative;
}

.sensitive-content::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    pointer-events: none;
    z-index: 1;
}

/* Animación anti-screenshot */
@keyframes anti-capture {
    0% { opacity: 1; }
    50% { opacity: 0.1; }
    100% { opacity: 1; }
}

.capture-protection {
    animation: anti-capture 0.1s infinite;
}

/* Media queries para protección en móviles */
@media (max-width: 768px) {
    /* Deshabilitar zoom en móviles */
    meta[name="viewport"] {
        content: "width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" !important;
    }
    
    /* Protección adicional táctil */
    * {
        -webkit-touch-callout: none !important;
        -webkit-user-select: none !important;
        -webkit-tap-highlight-color: transparent !important;
    }
}

/* Protección contra inspección de elementos específicos */
.solomon-sigil,
.sigil-prosperity,
.municipal-elements {
    position: relative;
}

.solomon-sigil::before,
.sigil-prosperity::before,
.municipal-elements::before {
    content: "";
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    background: transparent;
    z-index: 10;
    pointer-events: none;
}

/* Protección de código fuente en elementos críticos */
.protected-element {
    position: relative;
    overflow: hidden;
}

.protected-element::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent 48%, rgba(255,255,255,0.01) 49%, rgba(255,255,255,0.01) 51%, transparent 52%);
    pointer-events: none;
    z-index: 1;
}

/* Ofuscación de texto crítico */
.obfuscated-text {
    font-family: "Courier New", monospace;
    letter-spacing: 1px;
    text-shadow: 0 0 2px rgba(255,255,255,0.1);
}

/* Protección contra grabación de pantalla */
.screen-record-protection {
    background: linear-gradient(45deg, #000 25%, transparent 25%, transparent 75%, #000 75%),
                linear-gradient(45deg, #000 25%, transparent 25%, transparent 75%, #000 75%);
    background-size: 2px 2px;
    background-position: 0 0, 1px 1px;
    opacity: 0.02;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 999;
}

/* Protección avanzada contra DevTools */
html {
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;
}

body {
    -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: rgba(0,0,0,0) !important;
}

/* Ocultar scrollbars cuando DevTools está abierto (detección visual) */
::-webkit-scrollbar {
    width: 0px !important;
    background: transparent !important;
}

/* Protección contra inspect element */
* {
    -webkit-user-modify: read-only !important;
    -moz-user-modify: read-only !important;
    user-modify: read-only !important;
}

/* Deshabilitar outline en elementos inspeccionables */
*:focus {
    outline: none !important;
    box-shadow: none !important;
}

/* Protección contra copy/paste */
* {
    -webkit-user-select: none !important;
    -khtml-user-select: none !important;
    -moz-user-select: -moz-none !important;
    -o-user-select: none !important;
    user-select: none !important;
}

/* Protección específica para códigos y textos importantes */
code, 
pre, 
.code-block,
.important-text {
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    user-select: none !important;
    -webkit-touch-callout: none !important;
    -webkit-tap-highlight-color: transparent !important;
    pointer-events: none !important;
}

/* Protección contra herramientas de captura */
.anti-screenshot {
    position: relative;
}

.anti-screenshot::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 2px,
        rgba(255, 107, 53, 0.01) 2px,
        rgba(255, 107, 53, 0.01) 4px
    );
    pointer-events: none;
    z-index: 1;
}

/* Protección contra extensiones de navegador */
meta[name="referrer"] {
    content: no-referrer !important;
}

/* Bloqueo de funciones de navegador */
@media screen and (max-device-width: 800px) {
    * {
        -webkit-user-select: none !important;
        -webkit-touch-callout: none !important;
    }
}

/* Protección contra zoom excesivo (puede indicar inspección) */
@media screen and (min-resolution: 2dppx) {
    body {
        zoom: reset !important;
        -moz-transform: scale(1) !important;
        -webkit-transform: scale(1) !important;
        transform: scale(1) !important;
    }
}

/* Deshabilitar funciones de guardado */
* {
    -webkit-user-drag: none !important;
    -khtml-user-drag: none !important;
    -moz-user-drag: none !important;
    -o-user-drag: none !important;
    user-drag: none !important;
}

/* Protección contra herramientas de análisis web */
[data-*] {
    pointer-events: none !important;
}

/* Mensaje de advertencia visible en DevTools */
html::before {
    content: "⚠️ ACCESO NO AUTORIZADO - CONTENIDO PROTEGIDO © G&O Soluciones TI";
    position: fixed;
    top: -100px;
    left: 0;
    width: 100%;
    background: #FF6B35;
    color: white;
    text-align: center;
    padding: 10px;
    font-weight: bold;
    z-index: 999999;
}

/* Ocultar elementos sensibles en DevTools */
script,
link[rel="stylesheet"],
meta {
    display: none !important;
}

/* Protección contra extensiones que leen contenido */
.protected-content {
    position: relative;
    isolation: isolate;
}

.protected-content::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        45deg,
        transparent 49%,
        rgba(255, 255, 255, 0.001) 50%,
        transparent 51%
    );
    pointer-events: none;
    mix-blend-mode: overlay;
}