/* Musica Ads Pro - Frontend Styles */

/* Wrapper principal - CRITICAL para evitar CLS */
.musica-ads-wrapper {
    position: relative;
    margin: 0px;
    min-height: 280px;
}

/* Label PUB - Requisito legal PT */
.musica-ads-label {
    position: absolute;
    top: -10px;
    left: -10px;
    background: #000;
    color: #fff;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 5px;
    z-index: 10;
    border-radius: 2px;
    letter-spacing: 0.5px;
}

/* Placeholder de loading - evita CLS */
.musica-ads-loading {
    background: #f5f5f5;
    border: 1px dashed #ccc;
    text-align: center;
    padding: 16px;
    color: #666;
    font-size: 12px;
    min-height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Estados de erro */
.musica-ads-error {
    background: #ffe6e6;
    border: 1px solid #ffcccc;
    color: #cc0000;
    padding: 15px;
    text-align: center;
    font-size: 12px;
}

/* Container dos anúncios */
.musica-ad-container {
    position: relative;
    margin: 0px;
    overflow: hidden;
}

.musica-ad-custom,
.musica-ad-image,
.musica-ad-adsense,
.musica-ad-video {
    max-width: 100%;
}

.musica-ad-image img {
    max-width: 100%;
    height: auto;
    display: block;
}

.musica-ad-image a {
    display: block;
    transition: opacity 0.3s ease;
}

.musica-ad-image a:hover {
    opacity: 0.85;
}

/* Video ads - improved styling */
.musica-ad-video-wrapper {
    position: relative;
    width: 100%;
    max-width: 100%;
}

.musica-ad-video {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Clickable overlay for video ads */
.musica-ad-video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 5;
    cursor: pointer;
    background: transparent;
    /* Show subtle hover effect */
    transition: background-color 0.3s ease;
}

.musica-ad-video-overlay:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

/* Zonas de anúncios */
.musica-ad-zone {
    margin: 0px;
}

.musica-ad-zone-fallback {
    text-align: center;
    padding: 0px;
    background: #f5f5f5;
    border: 1px dashed #ddd;
    color: #999;
}

/* Multiple ads in zone - FIX: Support for displaying multiple ads */
.musica-ad-zone-multiple {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 20px 0;
}

/* Optional: Side-by-side layout for desktop (can be overridden by theme) */
@media (min-width: 1024px) {
    .musica-ad-zone-multiple.layout-horizontal {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-between;
    }

    .musica-ad-zone-multiple.layout-horizontal .musica-ads-wrapper {
        flex: 0 1 calc(50% - 10px);
    }
}

/* Auto-insert */
.musica-ads-auto-insert {
    clear: both;
}

/* Lazy loading placeholder */
.musica-ad-loading {
    min-height: 250px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Responsivo */
@media (max-width: 768px) {
    .musica-ad-container,
    .musica-ads-wrapper {
        margin: 0px;
    }
}
