/* AI Image Toggle Styles */
#slopstopper-toggle-container {
    position: fixed;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.1);
    padding: 6px 10px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 12px;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    opacity: 0.4;
    transition: opacity 0.3s ease, background 0.3s ease;
}

#slopstopper-toggle-container:hover {
    opacity: 0.9;
    background: rgba(0, 0, 0, 0.25);
}

.slopstopper-toggle-bottom-right {
    bottom: 20px;
    right: 20px;
}

.slopstopper-toggle-bottom-left {
    bottom: 20px;
    left: 20px;
}

.slopstopper-toggle-top-right {
    top: 20px;
    right: 20px;
}

.slopstopper-toggle-top-left {
    top: 20px;
    left: 20px;
}

.slopstopper-toggle-switch {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 18px;
    margin: 0;
}

.slopstopper-toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slopstopper-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.slopstopper-toggle-slider:before {
    position: absolute;
    content: "";
    height: 12px;
    width: 12px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

input:checked + .slopstopper-toggle-slider {
    background-color: #4CAF50;
}

input:checked + .slopstopper-toggle-slider:before {
    transform: translateX(18px);
}

#slopstopper-toggle-label {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    user-select: none;
    white-space: nowrap;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.slopstopper-toggle-icons {
    font-size: 16px;
    line-height: 1;
}

.slopstopper-toggle-icons .slopstopper-icon-show,
.slopstopper-toggle-icons .slopstopper-icon-hide {
    display: inline-block;
    transition: opacity 0.3s ease;
}

/* Handle parallax covers differently - use filter instead of overlay */
.slopstopper-images-hidden [data-ai-bg="true"].has-parallax,
.slopstopper-images-hidden [data-ai-bg="true"][class*="parallax"] {
/*    filter: brightness(0) !important; */
}

/* Ensure relative positioning for overlay to work (non-parallax only) */
.slopstopper-images-hidden [data-ai-bg="true"]:not(.has-parallax) {
    position: relative !important;
}

/* Ensure content stays above overlay - but keep it visible */
.slopstopper-images-hidden [data-ai-bg="true"]:not(.has-parallax) > * {
    position: relative;
    z-index: 2;
}

/* Special handling for WordPress cover blocks to preserve content visibility */
.slopstopper-images-hidden .wp-block-cover[data-ai-bg="true"]:not(.has-parallax) .wp-block-cover__inner-container,
.slopstopper-images-hidden .wp-block-cover[data-ai-bg="true"]:not(.has-parallax) .wp-block-cover-text,
.slopstopper-images-hidden .wp-block-cover[data-ai-bg="true"]:not(.has-parallax) h1,
.slopstopper-images-hidden .wp-block-cover[data-ai-bg="true"]:not(.has-parallax) h2,
.slopstopper-images-hidden .wp-block-cover[data-ai-bg="true"]:not(.has-parallax) h3,
.slopstopper-images-hidden .wp-block-cover[data-ai-bg="true"]:not(.has-parallax) h4,
.slopstopper-images-hidden .wp-block-cover[data-ai-bg="true"]:not(.has-parallax) h5,
.slopstopper-images-hidden .wp-block-cover[data-ai-bg="true"]:not(.has-parallax) h6,
.slopstopper-images-hidden .wp-block-cover[data-ai-bg="true"]:not(.has-parallax) p,
.slopstopper-images-hidden .wp-block-cover[data-ai-bg="true"]:not(.has-parallax) span,
.slopstopper-images-hidden .wp-block-cover[data-ai-bg="true"]:not(.has-parallax) a,
.slopstopper-images-hidden .wp-block-cover[data-ai-bg="true"]:not(.has-parallax) button {
    color: inherit !important;
    text-shadow: inherit !important;
    opacity: 1 !important;
}

/* For parallax covers, ensure content remains visible despite filter */
.slopstopper-images-hidden .wp-block-cover[data-ai-bg="true"].has-parallax .wp-block-cover__inner-container,
.slopstopper-images-hidden .wp-block-cover[data-ai-bg="true"][class*="parallax"] .wp-block-cover__inner-container,
.slopstopper-images-hidden [data-ai-bg="true"].has-parallax *,
.slopstopper-images-hidden [data-ai-bg="true"][class*="parallax"] * {
/*    filter: brightness(1) !important; */
    color: inherit !important;
    text-shadow: inherit !important;
    opacity: 1 !important;
}

/* Handle other common cover/hero section patterns (non-parallax) */
.slopstopper-images-hidden [data-ai-bg="true"]:not(.has-parallax):not([class*="parallax"]).hero-section *,
.slopstopper-images-hidden [data-ai-bg="true"]:not(.has-parallax):not([class*="parallax"]).cover-section *,
.slopstopper-images-hidden [data-ai-bg="true"]:not(.has-parallax):not([class*="parallax"]).banner *,
.slopstopper-images-hidden [data-ai-bg="true"]:not(.has-parallax):not([class*="parallax"])[class*="cover"] *,
.slopstopper-images-hidden [data-ai-bg="true"]:not(.has-parallax):not([class*="parallax"])[class*="hero"] *,
.slopstopper-images-hidden [data-ai-bg="true"]:not(.has-parallax):not([class*="parallax"])[class*="banner"] * {
    color: inherit !important;
    text-shadow: inherit !important;
    opacity: 1 !important;
}

/* AI Post/Page content hiding */
.slopstopper-images-hidden .slopstopper-post {
    display: none !important;
}

.slopstopper-images-hidden .slopstopper-post-hidden {
    display: block !important;
}

/* AI Block content hiding */
.slopstopper-images-hidden .slopstopper-hideable-content {
    display: none !important;
}

.slopstopper-images-hidden .slopstopper-block-hidden {
    display: block !important;
}

@media (max-width: 768px) {
    #slopstopper-toggle-container {
        padding: 5px 8px;
        font-size: 11px;
        opacity: 0.4;
    }
    
    #slopstopper-toggle-container:hover {
        opacity: 0.8;
    }
    
    .slopstopper-toggle-switch {
        width: 30px;
        height: 16px;
    }
    
    .slopstopper-toggle-slider:before {
        height: 10px;
        width: 10px;
        left: 3px;
        bottom: 3px;
    }
    
    input:checked + .slopstopper-toggle-slider:before {
        transform: translateX(14px);
    }
}

/* Target cover blocks specifically */
.slopstopper-images-hidden [data-ai-cover="true"] {
    background-image: none !important;
    background-color: #000 !important;
}

.slopstopper-images-hidden [data-ai-cover="true"] .wp-block-cover__background {
    display: none !important;
}


.slopstopper-images-hidden .slopstopper-slop-image {
/*    filter: brightness(0) !important; */
    background-color: var(--slopstopper-replacement-color, #000000) !important;
}


.slopstopper-images-hidden [data-ai-bg="true"]:not(.has-parallax)::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--slopstopper-replacement-color, #000000);
    background-image: var(--slopstopper-replacement-image, none);
    background-size: var(--slopstopper-replacement-size, auto);
    background-repeat: var(--slopstopper-replacement-repeat, no-repeat);
    z-index: 1;
    pointer-events: none;
}

.slopstopper-images-hidden .wp-block-cover__image-background[data-ai-bg="true"],
.slopstopper-images-hidden .wp-block-cover__image-background.slopstopper-slop-image {
    background-image: var(--slopstopper-replacement-image, none) !important;
    background-color: var(--slopstopper-replacement-color, #000000) !important;
    background-size: var(--slopstopper-replacement-size, auto) !important;
    background-repeat: var(--slopstopper-replacement-repeat, no-repeat) !important;
    opacity: 1 !important;
}