/* AdSense Ad Styling */

/* General ad container styling */
.ad-container {
    margin: 20px 0;
    text-align: center;
    position: relative;
}

.ad-container::before {
    content: 'Advertisement';
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    opacity: 0.7;
}

/* Header banner ad */
.ad-header-banner {
    margin: 16px auto;
    max-width: 728px;
    min-height: 90px;
    background: var(--background-light);
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Sidebar ads */
.ad-sidebar {
    margin: 24px 0;
    background: var(--background-white);
    border-radius: var(--border-radius);
    padding: 16px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    min-height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* In-content ads */
.ad-in-content {
    margin: 32px auto;
    max-width: 100%;
    background: var(--background-light);
    border-radius: var(--border-radius);
    padding: 20px;
    border: 1px solid var(--border-light);
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Footer banner ad */
.ad-footer-banner {
    margin: 20px auto;
    max-width: 728px;
    min-height: 90px;
    background: var(--background-light);
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Mobile banner ad */
.ad-mobile-banner {
    margin: 16px auto;
    max-width: 320px;
    min-height: 50px;
    background: var(--background-light);
    border-radius: var(--border-radius);
    display: none; /* Show only on mobile */
}

/* Article end ad */
.ad-article-end {
    margin: 32px auto;
    background: var(--background-white);
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    max-width: 300px;
    min-height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Between articles ad */
.ad-between-articles {
    margin: 40px auto;
    background: linear-gradient(135deg, #f8f9ff 0%, #e8edff 100%);
    border-radius: var(--border-radius-lg);
    padding: 24px;
    border: 1px solid var(--border-light);
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.ad-between-articles::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary-gradient);
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
}

/* AdSense responsive styling */
.adsbygoogle {
    display: block !important;
}

/* Responsive design */
@media (max-width: 768px) {
    .ad-header-banner,
    .ad-footer-banner {
        display: none; /* Hide large banners on mobile */
    }
    
    .ad-mobile-banner {
        display: flex; /* Show mobile banner */
    }
    
    .ad-sidebar {
        margin: 16px 0;
        padding: 12px;
    }
    
    .ad-in-content {
        margin: 24px auto;
        padding: 16px;
    }
    
    .ad-between-articles {
        margin: 24px auto;
        padding: 16px;
    }
}

@media (max-width: 480px) {
    .ad-container::before {
        font-size: 10px;
        margin-bottom: 6px;
    }
    
    .ad-sidebar,
    .ad-in-content,
    .ad-article-end {
        min-height: 150px;
    }
}

/* Loading state for ads */
.ad-loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Ad blocker detection */
.ad-fallback {
    background: var(--background-light);
    border: 2px dashed var(--border-light);
    border-radius: var(--border-radius);
    padding: 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
}

.ad-fallback i {
    font-size: 24px;
    margin-bottom: 8px;
    opacity: 0.5;
}

/* Sticky sidebar ad */
.ad-sidebar.sticky {
    position: sticky;
    top: 100px;
    z-index: 10;
}

/* Non-intrusive styling */
.ad-container.subtle {
    opacity: 0.9;
    transition: opacity 0.3s ease;
}

.ad-container.subtle:hover {
    opacity: 1;
}