﻿/* ──────────────────────────────────────────
   AD STANDARD SIZES (shared baseline)
   Card:  max-width 480px
   Media: fixed height 260px (desktop)
          fixed height 200px (mobile ≤576px)
   ────────────────────────────────────────── */
/* From  pre ads*/
.interstitial-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

    .interstitial-overlay.show {
        display: flex;
    }

.interstitial-content {
    position: relative;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    background: var(--bg-white, white);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.interstitial-ad {
    width: 100%;
    height: 260px;
    object-fit: cover;
    flex-shrink: 0;
}

.close-button {
    position: absolute;
    top: 0.625rem;
    right: 0.625rem;
    z-index: 2;
    background: rgba(0, 0, 0, 0.55);
    border: none;
    border-radius: 50%;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #fff;
    font-size: 0.8rem;
    transition: background 0.15s ease;
}

    .close-button:hover {
        background: rgba(0, 0, 0, 0.75);
    }

.interstitial-footer {
    padding: 1rem 1.25rem 1.25rem;
    text-align: center;
    border-top: 1px solid #f0f0f0;
}

/* Mobile ≤576px */
@media (max-width: 576px) {
    .interstitial-overlay {
        padding: 0.75rem;
        align-items: flex-end;
    }

    .interstitial-content {
        max-width: 100%;
        border-radius: 16px 16px 12px 12px;
        max-height: 80vh;
    }

    .interstitial-ad {
        height: 200px;
    }

    .interstitial-footer {
        padding: 0.75rem 1rem 1rem;
    }

        .interstitial-footer .btn {
            width: 100%;
        }
}


/* Full-screen backdrop */
.popup-ad-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: popup-fade-in 0.2s ease;
}

@keyframes popup-fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Modal card — standardized size */
.popup-ad-card {
    position: relative;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: popup-slide-up 0.25s ease;
}

@keyframes popup-slide-up {
    from {
        transform: translateY(24px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Close button */
.popup-ad-close {
    position: absolute;
    top: 0.625rem;
    right: 0.625rem;
    z-index: 2;
    background: rgba(0, 0, 0, 0.55);
    border: none;
    border-radius: 50%;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #fff;
    font-size: 0.8rem;
    transition: background 0.15s ease;
}

    .popup-ad-close:hover {
        background: rgba(0, 0, 0, 0.75);
    }

/* "Ad" label */
.popup-ad-label {
    position: absolute;
    top: 0.625rem;
    left: 0.625rem;
    z-index: 2;
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #fff;
    background: rgba(0, 0, 0, 0.45);
    padding: 2px 6px;
    border-radius: 4px;
    pointer-events: none;
}

/* Loading state */
.popup-ad-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 260px;
}

.popup-ad-spinner {
    width: 2.5rem;
    height: 2.5rem;
    border: 3px solid #e0e0e0;
    border-top-color: #6c757d;
    border-radius: 50%;
    animation: popup-spin 0.75s linear infinite;
}

@keyframes popup-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Ad content — clickable area */
.popup-ad-content {
    cursor: pointer;
    outline: none;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

    .popup-ad-content:focus-visible {
        outline: 2px solid #0d6efd;
        outline-offset: -2px;
        border-radius: 12px;
    }

/* Standardized media — fixed height so all ads look uniform */
.popup-ad-image,
.popup-ad-video {
    width: 100%;
    height: 260px;
    display: block;
    object-fit: cover;
    flex-shrink: 0;
}

.popup-ad-title {
    padding: 0.75rem 1rem 0;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.4;
}

/* Call-to-action row */
.popup-ad-cta {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.625rem 1rem 1rem;
    color: #0d6efd;
    font-size: 0.875rem;
    font-weight: 500;
    transition: gap 0.15s ease;
    margin-top: auto;
}

.popup-ad-content:hover .popup-ad-cta {
    gap: 0.625rem;
}

/* ── Mobile ≤576px ── */
@media (max-width: 576px) {
    .popup-ad-overlay {
        padding: 0.75rem;
        align-items: flex-end;
    }

    .popup-ad-card {
        max-width: 100%;
        border-radius: 16px 16px 12px 12px;
        max-height: 80vh;
    }

    .popup-ad-image,
    .popup-ad-video {
        height: 200px;
    }

    .popup-ad-loading {
        height: 200px;
    }

    .popup-ad-title {
        font-size: 0.875rem;
        padding: 0.625rem 0.875rem 0;
    }

    .popup-ad-cta {
        padding: 0.5rem 0.875rem 0.875rem;
        font-size: 0.8125rem;
    }
}
