/**
 * StreamBox - Advertisement Zones Styling (Premium)
 * Premium ad zone styling for better integration
 * 
 * @package StreamBox
 * @since 1.0.0
 */

/* ===============================================
   AD ZONE CONTAINER
   =============================================== */

.streambox-ad-zone {
    position: relative;
    margin: 2rem auto;
    text-align: center;
    max-width: 100%;
    overflow: hidden;
}

/* Ad Label */
.streambox-ad-zone .ad-label {
    display: inline-block;
    font-size: 0.75rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

/* Ad Content Wrapper */
.streambox-ad-zone .ad-content {
    position: relative;
    background: rgba(15, 23, 42, 0.3);
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    overflow: hidden;
    display: inline-block;
    max-width: 100%;
}

.streambox-ad-zone .ad-content > * {
    max-width: 100%;
    height: auto;
}

.streambox-ad-zone .ad-content::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.streambox-ad-zone:hover .ad-content::before {
    opacity: 1;
}

/* ===============================================
   SPECIFIC AD ZONES
   =============================================== */

/* Header Banner */
.ad-zone-header_banner,
.ad-header-banner {
    max-width: 728px;
    margin: 2rem auto;
    padding: 1rem 0;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.ad-zone-header_banner .ad-content {
    min-height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Sidebar Ads */
.ad-zone-sidebar_top,
.ad-zone-sidebar_middle {
    margin: 1.5rem 0;
    max-width: 300px;
}

.ad-zone-sidebar_top .ad-content {
    min-height: 250px;
}

.ad-zone-sidebar_middle .ad-content {
    min-height: 600px;
}

/* Content Ads */
.ad-zone-content_top,
.ad-zone-content_bottom,
.ad-content-top,
.ad-content-bottom {
    max-width: 970px;
    margin: 3rem auto;
    padding: 2rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.ad-zone-content_top .ad-content,
.ad-zone-content_bottom .ad-content,
.ad-content-top .ad-content,
.ad-content-bottom .ad-content {
    min-height: 90px;
}

.ad-zone-content_middle {
    max-width: 336px;
    margin: 2rem auto;
}

.ad-zone-content_middle .ad-content {
    min-height: 280px;
}

/* Footer Banner */
.ad-zone-footer_banner,
.ad-footer-banner {
    max-width: 970px;
    margin: 3rem auto;
    padding: 2rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.ad-zone-footer_banner .ad-content,
.ad-footer-banner .ad-content {
    min-height: 90px;
}

/* Between Posts (Grid) */
.ad-between-posts {
    max-width: 300px;
    margin: 1rem auto;
}

.ad-between-posts .ad-content {
    min-height: 250px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* Mobile Anchor Ad */
.streambox-mobile-anchor-ad {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: #fff;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.15);
    animation: slideUpAd 0.4s ease-out;
}

@keyframes slideUpAd {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.streambox-mobile-anchor-ad .close-anchor-ad {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.2s ease;
}

.streambox-mobile-anchor-ad .close-anchor-ad:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.1);
}

/* ===============================================
   RESPONSIVE AD STYLING
   =============================================== */

@media (max-width: 1200px) {
    .ad-zone-content_top,
    .ad-zone-content_bottom,
    .ad-zone-footer_banner,
    .ad-content-top,
    .ad-content-bottom,
    .ad-footer-banner {
        max-width: 728px;
    }
}

@media (max-width: 768px) {
    .streambox-ad-zone {
        margin: 1.5rem auto;
    }
    
    .ad-zone-content_middle {
        float: none;
        margin-left: auto;
        margin-right: auto;
        max-width: 100%;
    }
    
    .ad-zone-header_banner,
    .ad-zone-content_top,
    .ad-zone-content_bottom,
    .ad-zone-footer_banner,
    .ad-header-banner,
    .ad-content-top,
    .ad-content-bottom,
    .ad-footer-banner {
        max-width: 100%;
    }
    
    .ad-zone-header_banner .ad-content,
    .ad-zone-content_top .ad-content,
    .ad-zone-content_bottom .ad-content,
    .ad-header-banner .ad-content,
    .ad-content-top .ad-content,
    .ad-content-bottom .ad-content {
        min-height: 50px;
    }
    
    .ad-zone-sidebar_top,
    .ad-zone-sidebar_middle,
    .ad-sidebar-top,
    .ad-sidebar-middle {
        max-width: 100%;
    }
}

/* ===============================================
   AD LOADING STATE
   =============================================== */

.streambox-ad-zone.is-loading .ad-content {
    position: relative;
    overflow: hidden;
}

.streambox-ad-zone.is-loading .ad-content::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* ===============================================
   PREMIUM AD STYLES
   =============================================== */

/* Glassmorphism Effect */
.streambox-ad-zone.ad-style-glass .ad-content {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Neon Border Effect */
.streambox-ad-zone.ad-style-neon .ad-content {
    border: 2px solid transparent;
    background: linear-gradient(#0f172a, #0f172a) padding-box,
                linear-gradient(135deg, #667eea, #764ba2) border-box;
}

/* Minimal Clean Style */
.streambox-ad-zone.ad-style-minimal .ad-content {
    background: transparent;
    border: none;
    padding: 0;
}

.streambox-ad-zone.ad-style-minimal .ad-label {
    display: none;
}

/* ===============================================
   DARK MODE ADJUSTMENTS
   =============================================== */

@media (prefers-color-scheme: dark) {
    .streambox-mobile-anchor-ad {
        background: #1e293b;
        box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.5);
    }
}

/* ===============================================
   AD BLOCK DETECTION MESSAGE
   =============================================== */

.ad-block-notice {
    background: rgba(239, 68, 68, 0.1);
    border: 2px dashed #ef4444;
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    color: #ef4444;
    font-size: 0.875rem;
}

.ad-block-notice strong {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

/* ===============================================
   PRINT STYLES
   =============================================== */

@media print {
    .streambox-ad-zone,
    .streambox-mobile-anchor-ad {
        display: none !important;
    }
}.streambox-mobile-anchor-ad .close-anchor-ad {
    transition: transform 0.2s, opacity 0.2s;
}

.streambox-mobile-anchor-ad .close-anchor-ad:hover {
    transform: scale(1.1);
    opacity: 1;
}

/* Widget Ad */
.widget-ad {
    margin: 0;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .ad-header-banner,
    .ad-footer-banner,
    .ad-content-top,
    .ad-content-bottom {
        padding: 1rem 0;
        margin: 1.5rem auto;
    }
    
    .ad-content-middle {
        padding: 1rem;
        margin: 1.5rem auto;
    }
    
    /* Hide large ads on mobile */
    .ad-zone-content_top,
    .ad-zone-footer_banner {
        display: none;
    }
}

@media (min-width: 769px) {
    /* Hide mobile anchor on desktop */
    .streambox-mobile-anchor-ad {
        display: none !important;
    }
}

/* Ad Loading State */
.streambox-ad-zone.loading {
    min-height: 90px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 0.5rem;
    position: relative;
}

.streambox-ad-zone.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--color-accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Ad Error State */
.streambox-ad-zone.error {
    display: none;
}

/* Premium Glass Effect for Ads */
.streambox-ad-zone.glass {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* Ad Hover Effects */
.streambox-ad-zone:hover {
    border-color: rgba(255, 255, 255, 0.15);
}

/* Center ads properly */
.streambox-ad-zone iframe,
.streambox-ad-zone ins {
    margin: 0 auto;
}
