/**
 * Smart Content Overlay - Frontend Styles
 * Version: 2.0.0
 * 
 * CRITICAL: pointer-events: none allows clicks to pass through overlays
 * This ensures ads remain clickable and links work normally
 */

/* ==========================================================================
   Overlay Wrapper - CRITICAL STYLES
   ========================================================================== */

.sco-overlay {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 999999 !important;
    pointer-events: none !important; /* CRITICAL - allows clicks through */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    font-weight: bold !important;
    color: #fff !important;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8) !important;
    line-height: 1.4 !important;
    box-sizing: border-box !important;
}

/* Ensure overlay doesn't interfere with page layout */
.sco-overlay * {
    box-sizing: border-box !important;
}

/* ==========================================================================
   Overlay Text Container
   ========================================================================== */

.sco-overlay-text {
    padding: 10px 20px !important;
    background: rgba(0, 0, 0, 0.4) !important;
    border-radius: 5px !important;
    pointer-events: none !important; /* CRITICAL - text also non-clickable */
    text-align: center !important;
    font-size: 16px !important;
    max-width: 90% !important;
    word-wrap: break-word !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
}

/* ==========================================================================
   Covered Element Positioning
   ========================================================================== */

.sco-covered {
    position: relative !important;
}

/* Special handling for inline elements */
span.sco-covered,
a.sco-covered {
    display: inline-block !important;
}

/* ==========================================================================
   Mobile Responsive Design
   ========================================================================== */

@media screen and (max-width: 768px) {
    .sco-overlay-text {
        font-size: 14px !important;
        padding: 8px 15px !important;
        letter-spacing: 0.5px !important;
    }
    
    .sco-overlay {
        text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8) !important;
    }
}

@media screen and (max-width: 480px) {
    .sco-overlay-text {
        font-size: 12px !important;
        padding: 6px 12px !important;
        max-width: 95% !important;
    }
}

/* ==========================================================================
   Print Styles - Hide overlays when printing
   ========================================================================== */

@media print {
    .sco-overlay {
        display: none !important;
    }
}

/* ==========================================================================
   Accessibility - Ensure overlays don't interfere with screen readers
   ========================================================================== */

.sco-overlay {
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;
}

/* ==========================================================================
   Performance Optimizations
   ========================================================================== */

.sco-overlay {
    will-change: opacity !important;
    backface-visibility: hidden !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
}

/* ==========================================================================
   Browser Compatibility
   ========================================================================== */

/* Ensure pointer-events works in older browsers */
.sco-overlay {
    -ms-touch-action: none !important;
    touch-action: none !important;
}

/* IE10+ specific */
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
    .sco-overlay {
        pointer-events: none !important;
    }
}

/* ==========================================================================
   Special Cases - Ad Networks
   ========================================================================== */

/* Google AdSense specific */
ins.adsbygoogle.sco-covered {
    position: relative !important;
    display: block !important;
}

/* iFrame containers */
iframe.sco-covered {
    position: relative !important;
}

/* Ad containers that might have specific positioning */
[data-ad-client].sco-covered,
[id*="ad"].sco-covered,
[class*="ad"].sco-covered {
    position: relative !important;
}

/* ==========================================================================
   Animation (Optional - can be enabled if desired)
   ========================================================================== */

.sco-overlay {
    animation: scoFadeIn 0.3s ease-in-out !important;
}

@keyframes scoFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ==========================================================================
   Debug Mode (Optional - remove in production)
   ========================================================================== */

/* Uncomment to see overlay boundaries for debugging
.sco-overlay {
    outline: 2px dashed red !important;
}
*/
