/* AdhubMedia - Advanced Ad Positioning Styles */

/* Mobile Top Banner (320x50) */
.adhub-ad-mobile_top_ad {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: rgba(255, 255, 255, 0.98);
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 50px;
    backdrop-filter: blur(8px);
}

/* Compensate for mobile top banner */
@media (max-width: 768px) {
    body.has-mobile-top-ad {
        padding-top: 50px;
    }
    
    body.has-mobile-top-ad .site-header {
        top: 50px;
    }
}

/* Skin Advertisement (Desktop) */
.adhub-ad-skin_ad {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: -1;
    pointer-events: none;
}

.adhub-ad-skin_ad .adhub-ad-content {
    pointer-events: auto;
}

/* Skin positioning variants */
.adhub-ad-skin_ad.skin-left {
    background-position: left center;
    background-repeat: no-repeat;
}

.adhub-ad-skin_ad.skin-right {
    background-position: right center;
    background-repeat: no-repeat;
}

.adhub-ad-skin_ad.skin-full {
    background-size: cover;
    background-position: center center;
}

/* Hide skin on mobile */
@media (max-width: 1200px) {
    .adhub-ad-skin_ad {
        display: none;
    }
}

/* Video Player Sticky */
.adhub-ad-videoplayer_sticky_ad {
    position: fixed;
    bottom: 80px;
    right: 20px;
    z-index: 1000;
    max-width: 300px;
    background: rgba(0, 0, 0, 0.9);
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transform: translateY(100%);
    transition: transform 0.3s ease-in-out;
}

.adhub-ad-videoplayer_sticky_ad.is-visible {
    transform: translateY(0);
}

.adhub-ad-videoplayer_sticky_ad .close-button {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(255, 255, 255, 0.8);
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
    color: #333;
}

/* Mobile adjustments for video sticky */
@media (max-width: 768px) {
    .adhub-ad-videoplayer_sticky_ad {
        right: 10px;
        bottom: 60px;
        max-width: 250px;
    }
}

/* Floor Ad (Mobile) */
.adhub-ad-floor_ad {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9998;
    background: rgba(255, 255, 255, 0.98);
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 50px;
    backdrop-filter: blur(8px);
}

.adhub-ad-floor_ad .close-button {
    position: absolute;
    top: 5px;
    right: 10px;
    background: none;
    border: none;
    font-size: 18px;
    color: #666;
    cursor: pointer;
    line-height: 1;
}

/* Hide floor ad on desktop */
@media (min-width: 769px) {
    .adhub-ad-floor_ad {
        display: none;
    }
}

/* Compensate for floor ad on mobile */
@media (max-width: 768px) {
    body.has-floor-ad {
        padding-bottom: 50px;
    }
}

/* General Ad Container Improvements */
.adhub-ad-container {
    position: relative;
    margin: 0 auto;
    text-align: center;
}

/* Lazy Loading Placeholder Enhancements */
.adhub-ad-lazy .adhub-ad-placeholder {
    background: linear-gradient(90deg, #f0f0f0 25%, transparent 37%, transparent 63%, #f0f0f0 75%);
    background-size: 400% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
}

@keyframes shimmer {
    0% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .adhub-ad-mobile_top_ad {
        background: rgba(17, 24, 39, 0.98);
        border-bottom-color: #374151;
    }
    
    .adhub-ad-floor_ad {
        background: rgba(17, 24, 39, 0.98);
        border-top-color: #374151;
    }
    
    .adhub-ad-lazy .adhub-ad-placeholder {
        background: linear-gradient(90deg, #374151 25%, transparent 37%, transparent 63%, #374151 75%);
        background-size: 400% 100%;
    }
}

/* Responsive Ad Sizes */
.adhub-ad-300x250 {
    width: 300px;
    height: 250px;
}

.adhub-ad-300x600 {
    width: 300px;
    height: 600px;
}

.adhub-ad-728x90 {
    width: 728px;
    height: 90px;
}

.adhub-ad-320x50 {
    width: 320px;
    height: 50px;
}

.adhub-ad-160x600 {
    width: 160px;
    height: 600px;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .adhub-ad-728x90 {
        width: 320px;
        height: 50px;
    }
    
    .adhub-ad-300x600,
    .adhub-ad-300x250 {
        width: 300px;
        height: auto;
        min-height: 250px;
    }
    
    .adhub-ad-160x600 {
        width: 300px;
        height: 250px;
    }
}

/* Ad Performance Optimizations */
.adhub-ad-container img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

.adhub-ad-container iframe {
    border: 0;
    max-width: 100%;
}

/* Accessibility improvements */
.adhub-ad-container[aria-hidden="true"] {
    display: none;
}

.adhub-ad-container .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* Print styles - hide ads */
@media print {
    .adhub-ad-container,
    .adhub-ad-mobile_top_ad,
    .adhub-ad-skin_ad,
    .adhub-ad-videoplayer_sticky_ad,
    .adhub-ad-floor_ad {
        display: none !important;
    }
}