/* ==========================================================================
   Promotional Popup Styles
   ========================================================================== */

/* Popup Overlay Background with Glassmorphism */
.spark-promo-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 999999; /* Ensure it stays above everything */
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

/* Active Overlay State */
.spark-promo-popup-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* Content Container (Centers and bounds the card) */
.spark-promo-popup-content-wrapper {
    position: relative;
    max-width: 480px; /* Optimal display width for a vertical poster */
    width: 90%;
    margin: 20px;
    transform: scale(0.85) translateY(20px);
    transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1); /* Elastic entry bounce */
}

/* Active Content State */
.spark-promo-popup-overlay.active .spark-promo-popup-content-wrapper {
    transform: scale(1) translateY(0);
}

/* Inner Popup Box */
.spark-promo-popup-content {
    position: relative;
    background-color: #111111;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
}

/* Close Button (Micro-animation on hover) */
.spark-promo-popup-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    padding: 0;
    line-height: 1;
    transition: background-color 0.3s cubic-bezier(0.25, 1, 0.5, 1),
                border-color 0.3s cubic-bezier(0.25, 1, 0.5, 1),
                transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

.spark-promo-popup-close-btn:hover {
    background-color: #e63946; /* Premium vivid crimson */
    border-color: #e63946;
    color: #ffffff;
    transform: rotate(90deg) scale(1.1);
}

.spark-promo-popup-close-btn:focus-visible {
    outline: 2px solid #e63946;
    outline-offset: 2px;
}

/* Link Wrapper around Image */
.spark-promo-popup-link {
    display: block;
    cursor: pointer;
    line-height: 0;
    overflow: hidden;
    text-decoration: none;
    border-radius: 20px;
}

/* Image zoom-in micro-interaction */
.spark-promo-popup-img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

.spark-promo-popup-link:hover .spark-promo-popup-img {
    transform: scale(1.04);
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .spark-promo-popup-content-wrapper {
        max-width: 90%;
        margin: 15px;
    }
    
    .spark-promo-popup-close-btn {
        top: 10px;
        right: 10px;
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
}

@media (max-height: 650px) {
    .spark-promo-popup-content-wrapper {
        max-width: 340px; /* Scale down for short screens */
    }
}
