/* Prevent body scroll when popup is open */
body.nx-unipopup-open {
    overflow: hidden;
}

/* NX_UNI Popup Styles */
.nx-unipopup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.nx-unipopup-backdrop-dark {
    background-color: rgba(0, 0, 0, 0.8);
}

.nx-unipopup-backdrop-light {
    background-color: rgba(255, 255, 255, 0.9);
}

.nx-unipopup-backdrop-blur {
    backdrop-filter: blur(5px);
    background-color: rgba(0, 0, 0, 0.4);
}

.nx-unipopup-backdrop-transparent {
    background-color: transparent;
}

.nx-unipopup-container {
    position: relative;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.nx-unipopup-content {
    background: #ffffff;
    border-radius: 8px;
    padding: 30px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    overflow-y: auto;
    flex: 1;
    outline: none;
    overflow-x: hidden;
  /* Ensure content doesn't overflow */
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Fixed close button positioning */
.nx-unipopup-close {
    top: -20px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #666;
    line-height: 1;
    z-index: 10;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    padding: 0;
    position: sticky;
    float: right;
    margin-top: -40px;
    margin-right: -20px;
 }

.nx-unipopup-close:hover {
    background: rgba(255, 255, 255, 1);
    color: #333;
    transform: scale(1.1) rotate(90deg);
}

/* Content wrapper to handle close button positioning */
.nx-unipopup-content-wrapper {
    position: relative;
    height: 100%;
}

/* Position Classes */
.nx-unipopup-top {
    align-items: flex-start;
}

.nx-unipopup-bottom {
    align-items: flex-end;
}

.nx-unipopup-center {
    align-items: center;
}

/* Custom scrollbar for popup content */
.nx-unipopup-content::-webkit-scrollbar {
    width: 8px;
}

.nx-unipopup-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.nx-unipopup-content::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.nx-unipopup-content::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Animation Classes */
.nx-unipopup-fadeIn {
    animation: nxuniPopupFadeIn 0.3s ease-out;
}

.nx-unipopup-slideUp {
    animation: nxuniPopupSlideUp 0.4s ease-out;
}

.nx-unipopup-slideDown {
    animation: nxuniPopupSlideDown 0.4s ease-out;
}

.nx-unipopup-zoomIn {
    animation: nxuniPopupZoomIn 0.3s ease-out;
}

/* Animations */
@keyframes nxuniPopupFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes nxuniPopupSlideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes nxuniPopupSlideDown {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* Trigger Button */
.nx-unipopup-trigger {
    background: #0073aa;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.nx-unipopup-trigger:hover {
    background: #005a87;
    color: white;
    text-decoration: none;
}

/* Responsive */
@media (max-width: 768px) {
    .nx-unipopup-overlay {
        padding: 10px;
    }
    
    .nx-unipopup-content {
        padding: 20px;
    }
    
    .nx-unipopup-container {
        max-width: 95vw;
        max-height: 95vh;
    }
    
    .nx-unipopup-close {
        top: -10px;
        right: -10px;
        width: 25px;
        height: 25px;
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .nx-unipopup-content {
        padding: 15px;
    }
    
    .nx-unipopup-container {
        max-width: 100vw;
        max-height: 100vh;
    }
}
