/* Modern Popup Design with Enhanced Animations */

.popup {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.popup.show {
    opacity: 1;
}

.popup-content {
    margin: 5% auto;
    padding: 0;
    width: 90%;
    max-width: 680px;
    position: relative;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 
        0 20px 25px -5px rgba(0, 0, 0, 0.1),
        0 10px 10px -5px rgba(0, 0, 0, 0.04),
        0 0 0 1px rgba(255, 255, 255, 0.05);
    transform: scale(0.95) translateY(-20px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}

.popup.show .popup-content {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* Close button styling */
.popup .close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    color: #6b7280;
    font-size: 20px;
    font-weight: 300;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.popup .close:hover {
    background: rgba(255, 255, 255, 1);
    color: #374151;
    transform: scale(1.1);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.popup .close:active {
    transform: scale(0.95);
}

/* Content area styling */
.askme-shortcode {
    margin: 0;
    width: 100%;
    padding: 30px;
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
}

/* Responsive design improvements */
@media screen and (max-width: 910px) {
    .popup-content {
        margin: 2% auto;
        width: 95%;
        max-width: 95%;
        border-radius: 16px;
    }
    
    .askme-shortcode {
        padding: 20px;
    }
    
    .popup .close {
        top: 15px;
        right: 15px;
        width: 36px;
        height: 36px;
        font-size: 18px;
    }
}

@media screen and (max-width: 480px) {
    .popup-content {
        margin: 0;
        width: 100%;
        height: 100%;
        max-width: 100%;
        border-radius: 0;
    }
    
    .askme-shortcode {
        padding: 15px;
        height: 100%;
        display: flex;
        flex-direction: column;
    }
    
    .popup .close {
        top: 10px;
        right: 10px;
        width: 32px;
        height: 32px;
        font-size: 16px;
    }
}

/* Animation keyframes for enhanced effects */
@keyframes slideInFromTop {
    from {
        transform: translateY(-100px) scale(0.9);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

@keyframes fadeInScale {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* Loading state animation */
.popup.loading .popup-content {
    animation: pulse 2s infinite;
}

/* Exit animations */
.popup.closing {
    opacity: 0;
    transition: opacity 0.2s ease-out;
}

.popup.closing .popup-content {
    transform: scale(0.95) translateY(20px);
    opacity: 0;
    transition: all 0.2s ease-out;
}