/**
 * Security CSS
 * This file implements various CSS-based protections against copying and inspection
 */

/* Security and Copy Protection Styles */

/* Prevent text selection and copying */
* {
    -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 only for specific elements that need it */
input, textarea, select, [contenteditable="true"] {
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
    user-select: text !important;
}

/* Prevent drag and drop of images */
img, svg, video, audio {
    -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;
}

/* Allow pointer events for interactive images (like buttons) */
img[onclick], img[role="button"], svg[onclick], svg[role="button"] {
    pointer-events: auto !important;
}

/* Prevent context menu (right-click) */
body {
    -webkit-context-menu: none !important;
    -moz-context-menu: none !important;
    context-menu: none !important;
}

/* Disable text selection on specific elements */
h1, h2, h3, h4, h5, h6, p, span, div, a, li, td, th {
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;
}

/* Allow selection only for form inputs and content that should be copyable */
input, textarea, select, [contenteditable="true"], .copyable {
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
    user-select: text !important;
}

/* Prevent copying via keyboard shortcuts */
body {
    -webkit-touch-callout: none !important;
    -webkit-user-select: none !important;
    -khtml-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;
}

/* Disable image saving */
img {
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: 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;
}

/* Prevent printing (optional - remove if you want to allow printing) */
@media print {
    * {
        display: none !important;
    }
}

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

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

/* Prevent text selection on specific elements */
.no-select {
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;
}

/* Allow selection for specific elements that need it */
.allow-select {
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
    user-select: text !important;
}

/* Disable image context menu */
img {
    -webkit-context-menu: none !important;
    -moz-context-menu: none !important;
    context-menu: none !important;
}

/* Prevent text copying via CSS */
body {
    -webkit-touch-callout: none !important;
    -webkit-user-select: none !important;
    -khtml-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;
}

/* Disable text selection on all elements by default */
* {
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;
}

/* Re-enable selection for form elements and content that should be copyable */
input, textarea, select, [contenteditable="true"], .copyable, .allow-copy {
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
    user-select: text !important;
}

/* Add watermark when printing */
@media print {
    body::after {
        content: "Tax Members Corporation - Confidential";
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 72px;
        color: rgba(0, 0, 0, 0.2);
        transform: rotate(-45deg);
        pointer-events: none;
        z-index: 9999;
    }
    
    /* Hide content when printing */
    body > * {
        display: none !important;
    }
    
    /* Show only a message */
    body::before {
        content: "Printing is disabled for security reasons. Please contact Tax Members Corporation for official documents.";
        display: block !important;
        font-size: 24px;
        text-align: center;
        margin-top: 100px;
        color: #000;
    }
}

/* Hide content when developer tools might be open (large screen height) */
@media screen and (min-height: 2000px) {
    /* Only hide specific elements, not the entire body */
    .security-sensitive {
        visibility: hidden;
    }
    
    /* Show a warning instead of hiding everything */
    body::after {
        visibility: visible;
        content: "Security Notice: Large screen detected";
        position: fixed;
        top: 10px;
        right: 10px;
        background: rgba(255, 0, 0, 0.9);
        color: white;
        padding: 5px 10px;
        border-radius: 4px;
        font-size: 12px;
        z-index: 10000;
        pointer-events: none;
    }
}

/* Add subtle watermark to all pages */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMDAiIGhlaWdodD0iMzAwIj48dGV4dCB4PSIwIiB5PSIyMCIgZm9udC1mYW1pbHk9IkFyaWFsIiBmb250LXNpemU9IjIwIiBmaWxsPSJyZ2JhKDAsMCwwLDAuMDMpIiB0cmFuc2Zvcm09InJvdGF0ZSg0NSkiPlRheCBNZW1iZXJzIENvcnBvcmF0aW9uPC90ZXh0Pjwvc3ZnPg==");
    pointer-events: none;
    z-index: -1;
    opacity: 0.05;
}

/* Hide from screen readers */
.security-message {
    position: absolute;
    left: -9999px;
    top: -9999px;
}

/* Add invisible elements to confuse scrapers */
body::after {
    content: attr(data-protection);
    display: block;
    height: 0;
    overflow: hidden;
    visibility: hidden;
} 