.pn-finance-manager-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    z-index: 9999;
    display: none;
    max-height: 90vh; /* Maximium window height 90% */
    border-radius: 10px;
    background: transparent;
    overflow-y: auto;
    background-color: #ffffff;
}
.pn-finance-manager-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 iOS scroll */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
.pn-finance-manager-popup-active{
    display: block;
}
.pn-finance-manager-popup.pn-finance-manager-popup-size-small,.pn-finance-manager-popup.pn-finance-manager-popup-size-small .pn-finance-manager-popup-content{
    max-width: 300px;
}
.pn-finance-manager-popup.pn-finance-manager-popup-size-medium,.pn-finance-manager-popup.pn-finance-manager-popup-size-medium .pn-finance-manager-popup-content{
    max-width: 750px;
}
.pn-finance-manager-popup.pn-finance-manager-popup-size-large,.pn-finance-manager-popup.pn-finance-manager-popup-size-large .pn-finance-manager-popup-content{
    max-width: 1000px;
}
.pn-finance-manager-popup.pn-finance-manager-popup-size-full-size,.pn-finance-manager-popup.pn-finance-manager-popup-size-full-size .pn-finance-manager-popup-content{
    max-width: 100%; /* Max width for large screens */
}
.pn-finance-manager-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 9998;
}
/* Overlay inside popup must be behind popup-content (z-index:1) */
.pn-finance-manager-popup > .pn-finance-manager-popup-overlay {
    z-index: 0;
}
.pn-finance-manager-popup-close-wrapper,
button.pn-finance-manager-popup-close {
    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;
}
.pn-finance-manager-popup-close-wrapper:hover,
button.pn-finance-manager-popup-close:hover {
    color: #000;
}
button.pn-finance-manager-popup-close-fixed {
    position: sticky;
    top: 5px;
    float: right;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 5px 10px;
    line-height: 1;
    z-index: 1001;
    transition: color 0.3s ease;
    margin-right: 5px;
    margin-top: 5px;
    border-radius: 50%;
}
button.pn-finance-manager-popup-close-fixed:hover {
    color: #000;
    background: rgba(240, 240, 240, 0.95);
}

/* Gallery styles */
.pn-finance-manager-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    margin-top: 20px;
}
.pn-finance-manager-gallery-item {
    position: relative;
    cursor: pointer;
    overflow: hidden;
    border-radius: 4px;
}
.pn-finance-manager-gallery-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}
.pn-finance-manager-gallery-item:hover img {
    transform: scale(1.05);
}

/* Video player styles */
.pn-finance-manager-video-player {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
}
.pn-finance-manager-video-player iframe,
.pn-finance-manager-video-player video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
} 
#pn-finance-manager-profile-popup{
    max-width:600px;
}

@media (max-width: 768px) {
    .pn-finance-manager-popup {
        top: 0;
        left: 0;
        transform: none;
        width: 100%;
        max-width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
    }
    .pn-finance-manager-popup-content {
        max-height: 100%;
        border-radius: 0;
        box-shadow: none;
        min-height: 100%;
    }
    .pn-finance-manager-popup.pn-finance-manager-popup-size-small .pn-finance-manager-popup-content,
    .pn-finance-manager-popup.pn-finance-manager-popup-size-medium .pn-finance-manager-popup-content,
    .pn-finance-manager-popup.pn-finance-manager-popup-size-large .pn-finance-manager-popup-content,
    .pn-finance-manager-popup.pn-finance-manager-popup-size-full-size .pn-finance-manager-popup-content {
        max-width: 100%;
    }
    .pn-finance-manager-popup.pn-finance-manager-popup-size-small,
    .pn-finance-manager-popup.pn-finance-manager-popup-size-medium,
    .pn-finance-manager-popup.pn-finance-manager-popup-size-large,
    .pn-finance-manager-popup.pn-finance-manager-popup-size-full-size {
        max-width: 100%;
    }
    #pn-finance-manager-profile-popup {
        top: 0 !important;
        left: 0 !important;
        transform: none !important;
        width: 100% !important;
        max-width: 100% !important;
        height: 100% !important;
        max-height: 100% !important;
        border-radius: 0 !important;
    }
}