/**
 * SlotTurbo Main Styles
 */

/* Ad Wrapper */
.slotturbo-ad-wrapper {
    position: relative;
    margin: 20px auto;
    text-align: center;
    min-height: 50px;
    overflow: visible !important;
    max-width: 100%;
}

/* Garantir que iframes e divs de ads não sejam cortados */
.slotturbo-ad-wrapper iframe,
.slotturbo-ad-wrapper div[id^="div-gpt-ad"],
.slotturbo-ad-wrapper div[id^="google_ads"],
.slotturbo-ad-wrapper ins.adsbygoogle {
    max-width: 100% !important;
    overflow: visible !important;
}

/* Container de ads - garantir altura automática */
.slotturbo-ad-wrapper>div {
    overflow: visible !important;
    min-height: auto;
    height: auto !important;
}

/* Mobile - regras específicas */
@media (max-width: 768px) {
    .slotturbo-ad-wrapper {
        overflow: visible !important;
        width: 100% !important;
        max-width: 100vw;
        margin-left: 0;
        margin-right: 0;
    }

    .slotturbo-ad-wrapper iframe {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        min-height: 250px;
    }

    .slotturbo-ad-wrapper div[id^="div-gpt-ad"],
    .slotturbo-ad-wrapper div[id^="c"] {
        overflow: visible !important;
        max-width: 100% !important;
    }
}

/* Above fold - carrega imediatamente */
.slotturbo-ad-wrapper.slotturbo-above-fold {
    contain: layout style;
}

/* Below fold - lazy load */
.slotturbo-ad-wrapper.slotturbo-below-fold {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.slotturbo-ad-wrapper.slotturbo-below-fold.slotturbo-loaded {
    opacity: 1;
}

/* Loading state para below fold */
.slotturbo-ad-wrapper.slotturbo-loading-ad .slotturbo-ad-placeholder {
    animation: slotturbo-pulse 1s ease-in-out infinite;
}

@keyframes slotturbo-pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

.slotturbo-ad-content {
    display: none;
}

.slotturbo-ad-wrapper.slotturbo-loaded .slotturbo-ad-content {
    display: block;
}

.slotturbo-ad-wrapper.slotturbo-loaded .slotturbo-ad-placeholder {
    display: none;
}

/* Priority (above fold) loads instantly */
.slotturbo-ad-wrapper.slotturbo-priority .slotturbo-ad-content {
    display: block;
}

/* Placeholder with dark gray pattern */
.slotturbo-ad-placeholder,
.slotturbo-placeholder {
    position: relative;
    width: 100%;
    min-height: 90px;
    background: linear-gradient(135deg, #2a2a2a 25%, #333333 25%, #333333 50%, #2a2a2a 50%, #2a2a2a 75%, #333333 75%);
    background-size: 20px 20px;
    animation: slotturbo-loading 1s linear infinite;
    border-radius: 4px;
}

.slotturbo-placeholder-pattern {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(45deg,
            transparent,
            transparent 10px,
            rgba(255, 255, 255, 0.03) 10px,
            rgba(255, 255, 255, 0.03) 20px);
}

@keyframes slotturbo-loading {
    0% {
        background-position: 0 0;
    }

    100% {
        background-position: 40px 40px;
    }
}

/* Loading indicator */
.slotturbo-ad-placeholder::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    animation: slotturbo-spin 0.8s linear infinite;
}

@keyframes slotturbo-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Interstitial */
.slotturbo-interstitial {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.slotturbo-interstitial-visible {
    opacity: 1;
}

.slotturbo-interstitial-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
}

.slotturbo-interstitial-container {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    background: #1a1a1a;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.slotturbo-interstitial-visible .slotturbo-interstitial-container {
    transform: scale(1);
}

.slotturbo-interstitial-close {
    position: absolute;
    top: -12px;
    right: -12px;
    width: 36px;
    height: 36px;
    background: #333;
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    z-index: 1;
}

.slotturbo-interstitial-close:hover {
    background: #555;
    transform: scale(1.1);
}

.slotturbo-interstitial-content {
    min-width: 300px;
    min-height: 250px;
}

/* No scroll when interstitial open */
body.slotturbo-no-scroll {
    overflow: hidden;
}

/* Responsive */
@media (max-width: 768px) {
    .slotturbo-interstitial-container {
        max-width: 95vw;
        padding: 15px;
    }

    .slotturbo-interstitial-content {
        min-width: 280px;
    }
}