#popuply-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

#popuply-overlay.active {
    opacity: 1;
    visibility: visible;
}

#popuply-popup {
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    max-width: 90%;
    width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    text-align: center;
    box-sizing: border-box;
    transform: scale(0.8);
    transition: transform 0.3s ease, opacity 0.3s ease;
    background-clip: padding-box; /* Ensures background doesn't bleed under border */
}

.popuply-content img, 
.popuply-content video, 
.popuply-content iframe {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin-bottom: 15px;
}

/* Ensure forms and shortcode content display correctly */
.popuply-content {
    text-align: left;
}

.popuply-content input[type="text"],
.popuply-content input[type="email"],
.popuply-content input[type="tel"],
.popuply-content input[type="url"],
.popuply-content textarea,
.popuply-content select {
    width: 100%;
    margin-bottom: 10px;
    padding: 8px;
    box-sizing: border-box;
}

.popuply-content input[type="submit"] {
    cursor: pointer;
}

.popuply-timer-bar {
    margin-top: 20px;
    font-size: 0.9em;
    opacity: 0.8;
    border-top: 1px solid rgba(0,0,0,0.1);
    padding-top: 15px;
}

#popuply-overlay.active #popuply-popup {
    transform: scale(1);
}

#popuply-close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    color: inherit;
    opacity: 0.7;
}

#popuply-close-btn:hover {
    opacity: 1;
}

#popuply-countdown {
    font-weight: bold;
    font-size: 1.2em;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    #popuply-popup {
        padding: 20px;
        width: 95%;
    }
    #popuply-popup h3 {
        font-size: 1.2em;
    }
}
