/* Popup Overlay */
.cpm-popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 999999;
    animation: cpmFadeIn 0.3s ease-in-out;
}

.cpm-popup-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Popup Container */
.cpm-popup-container {
    position: relative;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 450px;
    width: 80%;
    max-height: 80vh;
    overflow: hidden;
    animation: cpmSlideUp 0.4s ease-out;
}

/* Close Button */
.cpm-close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    background: #ffffff;
    border: 2px solid #e74c3c;
    border-radius: 50%;
    font-size: 20px;
    line-height: 28px;
    cursor: pointer;
    color: #e74c3c;
    z-index: 10;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 10px rgba(231, 76, 60, 0.3);
    padding: 0;
    font-weight: 700;
}

.cpm-close-btn:hover {
    background: #f44336;
    color: #fff;
    border-color: #f44336;
    transform: rotate(90deg);
}

.cpm-close-btn:focus {
    outline: 2px solid #2196F3;
    outline-offset: 2px;
}

/* Popup Content */
.cpm-popup-content {
    padding: 12px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

/* Popup Image */
.cpm-popup-image {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
}

/* Popup Button */
.cpm-popup-button {
    display: inline-block;
    padding: 10px 28px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    text-decoration: none;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 3px 12px rgba(102, 126, 234, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 3px;
}

.cpm-popup-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
    color: #fff;
}

.cpm-popup-button:active {
    transform: translateY(0);
}

/* Animations */
@keyframes cpmFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes cpmSlideUp {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes cpmFadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* Close animation */
.cpm-popup-overlay.closing {
    animation: cpmFadeOut 0.3s ease-out forwards;
}

.cpm-popup-overlay.closing .cpm-popup-container {
    animation: cpmSlideDown 0.3s ease-out forwards;
}

@keyframes cpmSlideDown {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(50px) scale(0.9);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .cpm-popup-container {
        width: 88%;
        max-width: none;
    }
    
    .cpm-popup-content {
        padding: 10px;
    }
    
    .cpm-popup-button {
        padding: 9px 22px;
        font-size: 13px;
    }
    
    .cpm-close-btn {
        width: 30px;
        height: 30px;
        font-size: 18px;
        top: 10px;
        right: 10px;
    }
}

@media (max-width: 480px) {
    .cpm-popup-container {
        width: 92%;
    }
    
    .cpm-popup-button {
        padding: 8px 20px;
        font-size: 12px;
    }
}

/* Prevent body scroll when popup is open */
body.cpm-popup-open {
    overflow: hidden;
}