/* ==========================================================================
   NJ Popup Plugin - Frontend Modal Styles
   ========================================================================== */

/* Variables Default Fallbacks */
:root {
    --nj-popup-bg: #ffffff;
    --nj-popup-text: #1e293b;
    --nj-popup-overlay: rgba(15, 23, 42, 0.65);
    --nj-popup-accent: #4f46e5;
}

/* Overlay Backdrop */
.nj-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: var(--nj-popup-overlay);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
}

.nj-popup-overlay.nj-popup-active {
    opacity: 1;
    visibility: visible;
}

/* Modal Dialog Container */
.nj-popup-container {
    position: relative;
    width: 100%;
    max-width: 520px;
    background-color: var(--nj-popup-bg);
    color: var(--nj-popup-text);
    border-radius: 20px;
    padding: 32px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.1);
    transform: scale(0.9) translateY(20px);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.nj-popup-overlay.nj-popup-active .nj-popup-container {
    transform: scale(1) translateY(0);
}

/* Close Icon (Top Right 'X') */
.nj-popup-close-icon {
    position: absolute !important;
    top: 14px !important;
    right: 14px !important;
    width: 36px !important;
    height: 36px !important;
    border-radius: 50% !important;
    background-color: #000000 !important;
    background: #000000 !important;
    border: 1px solid #ffffff !important;
    color: #ffffff !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: transform 0.25s ease, background-color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease !important;
    outline: none !important;
    padding: 0 !important;
    z-index: 999 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4) !important;
}

.nj-popup-close-icon svg {
    width: 20px !important;
    height: 20px !important;
    stroke: #ffffff !important;
    color: #ffffff !important;
    display: block !important;
}

.nj-popup-close-icon:hover {
    background-color: #222222 !important;
    background: #222222 !important;
    border-color: #ffffff !important;
    transform: rotate(90deg) scale(1.08) !important;
}

.nj-popup-close-icon:focus-visible {
    box-shadow: 0 0 0 3px var(--nj-popup-accent) !important;
}

/* Header & Title */
.nj-popup-header {
    margin-bottom: 16px;
    padding-right: 36px;
}

.nj-popup-title {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.3;
    color: inherit;
    letter-spacing: -0.02em;
}

/* Body Content */
.nj-popup-body {
    font-size: 15px;
    line-height: 1.6;
    color: inherit;
    opacity: 0.9;
    margin-bottom: 24px;
    word-break: break-word;
}

.nj-popup-body p {
    margin: 0 0 12px 0;
}

.nj-popup-body p:last-child {
    margin-bottom: 0;
}

.nj-popup-body img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

/* Footer & Main Close Button */
.nj-popup-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: auto;
}

.nj-popup-close-btn {
    background-color: var(--nj-popup-accent);
    color: #ffffff;
    border: none;
    padding: 12px 28px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.2s ease, filter 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
    outline: none;
}

.nj-popup-close-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.nj-popup-close-btn:active {
    transform: translateY(0);
}

/* Prevent body scroll when popup is open */
body.nj-popup-open {
    overflow: hidden !important;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .nj-popup-container {
        padding: 24px 20px;
        border-radius: 16px;
    }
    .nj-popup-title {
        font-size: 20px;
    }
    .nj-popup-close-btn {
        width: 100%;
        text-align: center;
    }
}
