/* =============================================
   ESTILOS DE PROTECCIÓN DE CONTENIDO
   ADUANA VIRTUAL - Sistema de Seguridad
   ============================================= */

/* PROTECCIÓN CONTRA SELECCIÓN Y ARRASTRAR */
* {
  -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;
  pointer-events: auto !important;
}

/* PERMITIR SELECCIÓN SOLO EN INPUTS ESPECÍFICOS */
input[type="text"], 
input[type="search"], 
input[type="number"],
textarea {
  -webkit-user-select: text !important;
  -moz-user-select: text !important;
  -ms-user-select: text !important;
  user-select: text !important;
}

/* PROTECCIÓN CONTRA IMPRESIÓN */
@media print {
  * {
    display: none !important;
  }
  
  body::before {
    content: "⚠️ CONTENIDO PROTEGIDO - IMPRESIÓN NO AUTORIZADA" !important;
    display: block !important;
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    font-size: 24px !important;
    font-weight: bold !important;
    color: #dc3545 !important;
    text-align: center !important;
    z-index: 99999 !important;
    background: white !important;
    padding: 50px !important;
    border: 3px solid #dc3545 !important;
  }
}

/* PROTECCIÓN CONTRA HIGHLIGHTING */
::selection {
  background: transparent !important;
}

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

/* PROTECCIÓN CONTRA OUTLINE EN FOCUS */
*:focus {
  outline: none !important;
}

/* PREVENIR ZOOM CON CSS */
html {
  -ms-touch-action: pan-x pan-y !important;
  touch-action: pan-x pan-y !important;
}

/* PROTECCIÓN CONTRA OVERFLOW SCROLLING */
body {
  -webkit-overflow-scrolling: auto !important;
  overflow-scrolling: auto !important;
}

/* PROTECCIÓN CONTRA POINTER EVENTS EN ELEMENTOS SENSITIVOS */
img, 
video, 
canvas, 
svg {
  pointer-events: 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;
}

/* REACTIVAR POINTER EVENTS PARA ELEMENTOS INTERACTIVOS */
button, 
a, 
input, 
select, 
textarea,
.clickable {
  pointer-events: auto !important;
}

/* PROTECCIÓN CONTRA COPY/PASTE VISUAL */
.no-copy {
  -webkit-user-select: none !important;
  -moz-user-select: none !important;
  -ms-user-select: none !important;
  user-select: none !important;
  position: relative !important;
}

.no-copy::before {
  content: '' !important;
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  z-index: 1 !important;
  pointer-events: none !important;
}

/* PROTECCIÓN CONTRA INSPECT ELEMENT */
.protected-content {
  position: relative !important;
  overflow: hidden !important;
}

.protected-content::after {
  content: '' !important;
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  background: transparent !important;
  z-index: 0 !important;
  pointer-events: none !important;
}

/* PROTECCIÓN ADICIONAL PARA WEBKIT */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
  * {
    -webkit-user-select: none !important;
    -webkit-touch-callout: none !important;
    -webkit-user-drag: none !important;
  }
}

/* PROTECCIÓN PARA FIREFOX */
@-moz-document url-prefix() {
  * {
    -moz-user-select: none !important;
    -moz-user-drag: none !important;
  }
}

/* OCULTAR ELEMENTOS CUANDO SE DETECTAN DEV TOOLS */
.devtools-detected {
  filter: blur(10px) !important;
  pointer-events: none !important;
  user-select: none !important;
}

/* PROTECCIÓN CONTRA CAPTURAS CON CSS */
.screenshot-protection {
  position: relative !important;
}

.screenshot-protection::before {
  content: '' !important;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  background: transparent !important;
  z-index: -1 !important;
  pointer-events: none !important;
}

/* ESTILOS PARA NOTIFICACIONES DE SEGURIDAD */
.security-warning {
  position: fixed !important;
  top: 20px !important;
  right: 20px !important;
  background: #dc3545 !important;
  color: white !important;
  padding: 15px 20px !important;
  border-radius: 8px !important;
  z-index: 99999 !important;
  font-family: 'Segoe UI', Arial, sans-serif !important;
  font-size: 14px !important;
  font-weight: bold !important;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3) !important;
  animation: slideIn 0.3s ease-out !important;
}

@keyframes slideIn {
  from { 
    transform: translateX(100%) !important; 
    opacity: 0 !important; 
  }
  to { 
    transform: translateX(0) !important; 
    opacity: 1 !important; 
  }
}

/* PROTECCIÓN CONTRA ZOOM ESPECÍFICA */
.no-zoom {
  transform-origin: 0 0 !important;
  -webkit-transform-origin: 0 0 !important;
  -moz-transform-origin: 0 0 !important;
  -o-transform-origin: 0 0 !important;
  -ms-transform-origin: 0 0 !important;
}

/* PREVENIR MANIPULACIÓN DE ELEMENTOS */
.content-locked {
  position: relative !important;
  overflow: hidden !important;
}

.content-locked * {
  pointer-events: auto !important;
  position: relative !important;
}

/* PROTECCIÓN AVANZADA CONTRA HERRAMIENTAS */
@media (max-device-width: 0px) {
  /* body { display: none !important; } - DESACTIVADO para permitir visualización */
}

/* PROTECCIÓN CONTRA EXTENSIONES DE NAVEGADOR */
.browser-extension-protected {
  -webkit-app-region: no-drag !important;
  -webkit-user-modify: read-only !important;
}

/* ESTILOS PARA BLOQUEO COMPLETO */
.security-lockdown {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  background: #000 !important;
  color: #fff !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  z-index: 99999 !important;
  font-family: Arial, sans-serif !important;
}

.security-lockdown h1 {
  color: #fff !important;
  text-align: center !important;
  font-size: 24px !important;
  margin-bottom: 20px !important;
}

.security-lockdown p {
  color: #ccc !important;
  text-align: center !important;
  font-size: 16px !important;
  line-height: 1.5 !important;
}

/* APLICAR PROTECCIÓN A TODAS LAS PÁGINAS */
html, 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: transparent !important;
}