.userspn-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    z-index: 9999;
    display: none;
    max-height: 90vh; /* Maximum height of 90% of the viewport */
    border-radius: 10px;
    background: transparent;
    overflow-y: auto;
    background-color: #ffffff;
}
.userspn-popup-content {
    position: relative;
    width: 100%;
    margin: 0 auto;
    background-color: #ffffff;
    border-radius: 8px;
    padding-top: 30px;
    padding-bottom: 30px;
    z-index: 1;
    -webkit-overflow-scrolling: touch; /* Better scroll on iOS */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
.userspn-popup.userspn-popup-size-small,.userspn-popup.userspn-popup-size-small .userspn-popup-content{
    max-width: 300px;
}
.userspn-popup.userspn-popup-size-medium,.userspn-popup.userspn-popup-size-medium .userspn-popup-content{
    max-width: 750px;
}
.userspn-popup.userspn-popup-size-large,.userspn-popup.userspn-popup-size-large .userspn-popup-content{
    max-width: 1000px;
}
.userspn-popup.userspn-popup-size-full-size,.userspn-popup.userspn-popup-size-full-size .userspn-popup-content{
    max-width: 100%; /* Maximum width for large screens */
}
.userspn-popup-overlay {
    position: fixed; /* Changed from absolute to fixed */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
}
.userspn-popup-close-wrapper {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 5px;
    line-height: 1;
    z-index: 1000;
    transition: color 0.3s ease;
}
.userspn-popup-close-wrapper:hover {
    color: #000;
}

/* Gallery styles */
.userspn-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    margin-top: 20px;
}
.userspn-gallery-item {
    position: relative;
    cursor: pointer;
    overflow: hidden;
    border-radius: 4px;
}
.userspn-gallery-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}
.userspn-gallery-item:hover img {
    transform: scale(1.05);
}

/* Video player styles */
.userspn-video-player {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
}
.userspn-video-player iframe,
.userspn-video-player video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
} 
#userspn-profile-popup{
    max-width:600px;
    /* Ensure the popup is always visible, even if it's inside a hidden container */
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    z-index: 99999 !important;
}

/* Ensure the popup is visible at all resolutions */
@media (max-width: 1024px) {
    #userspn-profile-popup {
        position: fixed !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        width: 90% !important;
        max-width: 600px !important;
        z-index: 99999 !important;
    }
}

@media (max-width: 768px) {
    .userspn-popup-content{
        max-height: 100%;
    }
    #userspn-profile-popup {
        width: 95% !important;
        max-width: 100% !important;
    }
}