/* Security CSS - Anti-Inspection and Protection Measures */

/* Prevent text selection (overridden for input fields in JS) */
* {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    
    /* Prevent highlighting */
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

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

/* Prevent image dragging */
img {
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-drag: none;
    
    /* Disable image context menu */
    pointer-events: none;
}

/* Re-enable pointer events for interactive images */
img.interactive {
    pointer-events: auto;
}

/* Hide scrollbars to prevent some inspection techniques */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Firefox scrollbars */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) rgba(255, 255, 255, 0.1);
}

/* Prevent selection styling */
::selection {
    background: transparent;
}

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

/* Security notice for potential developers */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    z-index: -1;
    pointer-events: none;
}

/* Hide potential debugging elements */
.debug, .test, .dev, [data-debug] {
    display: none !important;
    visibility: hidden !important;
}

/* Protect sensitive data elements */
.sensitive-data, .api-key, .secret-key, [data-sensitive] {
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;
    
    /* Additional protection */
    -webkit-touch-callout: none !important;
    -webkit-tap-highlight-color: transparent !important;
}

/* Disable print styles to prevent easy copying */
@media print {
    .no-print, .sensitive-data, .api-credentials, .trading-data {
        display: none !important;
    }
    
    /* Hide everything by default in print */
    body * {
        visibility: hidden !important;
    }
    
    /* Show only a message */
    body::after {
        content: "This content is protected and cannot be printed.";
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        font-size: 24px;
        font-weight: bold;
        color: #333;
        visibility: visible !important;
    }
}

/* Disable some developer-friendly features */
pre, code {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Security overlay for sensitive sections */
.security-protected {
    position: relative;
}

.security-protected::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    pointer-events: none;
    z-index: 1000;
}

/* Blur sensitive content when devtools might be open */
.devtools-detected .sensitive-blur {
    filter: blur(5px);
    transition: filter 0.3s ease;
}

/* Hide elements that might give away structure */
[style*="display: none"], [hidden] {
    display: none !important;
    visibility: hidden !important;
}

/* Prevent outline on focus that might reveal structure */
*:focus {
    outline: none !important;
}

/* Custom focus styles for accessibility while maintaining security */
input:focus, textarea:focus, button:focus, select:focus {
    outline: 2px solid var(--accent-color, #10b981) !important;
    outline-offset: 2px;
}

/* Additional mobile security */
@media (max-width: 768px) {
    /* Disable zoom on mobile to prevent inspection */
    html {
        -webkit-text-size-adjust: 100%;
        -ms-text-size-adjust: 100%;
        text-size-adjust: 100%;
    }
    
    /* Prevent long press context menu on mobile */
    * {
        -webkit-touch-callout: none !important;
    }
}

/* Disable some CSS animations that might be used for timing attacks */
.security-mode * {
    animation-duration: 0s !important;
    animation-delay: 0s !important;
    transition-duration: 0s !important;
    transition-delay: 0s !important;
}

/* Protect against potential CSS injection */
[style*="expression"], [style*="javascript:"], [style*="vbscript:"] {
    display: none !important;
    visibility: hidden !important;
}
