/* Frontend Styles for Next Stage Ads (Reward Popup, Precount Notifier, Sticky Banner) */
/* Split out of admin.css so the public frontend only loads what it actually uses. */

/* Reward Ads Popup Styles */
.next-stage-ads-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    z-index: 999999;
    align-items: center;
    justify-content: center;
}

.next-stage-ads-popup-container {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    background: #fff;
    border-radius: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.next-stage-ads-popup-header {
    background: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.next-stage-ads-popup-countdown {
    font-size: 16px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.next-stage-ads-popup-timer {
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 700;
    min-width: 30px;
    text-align: center;
}

.next-stage-ads-popup-close {
    background: none;
    border: none;
    color: var(--md-sys-color-on-primary);
    font-size: 24px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.next-stage-ads-popup-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.next-stage-ads-popup-content {
    flex: 1;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    overflow: auto;
}

.next-stage-ads-popup-ad {
    width: 100%;
    max-width: 728px;
    min-height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.next-stage-ads-popup-ad iframe,
.next-stage-ads-popup-ad ins,
.next-stage-ads-popup-ad script {
    max-width: 100%;
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .next-stage-ads-popup-header {
        padding: 12px 16px;
    }

    .next-stage-ads-popup-countdown {
        font-size: 14px;
    }

    .next-stage-ads-popup-content {
        padding: 16px;
    }

    .next-stage-ads-popup-ad {
        max-width: 100%;
    }
}

/* Frontend Popup Styles (for public site) */
.next-stage-ads-reward-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    z-index: 999999;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
}

/* Asigură dimensiuni pentru container când popup-ul este ascuns */
.next-stage-ads-reward-popup-overlay:not(.visible) .next-stage-ads-reward-popup-ad {
    visibility: hidden;
}

/* Asigură că AdSense containerul are dimensiuni minime când popup-ul este vizibil */
.next-stage-ads-reward-popup-overlay.visible .next-stage-ads-reward-popup-ad {
    visibility: visible;
    min-width: 300px !important;
    min-height: 600px !important;
}

.next-stage-ads-reward-popup-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    max-width: none;
    max-height: none;
    background: #fff;
    border-radius: 0;
    overflow: hidden;
    animation: popupFadeIn 0.3s ease-out;
}

@keyframes popupFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.next-stage-ads-reward-popup-header {
    background: #ffffff;
    color: #1c1b1f;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
    /* Material Design 3 Elevation Level 4 */
    height: 48px;
    min-height: 48px;
    border-bottom: 1px solid #e7e0ec;
}

.next-stage-ads-reward-popup-countdown {
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #f7f2fa;
    color: #49454f;
    padding: 6px 12px;
    border-radius: 16px;
    border: 1px solid #cac4d0;
    position: relative;
    z-index: 2;
    letter-spacing: 0.1px;
}

.next-stage-ads-reward-popup-timer {
    background: #6750a4;
    color: #ffffff;
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: 700;
    min-width: 32px;
    text-align: center;
    animation: pulse 2s ease-in-out infinite;
    font-size: 13px;
    line-height: 1.2;
    letter-spacing: 0.5px;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

.next-stage-ads-reward-popup-close {
    background: #1a1a1a;
    border: none;
    color: #ffffff;
    font-size: 14px;
    cursor: pointer;
    padding: 10px 16px;
    border-radius: 0;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    width: auto;
    min-width: 90px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    line-height: 1;
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    z-index: 2;
    font-weight: 600;
    gap: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.next-stage-ads-reward-popup-close::after {
    content: 'ÎNCHIDE';
    font-size: 12px;
    font-weight: 600;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.next-stage-ads-reward-popup-close.show {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
    animation: buttonFadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.next-stage-ads-reward-popup-close.disabled {
    opacity: 0.3;
    pointer-events: none;
    background: #4a4a4a !important;
    color: #888888 !important;
    cursor: not-allowed;
    box-shadow: none !important;
}

.next-stage-ads-reward-popup-close.disabled::after {
    color: #888888 !important;
}

.next-stage-ads-reward-popup-close:hover:not(.disabled) {
    background: #000000;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.next-stage-ads-reward-popup-close:active:not(.disabled) {
    transform: translateY(0);
    background: #2a2a2a;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

@keyframes buttonFadeIn {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

    .next-stage-ads-reward-popup-content {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        padding-top: 48px; /* Spațiu pentru header de 48px */
        display: flex;
        justify-content: center;
        background: #f8f9fa;
        overflow: hidden;
    }

.next-stage-ads-reward-popup-ad {
    width: 100%;
    height: 100vh;
    min-width: 300px;
    min-height: 250px;
    display: flex;
    justify-content: center;
    background: #fff;
    box-sizing: border-box;
    position: relative;
}

.next-stage-ads-reward-popup-ad iframe,
.next-stage-ads-reward-popup-ad ins,
.next-stage-ads-reward-popup-ad script,
.next-stage-ads-reward-popup-ad img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 0;
}

/* Header position variations */
.next-stage-ads-reward-popup-overlay .next-stage-ads-reward-popup-container.header-bottom .next-stage-ads-reward-popup-header {
    top: auto !important;
    bottom: 0 !important;
    border-top: 1px solid #e7e0ec !important;
    border-bottom: none !important;
}

.next-stage-ads-reward-popup-overlay .next-stage-ads-reward-popup-container.header-bottom .next-stage-ads-reward-popup-content {
    top: 0 !important;
    bottom: 48px !important;
    padding-top: 0 !important;
    padding-bottom: 48px !important;
}

/* Minimal pre-ad countdown notifier */
.next-stage-ads-precount {
    position: fixed;
    z-index: 2147483000;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(0,0,0,0.9);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 18px rgba(0,0,0,0.25);
    pointer-events: auto;
    cursor: pointer;
}
.next-stage-ads-precount.top-left { top: 16px; left: 16px; }
.next-stage-ads-precount.top-right { top: 16px; right: 16px; }
.next-stage-ads-precount.bottom-left { bottom: 16px; left: 16px; }
.next-stage-ads-precount.bottom-right { bottom: 16px; right: 16px; }

/* Sticky bottom banner */
.next-stage-ads-sticky {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    background: rgba(17,17,17,0.6);
    backdrop-filter: blur(8px);
    z-index: 2147483000;
    display: none;
    max-height: var(--nsa-sticky-height, 60px) !important;
    min-height: var(--nsa-sticky-height, 60px) !important;
}
.next-stage-ads-sticky-inner {
    max-width: 100%;
    margin: 0 auto;
    height: var(--nsa-sticky-height, 60px);
    min-height: var(--nsa-sticky-height, 60px);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}
.next-stage-ads-sticky-slot {
    height: 100%;
    max-height: 100%;
    overflow: hidden;
}
.next-stage-ads-sticky-slot ins.adsbygoogle {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
}
.next-stage-ads-sticky-slot ins.adsbygoogle[data-full-width-responsive="true"],
.next-stage-ads-sticky-slot ins.adsbygoogle[data-ad-format="auto"],
.next-stage-ads-sticky-slot ins.adsbygoogle[data-ad-format="fluid"] {
    height: 100% !important;
    min-height: 0 !important;
}
.next-stage-ads-sticky-slot iframe {
    height: 100% !important;
}
.next-stage-ads-sticky-inner ins.adsbygoogle,
.next-stage-ads-sticky-inner iframe,
.next-stage-ads-sticky-inner img,
.next-stage-ads-sticky-inner div {
    max-height: 100%;
}
.next-stage-ads-sticky-close {
    position: absolute;
    right: 0px;
    top: -40px;
    background: rgb(0 0 0 / 54%);
    border: 0;
    color: #fff;
    width: 40px;
    height: 40px;
    /* border-radius: 50%; */
    cursor: pointer;
    z-index: 5;
    pointer-events: auto;
}
/* Ensure ad slot stays below the close button */
.next-stage-ads-sticky-slot,
.next-stage-ads-sticky-slot ins.adsbygoogle,
.next-stage-ads-sticky-slot iframe {
    position: relative;
}

body.next-stage-ads-sticky-open {
    padding-bottom: var(--nsa-sticky-height, 60px);
}

.next-stage-ads-precount .inner {
    position: relative;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(255,255,255,0.04);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}
.next-stage-ads-precount .ad-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    opacity: 0.9;
}
.next-stage-ads-precount .time {
    margin-top: 2px;
    font-size: 14px;
    font-weight: 700;
}
.next-stage-ads-precount svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}
.next-stage-ads-precount .ring-bg {
    stroke: rgba(255,255,255,0.18);
    stroke-width: 4;
    stroke-linecap: round;
}
.next-stage-ads-precount .ring-progress {
    stroke: #ffd000;
    stroke-width: 4;
    stroke-linecap: round;
}

/* Specific styles for AdSense elements in popup */
.next-stage-ads-reward-popup-ad ins.adsbygoogle {
    min-width: 300px;
    min-height: 250px;
    display: block !important;
    margin: 0 auto;
    height: 100% !important;
    width: 100% !important;
}

.next-stage-ads-reward-popup-ad ins.adsbygoogle[data-ad-format="fluid"] {
    min-height: 600px;
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .next-stage-ads-reward-popup-header {
    }

    .next-stage-ads-reward-popup-countdown {
        font-size: 14px;
    }

    .next-stage-ads-reward-popup-countdown-text {
        display: none;
    }

    .next-stage-ads-reward-popup-content {
        padding-top: 48px; /* Spațiu pentru header de 48px pe mobil */
    }

    .next-stage-ads-reward-popup-overlay .next-stage-ads-reward-popup-container.header-bottom .next-stage-ads-reward-popup-content {
        padding-top: 0 !important;
        padding-bottom: 0px !important;
    }

    .next-stage-ads-reward-popup-ad {
        min-width: 280px;
        min-height: 200px;
    }

    /* Mobile-specific AdSense sizing */
    .next-stage-ads-reward-popup-ad ins.adsbygoogle {
        min-width: 280px;
        min-height: 600px;
    }

    /* Allow popup to be scrollable on mobile */
    .next-stage-ads-reward-popup-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .next-stage-ads-reward-popup-container {
        min-height: 100vh;
        position: relative;
    }
}

/* Prevent body scroll when popup is open - desktop only */
@media (min-width: 769px) {
    body.next-stage-ads-popup-open {
        overflow: hidden;
        position: fixed;
        width: 100%;
        height: 100%;
    }
}

/* Allow scroll on mobile when popup is open */
@media (max-width: 768px) {
    body.next-stage-ads-popup-open {
        overflow: auto !important;
        position: static !important;
        width: auto !important;
        height: auto !important;
    }
}
