.eip-popup {
    display: none; /* Start hidden */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99999;
    opacity: 0; /* Initial state for fade-in */
    border-radius: 5px;
}

.eip-popup.show {
    display: block; /* Display block to start showing */
    animation: fadeIn 0.3s forwards; /* Apply fade-in animation */
}

.eip-popup.hide {
    animation: fadeOut 0.3s forwards; /* Apply fade-out animation */
}

.eip-popup-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8); /* Initial state for scale */
    background: #fff;
    padding: 25px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    text-align: center;
    max-width: 550px;
    width: 100%;
    min-height: 300px;
    opacity: 0; /* Initial state for opacity */
}

.eip-popup-content.show {
    transform: translate(-50%, -50%) scale(1); /* End state for scale */
    opacity: 1; /* End state for opacity */
    animation: scaleIn 0.3s forwards; /* Apply scale-in animation */
}

.eip-popup-content.hide {
    animation: scaleOut 0.3s forwards; /* Apply scale-out animation */
}

.eip-close {
    position: absolute;
    top: 12px;
    right: 12px;
    cursor: pointer;
    font-size: 20px;
    z-index: 3;
    color: var(--dark, #262626);
    background: white;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
}

.eip-popup-content:not(.eip-bg-only) .eip-close {
    color: #333;
    background: transparent;
    width: auto;
    height: auto;
}

/* Background image only variant */
.eip-popup-content.eip-bg-only {
    background-color: transparent;
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover;
    padding: 0;
    min-height: 0;
    aspect-ratio: 16 / 10;
    height: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

/* Clickable link overlay covers the whole popup content */
.eip-popup-link {
    position: absolute;
    inset: 0;
    display: block;
    z-index: 1;
    text-indent: -9999px;
    overflow: hidden;
}

.eip-popup-content.eip-has-link {
    cursor: pointer;
}

.eip-popup-body {
    position: relative;
    z-index: 2;
}

/* Keyframes for fade-in and fade-out */
@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    to {
        opacity: 0;
    }
}

/* Keyframes for scale-in and scale-out */
@keyframes scaleIn {
    to {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

@keyframes scaleOut {
    to {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0;
    }
}
