/**
 * Google Ad Manager Styles
 * FDF Theme
 */

/* Base Ad Container */
.fdf-ad-container {
    margin: 20px auto;
    text-align: center;
    clear: both;
}

.fdf-ad-unit {
    display: inline-block;
    margin: 0 auto;
}

/* Top/Leaderboard Ads */
.fdf-ad-top {
    margin: 15px auto 20px;
    padding: 10px 0;
    background: #f5f5f5;
    border-top: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
}

/* Box Ads - Sidebar */
.fdf-ad-box.fdf-ad-sidebar {
    margin: 20px 0;
    padding: 15px;
    background: #fafafa;
    border: 1px solid #e8e8e8;
    border-radius: 4px;
}

/* Box Ads - Sidebar Bottom */
.fdf-ad-box.fdf-ad-sidebar-bottom {
    margin: 30px 0 20px;
    padding: 15px;
    background: #fafafa;
    border: 1px solid #e8e8e8;
    border-radius: 4px;
}

/* Box Ads - In Content */
.fdf-ad-box.fdf-ad-in-content {
    margin: 35px auto;
    padding: 20px;
    background: #f9f9f9;
    border: 1px solid #eaeaea;
    border-radius: 4px;
    max-width: 300px;
}

/* Spacing between multiple in-content ads */
.fdf-ad-box.fdf-ad-in-content + * + * + .fdf-ad-box.fdf-ad-in-content {
    margin-top: 40px;
}

/* Instant Articles Ad */
.fdf-ad-instant-articles {
    margin: 40px auto;
    padding: 20px;
    background: #f9f9f9;
    border: 1px solid #eaeaea;
    border-radius: 4px;
    max-width: 300px;
}

/* Footer Sticky Ad */
.fdf-ad-footer-sticky {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: #fff;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.15);
    margin: 0;
    padding: 10px;
    transform: translateY(100%);
    transition: transform 0.3s ease-in-out;
}

.fdf-ad-footer-sticky.is-visible {
    transform: translateY(0);
}

.fdf-ad-footer-sticky .fdf-ad-close {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #000;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.fdf-ad-footer-sticky .fdf-ad-close:hover {
    opacity: 1;
}

/* Interstitial Ad (Modal/Popup) */
.fdf-ad-interstitial {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fdf-ad-interstitial-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
}

.fdf-ad-interstitial-content {
    position: relative;
    z-index: 1;
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    max-width: 90%;
    max-height: 90%;
    overflow: auto;
}

.fdf-ad-interstitial .fdf-ad-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #000;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transition: transform 0.2s;
}

.fdf-ad-interstitial .fdf-ad-close:hover {
    transform: scale(1.1);
}

/* Layer Ad (Out-of-page) */
.fdf-ad-layer {
    /* Positioned by GAM */
}

/* PreRoll Video Ad */
.fdf-ad-preroll {
    margin: 20px auto 30px;
    padding: 15px;
    background: #000;
    border-radius: 4px;
    max-width: 640px;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .fdf-ad-top {
        padding: 5px 0;
    }

    .fdf-ad-box.fdf-ad-sidebar {
        display: none; /* Hide sidebar ads on mobile */
    }

    .fdf-ad-box.fdf-ad-in-content,
    .fdf-ad-instant-articles {
        max-width: 100%;
        padding: 15px;
    }

    .fdf-ad-footer-sticky {
        padding: 5px;
    }

    .fdf-ad-preroll {
        padding: 10px;
    }
}

@media (max-width: 576px) {
    .fdf-ad-interstitial-content {
        padding: 15px;
        max-width: 95%;
    }
}

/* Loading State */
.fdf-ad-unit:empty::before {
    content: 'Advertisement';
    display: block;
    color: #999;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 20px;
}

/* Ad Label */
.fdf-ad-container::before {
    content: 'PUBLICIDAD';
    display: block;
    font-size: 10px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.fdf-ad-footer-sticky::before,
.fdf-ad-interstitial::before,
.fdf-ad-layer::before {
    display: none;
}
