/**
 * Google AdSense Lazy Loading Styles
 * Performance optimized styles for lazy loaded ads
 */

/* Lazy ad container */
.lazy-ad {
    position: relative;
    min-height: 100px;
    background: transparent;
}

/* Lazy adsense loading state */
.lazy-adsense {
    position: relative;
    display: block;
    min-height: 100px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: adLoading 1.5s ease-in-out infinite;
}

/* Loading animation */
@keyframes adLoading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Ad yüklenirken */
.lazy-adsense.loading {
    opacity: 0.7;
}

/* Ad yüklendikten sonra */
.lazy-adsense.loaded {
    background: transparent;
    animation: none;
    min-height: auto;
}

/* Hata durumu */
.lazy-adsense.error {
    background: #fee;
    border: 1px dashed #f00;
    min-height: 50px;
}

/* Google Ads Container */
.google-ads-container {
    position: relative;
    margin: 0 auto;
    text-align: center;
}

/* Responsive ad units */
.google-ads-container ins.adsbygoogle {
    display: block;
}

/* Performance: Will-change for smooth animations */
.lazy-ad,
.lazy-adsense {
    will-change: opacity;
}

/* Prevent layout shift */
.lazy-ad[data-ad-loaded="false"] {
    min-height: 100px;
    background: #f9f9f9;
}

.lazy-ad[data-ad-loaded="true"] {
    min-height: auto;
    background: transparent;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .lazy-adsense {
        background: linear-gradient(90deg, #2a2a2a 25%, #1a1a1a 50%, #2a2a2a 75%);
        background-size: 200% 100%;
    }
    
    .lazy-ad[data-ad-loaded="false"] {
        background: #1a1a1a;
    }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    .lazy-adsense {
        animation: none;
        background: #f0f0f0;
    }
    
    @media (prefers-color-scheme: dark) {
        .lazy-adsense {
            background: #2a2a2a;
        }
    }
}

/* Hide noscript fallback when JS is enabled */
.lazy-adsense + noscript {
    display: none !important;
}
