/**
 * Ads Styling
 * CSS for banner ads display across the site
 */

/* Ad Container Base */
.ad-container {
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    margin: 0 auto;
    max-width: 100%;
}

/* Ad Unit Base */
.ad-unit {
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 100%;
    overflow: hidden;
}

/* Ad Link */
.ad-link {
    display: block;
    line-height: 0;
}

.ad-link:hover {
    opacity: 0.95;
}

/* Ad Image */
.ad-image {
    display: block;
    max-width: 100%;
    height: auto;
}

/* Ad Video */
.ad-video {
    display: block;
    max-width: 100%;
}

/* Slot-specific Styles */

/* Header Top */
.ad-slot-header_top {
    margin-bottom: 20px;
    padding: 10px 0;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

/* Content Top */
.ad-slot-content_top {
    margin-bottom: 24px;
}

/* Content Bottom */
.ad-slot-content_bottom {
    margin-top: 24px;
    padding-top: 20px;
    padding-bottom: 120px; /* Space for fixed bottom player */
    border-top: 1px solid var(--border);
}

/* Sidebar Ads */
.sidebar-ad-section {
    padding: 10px;
    border-top: 1px solid var(--border);
    overflow: hidden;
}

.sidebar-ad-section .ad-container {
    width: 100%;
    display: flex;
    justify-content: center;
}

.sidebar-ad-section .ad-unit {
    max-width: 200px;
}

.sidebar-ad-section .ad-unit iframe {
    border: none;
    border-radius: 8px;
}

.sidebar-ad-section .ad-image {
    width: 100%;
    height: auto;
    border-radius: 8px;
}

/* Player Top/Bottom Ads */
.ad-slot-player_top {
    margin-bottom: 16px;
}

.ad-slot-player_bottom {
    margin-top: 16px;
}

/* Footer Ads */
.ad-slot-footer_top {
    padding: 20px 0;
    background: rgba(0, 0, 0, 0.3);
}

.ad-slot-footer_bottom {
    padding: 16px 0;
}

/* Between Tracks */
.ad-slot-between_tracks {
    margin: 16px 0;
    padding: 16px;
    background: rgba(29, 185, 84, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(29, 185, 84, 0.1);
}

/* Type-specific Styles */

/* Google Ads / Embed */
.ad-type-google_ads,
.ad-type-embed,
.ad-type-html {
    min-height: 50px;
}

/* Image/Banner */
.ad-type-image .ad-image,
.ad-type-animated_image .ad-image,
.ad-type-banner .ad-image {
    border-radius: 8px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ad-type-image .ad-link:hover .ad-image,
.ad-type-animated_image .ad-link:hover .ad-image,
.ad-type-banner .ad-link:hover .ad-image {
    transform: scale(1.01);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* Video */
.ad-type-video .ad-video {
    border-radius: 8px;
}

/* YouTube */
.ad-type-youtube {
    border-radius: 8px;
    overflow: hidden;
}

.ad-type-youtube iframe {
    border-radius: 8px;
}

/* Responsive Adjustments */
@media (max-width: 1024px) {
    .ad-slot-header_top,
    .ad-slot-content_top,
    .ad-slot-content_bottom {
        padding-left: 10px;
        padding-right: 10px;
    }
}

@media (max-width: 768px) {
    .sidebar-ad-section {
        display: none; /* Hide sidebar ads on mobile since sidebar is hidden */
    }

    /* Hide wide banner ads in header on mobile - too wide for mobile screens */
    .ad-slot-header_top {
        display: none !important;
    }

    /* Hide YouTube/video ads in content area on mobile - too wide */
    .ad-slot-content_top .ad-type-youtube,
    .ad-slot-content_top .ad-type-video {
        display: none !important;
    }

    .ad-slot-content_top {
        margin-bottom: 16px;
    }

    .ad-slot-content_bottom {
        margin-top: 16px;
        padding-bottom: 100px; /* Space for fixed bottom player on mobile */
    }

    .ad-unit {
        max-width: 100%;
    }

    .ad-image {
        width: 100% !important;
        height: auto !important;
    }
}

/* Hide ads for premium users (add class via PHP/JS) */
.premium-user .ad-container {
    display: none;
}

/* Ad label (optional - uncomment to show "Ad" label) */
/*
.ad-unit::before {
    content: "Ad";
    position: absolute;
    top: 4px;
    right: 4px;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.5);
    background: rgba(0, 0, 0, 0.5);
    padding: 2px 6px;
    border-radius: 4px;
    z-index: 1;
}
*/

/* Animation for ad appearance */
.ad-container {
    animation: adFadeIn 0.3s ease-out;
}

@keyframes adFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
