/**
 * NEXXUS Anti-Debug CSS Layer
 * ═══════════════════════════════════════════════════════════════════
 * Visual obfuscation and protection layer that:
 * - Prevents text selection on sensitive content
 * - Disables image dragging
 * - Hides content from print
 * - Applies visual scrambling when DevTools is detected
 * ═══════════════════════════════════════════════════════════════════
 */

/* ═══════════════════════════════════════════════════════════════════
   TEXT SELECTION PROTECTION
   ═══════════════════════════════════════════════════════════════════ */
body:not(.architect-mode) {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Allow selection in form inputs */
input,
textarea,
[contenteditable="true"] {
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
    user-select: text !important;
}

/* ═══════════════════════════════════════════════════════════════════
   IMAGE PROTECTION
   ═══════════════════════════════════════════════════════════════════ */
img:not(.unprotected) {
    pointer-events: none;
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-drag: none;
}

/* ═══════════════════════════════════════════════════════════════════
   PRINT PROTECTION
   ═══════════════════════════════════════════════════════════════════ */
@media print {
    * {
        display: none !important;
        visibility: hidden !important;
    }
    
    body::before {
        content: "⛔ NEXXUS content cannot be printed.";
        display: block !important;
        visibility: visible !important;
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        font-size: 24px;
        color: #ff4444;
        font-family: monospace;
    }
}

/* ═══════════════════════════════════════════════════════════════════
   SECURITY LOCKOUT OVERLAY
   ═══════════════════════════════════════════════════════════════════ */
#nx-security-lockout {
    position: fixed !important;
    inset: 0 !important;
    z-index: 999999 !important;
    background: rgba(0, 0, 0, 0.98) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    animation: lockoutPulse 2s ease-in-out infinite;
}

@keyframes lockoutPulse {
    0%, 100% { background: rgba(0, 0, 0, 0.98); }
    50% { background: rgba(30, 0, 0, 0.98); }
}

#nx-security-lockout h1 {
    color: #ff4444;
    font-family: 'Orbitron', 'Courier New', monospace;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    animation: glitch 0.5s infinite;
}

@keyframes glitch {
    0%, 100% { transform: translate(0); }
    20% { transform: translate(-2px, 2px); }
    40% { transform: translate(-2px, -2px); }
    60% { transform: translate(2px, 2px); }
    80% { transform: translate(2px, -2px); }
}

/* ═══════════════════════════════════════════════════════════════════
   SECURITY TOOLTIP
   ═══════════════════════════════════════════════════════════════════ */
#nx-security-tooltip {
    position: fixed;
    z-index: 999998;
    background: rgba(255, 68, 68, 0.95);
    color: #fff;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 12px;
    font-family: 'JetBrains Mono', monospace;
    pointer-events: none;
    box-shadow: 0 4px 20px rgba(255, 0, 0, 0.3);
    border: 1px solid rgba(255, 100, 100, 0.5);
}

/* ═══════════════════════════════════════════════════════════════════
   CONTEXT MENU DISABLE
   ═══════════════════════════════════════════════════════════════════ */
* {
    -webkit-touch-callout: none;
}

/* ═══════════════════════════════════════════════════════════════════
   DEVTOOLS DETECTED STATE
   ═══════════════════════════════════════════════════════════════════ */
body.devtools-detected {
    filter: blur(20px) !important;
    pointer-events: none !important;
}

body.devtools-detected::after {
    content: "⛔ INSPECTION BLOCKED";
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 48px;
    font-family: 'Orbitron', monospace;
    color: #ff4444;
    text-shadow: 0 0 30px #ff0000;
    z-index: 999999;
    pointer-events: none;
}

/* ═══════════════════════════════════════════════════════════════════
   LOCKDOWN MODE
   ═══════════════════════════════════════════════════════════════════ */
body.lockdown-active {
    border: 4px solid #ff4444 !important;
    box-shadow: inset 0 0 100px rgba(255, 0, 0, 0.1) !important;
}

body.lockdown-active::before {
    content: "🔒 LOCKDOWN ACTIVE";
    position: fixed;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 68, 68, 0.9);
    color: #fff;
    padding: 10px 30px;
    font-family: 'Orbitron', monospace;
    font-size: 14px;
    letter-spacing: 0.2em;
    z-index: 999998;
    border-radius: 4px;
    animation: lockdownBlink 1s ease-in-out infinite;
}

@keyframes lockdownBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* ═══════════════════════════════════════════════════════════════════
   NOTIFICATION STYLES
   ═══════════════════════════════════════════════════════════════════ */
#notification-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.arch-notification {
    background: rgba(0, 0, 0, 0.9);
    padding: 15px 20px;
    border-radius: 8px;
    min-width: 280px;
    animation: slideInRight 0.3s ease;
    transition: all 0.3s ease;
}

.notification-critical {
    border: 1px solid #ff4444;
}

.notification-warning {
    border: 1px solid #ffaa00;
}

.notification-success {
    border: 1px solid #00ff88;
}

.notification-info {
    border: 1px solid var(--arch-gold, #ffd700);
}

.notification-title {
    font-family: 'Orbitron', monospace;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.notification-message {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
}

@keyframes slideInRight {
    from {
        transform: translateX(100px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ═══════════════════════════════════════════════════════════════════
   PROTECTED ELEMENTS
   ═══════════════════════════════════════════════════════════════════ */
.nx-protected {
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;
    pointer-events: auto;
}

/* ═══════════════════════════════════════════════════════════════════
   SOURCE CODE VISIBILITY OBFUSCATION
   ═══════════════════════════════════════════════════════════════════ */
script:not([src]),
style:not([id^="nx-"]) {
    /* Make inline scripts/styles invisible in DOM inspector */
    display: none !important;
}

/* ═══════════════════════════════════════════════════════════════════
   IFRAME SANDBOX INDICATOR
   ═══════════════════════════════════════════════════════════════════ */
body.iframe-blocked::before {
    content: "⛔ NEXXUS cannot be embedded in external frames.";
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 24px;
    color: #ff4444;
    font-family: 'Orbitron', monospace;
    text-align: center;
    z-index: 999999;
    background: #000;
    padding: 40px;
    border: 2px solid #ff4444;
    border-radius: 8px;
}
