/**
 * Advanced Content Protection - Frontend Styles
 * 
 * Frontend protection styles and warning messages
 *
 * @package AdvancedContentProtection
 * @since 1.0.0
 */

/* ========================================
   CONTENT PROTECTION STYLES
   ======================================== */

/* Disable text selection (applied via JavaScript when enabled) */
.acp-no-select,
.acp-no-select * {
    -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;
}

/* Disable image dragging (applied via JavaScript when enabled) */
.acp-no-drag,
.acp-no-drag 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 non-image elements */
.acp-no-drag *:not(img) {
    pointer-events: auto !important;
}

/* ========================================
   WARNING POPUP STYLES
   ======================================== */
.acp-warning-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 20px 30px;
    border-radius: 12px;
    z-index: 999999;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-width: 400px;
    min-width: 300px;
    text-align: center;
}

.acp-warning-popup.acp-warning-show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.acp-warning-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-direction: column;
}

.acp-warning-icon {
    font-size: 32px;
    margin-bottom: 8px;
    animation: acp-pulse 2s infinite;
}

.acp-warning-text {
    font-size: 16px;
    font-weight: 500;
    line-height: 1.4;
    margin: 0;
}

/* ========================================
   ANIMATIONS
   ======================================== */
@keyframes acp-pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

@keyframes acp-shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-2px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(2px);
    }
}

.acp-shake {
    animation: acp-shake 0.5s ease-in-out;
}

/* ========================================
   WATERMARK STYLES
   ======================================== */
.acp-image-wrapper {
    position: relative !important;
    display: inline-block !important;
    max-width: 100%;
}

.acp-image-wrapper img {
    display: block;
    max-width: 100%;
    height: auto;
}

.acp-watermark,
.acp-watermark-overlay {
    position: absolute;
    pointer-events: none;
    font-family: Arial, sans-serif;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.8);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
    font-size: 14px;
    padding: 4px 8px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1000;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    white-space: nowrap;
    max-width: calc(100% - 20px);
    overflow: hidden;
    text-overflow: ellipsis;
}

.acp-watermark.top-left {
    top: 10px;
    left: 10px;
}

.acp-watermark.top-right {
    top: 10px;
    right: 10px;
}

.acp-watermark.bottom-left {
    bottom: 10px;
    left: 10px;
}

.acp-watermark.bottom-right {
    bottom: 10px;
    right: 10px;
}

.acp-watermark.center {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* ========================================
   PROTECTION OVERLAY
   ======================================== */
.acp-protection-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    z-index: 999;
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* ========================================
   DISABLE PRINT STYLES
   ======================================== */
@media print {
    .acp-no-print,
    .acp-no-print * {
        display: none !important;
        visibility: hidden !important;
    }
}

/* ========================================
   DISABLE SCREENSHOT PROTECTION
   ======================================== */
.acp-screenshot-protection {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
    filter: blur(0px);
    transition: filter 0.3s ease;
}

.acp-screenshot-protection.acp-blur-active {
    filter: blur(5px);
}

/* ========================================
   CUSTOM CURSOR STYLES
   ======================================== */
.acp-no-copy {
    cursor: not-allowed !important;
}

.acp-no-copy * {
    cursor: not-allowed !important;
}

/* ========================================
   MOBILE SPECIFIC STYLES
   ======================================== */
@media (max-width: 768px) {
    .acp-warning-popup {
        max-width: 90vw;
        min-width: 280px;
        padding: 16px 20px;
        margin: 0 20px;
    }
    
    .acp-warning-icon {
        font-size: 28px;
    }
    
    .acp-warning-text {
        font-size: 14px;
    }
}

/* ========================================
   HIGH CONTRAST MODE SUPPORT
   ======================================== */
@media (prefers-contrast: high) {
    .acp-warning-popup {
        background: #000000;
        border: 2px solid #ffffff;
    }
    
    .acp-watermark {
        background: rgba(0, 0, 0, 0.8);
        color: #ffffff;
        text-shadow: none;
        border: 1px solid #ffffff;
    }
}

/* ========================================
   REDUCED MOTION SUPPORT
   ======================================== */
@media (prefers-reduced-motion: reduce) {
    .acp-warning-popup {
        transition: opacity 0.1s ease;
        transform: translate(-50%, -50%) scale(1);
    }
    
    .acp-warning-popup.acp-warning-show {
        transform: translate(-50%, -50%) scale(1);
    }
    
    .acp-warning-icon {
        animation: none;
    }
    
    .acp-shake {
        animation: none;
    }
}

/* ========================================
   DARK MODE SUPPORT
   ======================================== */
@media (prefers-color-scheme: dark) {
    .acp-warning-popup {
        background: rgba(255, 255, 255, 0.95);
        color: #1a1a1a;
        border: 1px solid rgba(0, 0, 0, 0.1);
    }
}

/* ========================================
   ACCESSIBILITY IMPROVEMENTS
   ======================================== */
.acp-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus indicators for keyboard navigation */
.acp-focusable:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* ========================================
   BROWSER SPECIFIC FIXES
   ======================================== */

/* Firefox specific */
@-moz-document url-prefix() {
    .acp-no-select {
        -moz-user-select: none !important;
    }
}

/* Safari specific */
@supports (-webkit-appearance: none) {
    .acp-no-select {
        -webkit-user-select: none !important;
        -webkit-touch-callout: none !important;
    }
}

/* Edge specific */
@supports (-ms-ime-align: auto) {
    .acp-no-select {
        -ms-user-select: none !important;
    }
}

/* ========================================
   UTILITY CLASSES
   ======================================== */
.acp-hidden {
    display: none !important;
}

.acp-invisible {
    visibility: hidden !important;
}

.acp-no-events {
    pointer-events: none !important;
}

.acp-protected {
    position: relative;
}

.acp-protected::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    z-index: 1;
    pointer-events: none;
}

/* ========================================
   PERFORMANCE OPTIMIZATIONS
   ======================================== */
.acp-gpu-accelerated {
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    will-change: transform;
}

.acp-smooth-scroll {
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

/* ========================================
   PRINT PROTECTION
   ======================================== */
@media print {
    .acp-no-print {
        display: none !important;
    }
    
    .acp-print-warning::after {
        content: "⚠️ This content is protected and should not be printed without permission.";
        display: block;
        text-align: center;
        font-weight: bold;
        padding: 20px;
        border: 2px solid #000;
        margin: 20px 0;
    }
}

