/* Advertisement Styles */
/* Centralized CSS for all banner ads */

.banner {
    position: fixed;
    background: rgba(0, 0, 0, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    padding: 8px;
    display: none;
    z-index: 9999;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.banner:hover {
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.7);
}

/* Close Button */
.banner .close-btn {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 30px;
    height: 30px;
    background: #e50914;
    color: white;
    border: 2px solid white;
    border-radius: 50%;
    display: block; /* Changed from 'none' to 'block' to show immediately */
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    line-height: 26px;
    text-align: center;
    z-index: 10000;
    transition: all 0.2s ease;
}

.banner .close-btn:hover {
    background: #ff0a1a;
    transform: scale(1.1);
}

/* Banner Positions */
.banner-top {
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateX(-380px); /* Shift left to make room for bottomBanner */
    width: 468px; /* Exact width */
    height: 80px; /* Exact height */
    padding: 0; /* No padding */
    background: transparent; /* No background */
    border: none; /* No border */
    box-shadow: none; /* No shadow */
}

.banner-top .close-btn {
    top: 0px;
    right: 0px;
    width: 24px;
    height: 24px;
    font-size: 14px;
    line-height: 20px;
    z-index: 10001;
    pointer-events: auto;
}

.banner-bottom {
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateX(240px); /* Shift right next to topBanner */
    width: 728px; /* Exact width */
    height: 110px; /* Exact height */
    padding: 0; /* No padding */
    background: transparent; /* No background */
    border: none; /* No border */
    box-shadow: none; /* No shadow */
}

.banner-bottom .close-btn {
    top: 0px;
    right: 0px;
    width: 24px;
    height: 24px;
    font-size: 14px;
    line-height: 20px;
    z-index: 10001;
    pointer-events: auto;
}

.banner-left {
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 160px; /* Exact width - no min-width */
    height: 600px; /* Exact height - no min-height */
    padding: 0; /* No padding for sidebar ads */
    background: transparent; /* No background */
    border: none; /* No border */
    box-shadow: none; /* No shadow */
}

.banner-left .close-btn {
    top: 0px; /* Position at top edge */
    right: 0px; /* Position at right edge */
    width: 24px; /* Smaller close button */
    height: 24px;
    font-size: 14px;
    line-height: 20px;
    z-index: 10001; /* Higher than banner z-index to appear above ads */
    pointer-events: auto; /* Ensure button is clickable */
}

.banner-right {
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 160px; /* Exact width - no min-width */
    height: 600px; /* Exact height - no min-height */
    padding: 0; /* No padding for sidebar ads */
    background: transparent; /* No background */
    border: none; /* No border */
    box-shadow: none; /* No shadow */
}

.banner-right .close-btn {
    top: 0px; /* Position at top edge */
    right: 0px; /* Position at right edge */
    width: 24px; /* Smaller close button */
    height: 24px;
    font-size: 14px;
    line-height: 20px;
    z-index: 10001; /* Higher than banner z-index to appear above ads */
    pointer-events: auto; /* Ensure button is clickable */
}

/* Responsive Adjustments */
@media (max-width: 1200px) {
    .banner-left,
    .banner-right {
        display: none !important;
    }

    /* On smaller screens, stack the bottom banners vertically */
    .banner-top {
        transform: translateX(-50%);
        bottom: 130px; /* Stack above banner-bottom */
    }

    .banner-bottom {
        transform: translateX(-50%);
        bottom: 20px;
    }
}

@media (max-width: 768px) {
    .banner-top,
    .banner-bottom {
        left: 50%;
        transform: translateX(-50%);
        max-width: calc(100% - 20px);
    }

    .banner-top {
        bottom: 130px;
    }

    .banner-bottom {
        bottom: 20px;
    }

    .banner iframe {
        max-width: 100%;
        height: auto;
    }

    /* Adjust sizes for mobile */
    #banner-topBanner .ad-wrapper iframe {
        width: 100%;
        max-width: 468px;
    }

    #banner-bottomBanner .ad-wrapper iframe {
        width: 100%;
        max-width: 728px;
    }
}

/* Animation */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.banner {
    animation: slideIn 0.5s ease-out;
}

/* Ad Wrapper and Iframe Styles */
.ad-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 1; /* Lower than close button */
}

.ad-wrapper iframe {
    border: none;
    overflow: hidden;
}

/* Ensure ad wrappers don't interfere with close button */
.banner-left .ad-wrapper,
.banner-right .ad-wrapper,
.banner-top .ad-wrapper,
.banner-bottom .ad-wrapper {
    pointer-events: none; /* Allow clicks to pass through to close button */
}

.banner-left .ad-wrapper iframe,
.banner-right .ad-wrapper iframe,
.banner-top .ad-wrapper iframe,
.banner-bottom .ad-wrapper iframe {
    pointer-events: auto; /* But allow clicks on the ad itself */
}

/* Specific size adjustments for each banner type */
#banner-topBanner .ad-wrapper iframe {
    width: 468px;
    height: 60px;
}

#banner-bottomBanner .ad-wrapper iframe {
    width: 728px;
    height: 90px;
}

#banner-leftSidebar .ad-wrapper iframe {
    width: 160px;
    height: 600px;
}

#banner-rightSidebar .ad-wrapper iframe {
    width: 160px;
    height: 600px;
}

/* Player Page Adjustments */
.player-page .banner-top {
    bottom: 20px;
    transform: translateX(-50%) translateX(-380px);
}

.player-page .banner-bottom {
    bottom: 20px;
    transform: translateX(-50%) translateX(240px);
}
