/* Nab Popup Frontend Styles */
.nab_popup_wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.nab_popup_wrapper.nab_popup_active {
    opacity: 1;
    visibility: visible;
}

.nab_popup_overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

.nab_popup_container {
    position: absolute;
    top: 50%;
    left: 50%;
    width: var(--nab-popup-width, 500px);
    max-width: 90%;
    height: var(--nab-popup-height, auto);
    max-height: 90vh;
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Animation Types */
.nab_popup_wrapper.nab_popup_animation_fade .nab_popup_container {
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.nab_popup_wrapper.nab_popup_active.nab_popup_animation_fade .nab_popup_container {
    opacity: 1;
    transform: translate(-50%, -50%);
}

.nab_popup_wrapper.nab_popup_animation_slide .nab_popup_container {
    transform: translate(-50%, -150%);
    opacity: 0;
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.5s ease;
}

.nab_popup_wrapper.nab_popup_active.nab_popup_animation_slide .nab_popup_container {
    opacity: 1;
    transform: translate(-50%, -50%);
}

.nab_popup_wrapper.nab_popup_animation_zoom .nab_popup_container {
    transform: translate(-50%, -50%) scale(0.5);
    opacity: 0;
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.5s ease;
}

.nab_popup_wrapper.nab_popup_active.nab_popup_animation_zoom .nab_popup_container {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.nab_popup_wrapper.nab_popup_animation_flip .nab_popup_container {
    transform: translate(-50%, -50%) rotateY(90deg);
    opacity: 0;
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.5s ease;
}

.nab_popup_wrapper.nab_popup_active.nab_popup_animation_flip .nab_popup_container {
    opacity: 1;
    transform: translate(-50%, -50%) rotateY(0);
}

.nab_popup_content {
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.nab_popup_close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.1);
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
    color: #333;
    font-size: 16px;
    -webkit-tap-highlight-color: transparent;
}

.nab_popup_close:hover {
    background: rgba(0, 0, 0, 0.2);
    color: #000;
}

.nab_popup_close i {
    /* Font Awesome icon will be used here */
}

.nab_popup_inner_content {
    padding: 40px 30px 30px;
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

.nab_popup_thumbnail {
    width: 100%;
    height: auto;
    overflow: hidden;
    border-radius: 10px 10px 0 0;
  
}

.nab_popup_thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px 10px 0 0;
}

.nab_popup_text_content {
    flex: 1;
    overflow-y: auto;
    padding: 0 20px;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}
.nab_popup_close {
    position: absolute;
    top: 3px;
    right: -16px;
    background: rgb(0 0 0 / .1);
    border: none;
    width: 10px;
    height: 15px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
    color: #333;
    font-size: 16px;
    background: transparent !important;
}
/* Style Variations */
.nab_popup_style_default .nab_popup_content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.nab_popup_style_default .nab_popup_inner_content {
    text-align: center;
}

.nab_popup_style_minimal .nab_popup_content {
    border: 2px solid #333;
    background: white;
}

.nab_popup_style_modern .nab_popup_content {
    background: linear-gradient(200deg, #0c1e7f 0%, #612897 100%);
    color: white;
    border-radius: 10px;
}

.nab_popup_style_modern .nab_popup_close {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.nab_popup_style_elegant .nab_popup_content {
    background: white;
    border: 1px solid #e1e1e1;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.nab_popup_style_elegant .nab_popup_inner_content {
    padding: 0px;
}

.nab_popup_style_custom .nab_popup_content {
    /* Custom styles will be applied via custom CSS */
}

/* No scroll when popup is active - UPDATED FOR BETTER MOBILE SUPPORT */
body.nab_popup_no_scroll {
    overflow: hidden !important;
    position: fixed;
    width: 100%;
    height: 100%;
    touch-action: none;
}

/* Responsive */
@media (max-width:1024px) {
    .nab_popup_content {
        max-width: 75%;
        margin: 0px auto;
    }
}
@media (max-width: 768px) {
    .nab_popup_container {
        width: 95% !important;
        max-width: 95% !important;
    }
    
    .nab_popup_inner_content {
        padding: 30px 20px 20px;
    }
    
    .nab_popup_style_elegant .nab_popup_inner_content {
        padding: 40px 25px 25px;
    }

    .nab_popup_close {
        top: -3px;
        right: -22px;
        width: 25px;
        height: 25px;
        font-size: 14px;
    }
    
    .nab_popup_thumbnail {
        height: auto;
    }
    
    .nab_popup_content {
        max-width: 75%;
        margin: 0px auto;
    }
}

@media (max-width: 767px) {
    .nab_popup_content {
        max-width: 75%;
        margin: 0px auto;
    }
}

/* Animation for auto-close */
@keyframes nab_popup_slide_out {
    0% {
        transform: translate(-50%, -50%);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%);
        opacity: 0;
    }
}

.nab_popup_wrapper.nab_popup_hiding .nab_popup_container {
    animation: nab_popup_slide_out 0.5s forwards;
}

/* Floating animation */
@keyframes nab_popup_float {
    0%, 100% {
        transform: translate(-50%, -50%);
    }
    50% {
        transform: translate(-50%, -52%);
    }
}

.nab_popup_wrapper.nab_popup_active .nab_popup_container {
    animation: nab_popup_float 3s ease-in-out infinite;
}

/* Custom scrollbar for popup content */
.nab_popup_inner_content::-webkit-scrollbar {
    width: 6px;
}

.nab_popup_inner_content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.nab_popup_inner_content::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.nab_popup_inner_content::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}