/* Client-side Protection CSS */

/* Disable text selection globally */
* {
    -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;
}

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

/* Disable image dragging */
img {
    -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: none !important;
}

/* Re-enable pointer events for interactive images */
img.interactive,
button img,
a img {
    pointer-events: auto !important;
}

/* Disable print styles */
@media print {
    * {
        display: none !important;
    }
    
    body::before {
        content: "Printing is disabled for security reasons.";
        display: block !important;
        font-size: 24px;
        text-align: center;
        margin-top: 50px;
        color: #000;
    }
}

/* Hide scrollbars to prevent inspection */
::-webkit-scrollbar {
    width: 0px;
    background: transparent;
}

/* Disable highlighting */
::selection {
    background: transparent !important;
}

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

/* Protection overlay for sensitive content */
.protected-content {
    position: relative;
    overflow: hidden;
}

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

/* Blur effect when DevTools detected */
.devtools-detected {
    filter: blur(5px) !important;
    pointer-events: none !important;
}

.devtools-detected::after {
    content: 'Developer Tools Detected - Access Restricted';
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(239, 68, 68, 0.95);
    color: white;
    padding: 20px 40px;
    border-radius: 10px;
    font-size: 18px;
    font-weight: bold;
    z-index: 999999;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* Security warning styles */
.security-warning {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    font-weight: 500;
    z-index: 999999;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
    max-width: 300px;
    word-wrap: break-word;
    animation: slideInRight 0.3s ease-out;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.security-warning::before {
    content: '⚠️';
    margin-right: 8px;
    font-size: 16px;
}

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

/* Disable context menu styling */
.no-context-menu {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Watermark overlay */
.watermark-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    background-image: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 100px,
        rgba(0, 0, 0, 0.02) 100px,
        rgba(0, 0, 0, 0.02) 200px
    );
}

/* Disable F12 key visual feedback */
.f12-disabled {
    outline: none !important;
    border: none !important;
}

/* Protection status indicator */
.protection-status {
    position: fixed;
    bottom: 10px;
    left: 10px;
    background: rgba(34, 197, 94, 0.9);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 500;
    z-index: 999998;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.protection-status:hover {
    opacity: 1;
}

.protection-status::before {
    content: '🔒';
    margin-right: 4px;
}

/* Disable browser zoom */
.no-zoom {
    touch-action: pan-x pan-y !important;
    -ms-touch-action: pan-x pan-y !important;
}

/* Hide sensitive data when window loses focus */
.window-blurred .sensitive-data {
    filter: blur(10px);
    transition: filter 0.3s ease;
}

/* Disable copy-paste visual feedback */
.no-copy {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Protection for specific elements */
.protect-text {
    -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;
}

.protect-image {
    -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: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;
}

/* Mobile specific protections */
@media (max-width: 768px) {
    /* Disable long press context menu on mobile */
    * {
        -webkit-touch-callout: none !important;
        -webkit-user-select: none !important;
        -webkit-tap-highlight-color: transparent !important;
    }
    
    /* Disable zoom on mobile */
    body {
        touch-action: pan-x pan-y !important;
        -ms-touch-action: pan-x pan-y !important;
    }
    
    /* Disable text selection on mobile */
    input, textarea {
        -webkit-user-select: text !important;
        user-select: text !important;
    }
}

/* High contrast mode detection and protection */
@media (prefers-contrast: high) {
    .security-warning {
        background: #000 !important;
        border: 2px solid #fff !important;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .security-warning {
        animation: none;
    }
    
    .devtools-detected {
        transition: none !important;
    }
}

/* Dark mode support for security elements */
@media (prefers-color-scheme: dark) {
    .security-warning {
        background: linear-gradient(135deg, #dc2626, #991b1b);
        border: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .protection-status {
        background: rgba(22, 163, 74, 0.9);
    }
}
