/**
 * ADSENSE FIX - CRITICAL CSS
 * This file ensures AdSense ads are NEVER blocked by other CSS
 * Load this LAST in your HTML to override all other styles
 */

/* Force AdSense elements to be visible */
.adsbygoogle,
ins.adsbygoogle,
ins[class*="adsbygoogle"],
ins[data-ad-client] {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    z-index: 1 !important;
    overflow: visible !important;
    height: auto !important;
    min-height: 50px !important;
    width: auto !important;
    max-width: 100% !important;
    margin: 20px auto !important;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
    pointer-events: auto !important;
    user-select: auto !important;
    -webkit-user-select: auto !important;
    -moz-user-select: auto !important;
    -ms-user-select: auto !important;
    transform: none !important;
    filter: none !important;
    clip-path: none !important;
    mask: none !important;
}

/* Ensure AdSense iframes are visible */
iframe[src*="googlesyndication"],
iframe[src*="doubleclick"],
iframe[src*="googleadservices"],
iframe[id*="google_ads"],
iframe[id*="aswift"] {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    width: 100% !important;
    height: auto !important;
    min-height: 50px !important;
    border: none !important;
    overflow: visible !important;
    pointer-events: auto !important;
    z-index: 1 !important;
}

/* AdSense container wrapper */
.adsbygoogle-container,
div[class*="ad-container"],
div[class*="adsense"] {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    overflow: visible !important;
    height: auto !important;
    min-height: 90px !important;
    margin: 20px 0 !important;
}

/* Prevent any parent from hiding ads */
body .adsbygoogle,
main .adsbygoogle,
section .adsbygoogle,
div .adsbygoogle,
article .adsbygoogle {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Override any responsive hiding */
@media (max-width: 768px) {
    .adsbygoogle,
    ins.adsbygoogle {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
}

@media (max-width: 480px) {
    .adsbygoogle,
    ins.adsbygoogle {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
}

/* Ensure ad loading state is visible */
.adsbygoogle[data-ad-status="unfilled"] {
    display: block !important;
    min-height: 50px !important;
    background: #f5f5f5 !important;
}

/* AdSense placeholder when loading */
.adsbygoogle:empty {
    min-height: 90px !important;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%) !important;
    background-size: 200% 100% !important;
    animation: adLoading 1.5s infinite !important;
}

@keyframes adLoading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Prevent ad blocking by overlays */
.adsbygoogle::before,
.adsbygoogle::after {
    content: none !important;
    display: none !important;
}

/* Ensure parent containers don't hide ads */
.tracker-section .adsbygoogle,
.tracker-header .adsbygoogle,
.tracker-title-area .adsbygoogle {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    z-index: 10 !important;
}

/* Allow clicks on ads */
.adsbygoogle,
.adsbygoogle * {
    pointer-events: auto !important;
    user-select: auto !important;
}

/* Prevent filters from affecting ads */
.adsbygoogle img,
.adsbygoogle iframe {
    filter: none !important;
    -webkit-filter: none !important;
}

/* Debug mode - shows ad slots clearly */
.adsbygoogle-debug {
    border: 2px dashed #4285f4 !important;
    background: rgba(66, 133, 244, 0.05) !important;
    padding: 10px !important;
}

.adsbygoogle-debug::before {
    content: "AdSense Ad Slot" !important;
    display: block !important;
    color: #4285f4 !important;
    font-size: 12px !important;
    margin-bottom: 10px !important;
    font-weight: bold !important;
}

/* Responsive ad sizing */
.adsbygoogle[data-ad-format="auto"],
.adsbygoogle[data-full-width-responsive="true"] {
    width: 100% !important;
    max-width: 100% !important;
    display: block !important;
}

/* Ensure minimum space for ads */
.adsbygoogle[data-ad-format="rectangle"] {
    min-height: 250px !important;
}

.adsbygoogle[data-ad-format="horizontal"] {
    min-height: 90px !important;
}

.adsbygoogle[data-ad-format="vertical"] {
    min-height: 600px !important;
}

/* Critical: Prevent JavaScript from hiding ads */
.adsbygoogle[style*="display: none"],
.adsbygoogle[style*="visibility: hidden"],
.adsbygoogle[style*="opacity: 0"] {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Ensure ads work in flex/grid layouts */
.adsbygoogle {
    flex-shrink: 0 !important;
    grid-column: 1 / -1 !important;
}

/* Prevent parent overflow from hiding ads */
* > .adsbygoogle {
    overflow: visible !important;
}

/* Mobile optimization */
@media (max-width: 768px) {
    .adsbygoogle {
        margin: 15px 0 !important;
        padding: 0 10px !important;
        box-sizing: border-box !important;
    }
}

/* Print: hide ads */
@media print {
    .adsbygoogle {
        display: none !important;
    }
}

/* Accessibility: allow screen readers */
.adsbygoogle[aria-hidden="true"] {
    display: block !important;
    visibility: visible !important;
}

