/* ========================================
   AD SYSTEM STYLES
   ======================================== */

/* General Ad Container Styles */
.ad-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 2rem auto;
    padding: 1rem;
    background: rgba(30, 41, 59, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    position: relative;
}

.ad-container::before {
    content: 'Advertisement';
    position: absolute;
    top: -10px;
    left: 10px;
    font-size: 0.65rem;
    color: var(--text-muted);
    background: var(--bg-dark);
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ad-link {
    display: block;
    line-height: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.ad-link:hover {
    transform: scale(1.02);
    opacity: 0.9;
}

.ad-image {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    display: block;
}

/* Header Banner Ad */
.ad-header-banner {
    margin: 1rem auto;
    max-width: var(--container-width);
}

.ad-header-banner .ad-image {
    width: 970px;
    height: 250px;
    max-width: 100%;
}

/* Body Banner Ad */
.ad-body-banner {
    margin: 3rem auto;
    max-width: 728px;
}

.ad-body-banner .ad-image {
    width: 728px;
    height: 90px;
    max-width: 100%;
}

/* Side Banner (Skyscraper) */
.ad-side-banner {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    margin: 0;
    padding: 0.5rem;
    background: rgba(30, 41, 59, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.ad-side-banner::before {
    top: 5px;
    left: 5px;
}

.side-banner-left {
    left: 10px;
}

.side-banner-right {
    right: 10px;
}

.ad-side-banner .ad-image {
    width: 160px;
    height: 600px;
}

/* Rectangle Ad */
.ad-rectangle-ad {
    margin: 3rem auto;
    max-width: 336px;
}

.ad-rectangle-ad .ad-image {
    width: 336px;
    height: 280px;
    max-width: 100%;
}

/* Half-Page Ad */
.ad-half-page-ad {
    position: fixed;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    z-index: 100;
    margin: 0;
    padding: 0.5rem;
    background: rgba(30, 41, 59, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.ad-half-page-ad .ad-image {
    width: 300px;
    height: 600px;
}

/* Footer Banner Ad */
.ad-footer-banner {
    margin: 2rem auto;
    max-width: 728px;
}

.ad-footer-banner .ad-image {
    width: 728px;
    height: 90px;
    max-width: 100%;
}

/* CTA Button Style */
.ad-cta-button {
    display: inline-block;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    font-weight: 600;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(56, 189, 248, 0.3);
}

.ad-cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(56, 189, 248, 0.5);
}

/* Mobile Interstitial */
.ad-interstitial-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.ad-interstitial-container {
    position: relative;
    background: var(--bg-card);
    border-radius: 12px;
    padding: 1rem;
    max-width: 90%;
}

.ad-interstitial-close {
    position: absolute;
    top: -15px;
    right: -15px;
    width: 40px;
    height: 40px;
    background: var(--accent-primary);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10001;
}

.ad-interstitial-close:hover {
    background: var(--accent-secondary);
    transform: rotate(90deg);
}

.ad-mobile-interstitial {
    margin: 0;
    padding: 0;
    background: transparent;
    border: none;
}

.ad-mobile-interstitial::before {
    display: none;
}

.ad-mobile-interstitial .ad-image {
    width: 320px;
    height: 480px;
    max-width: 100%;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* ========================================
   RESPONSIVE AD STYLES
   ======================================== */

/* Tablet (768px - 1024px) */
@media (max-width: 1024px) {
    .ad-header-banner .ad-image {
        width: 728px;
        height: 90px;
    }

    .ad-side-banner,
    .ad-half-page-ad {
        display: none;
    }
}

/* Mobile (≤768px) */
@media (max-width: 768px) {
    .ad-container {
        margin: 1.5rem auto;
        padding: 0.75rem;
    }

    .ad-header-banner .ad-image {
        width: 320px;
        height: 100px;
    }

    .ad-body-banner .ad-image {
        width: 320px;
        height: 50px;
    }

    .ad-rectangle-ad .ad-image {
        width: 300px;
        height: 250px;
    }

    .ad-footer-banner .ad-image {
        width: 320px;
        height: 50px;
    }

    .ad-side-banner,
    .ad-half-page-ad {
        display: none;
    }
}

/* Small Mobile (≤576px) */
@media (max-width: 576px) {
    .ad-container {
        margin: 1rem auto;
        padding: 0.5rem;
    }

    .ad-container::before {
        font-size: 0.6rem;
        padding: 1px 6px;
    }
}

/* Desktop Large (1400px+) */
@media (min-width: 1400px) {
    .side-banner-left {
        left: 20px;
    }

    .side-banner-right {
        right: 20px;
    }
}

/* Hide side banners on smaller screens to avoid content overlap */
@media (max-width: 1280px) {

    .ad-side-banner,
    .ad-half-page-ad {
        display: none !important;
    }
}