/* ============================================
   EXTRA.CSS — AI IMAGE PROMPTS LIBRARY
   New features only. Original CSS untouched.
   Features:
   - Coming Soon badge
   - Before / After image toggle on card
   - Learn More modal (full page style)
   - Editable prompt pad inside modal
   - Skeleton lazy-load cards
   - Download button
   ============================================ */

/* ============================================
   1. COMING SOON BADGE
   Shows when both showCopyBtn & showLearnMore = false
   ============================================ */

.nl-coming-soon-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: 100%;
    padding: 9px 0;
    border-radius: 40px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.1);
    border: 1.5px dashed rgba(245, 158, 11, 0.4);
    margin-top: 16px;
    cursor: default;
    user-select: none;
    animation: csPulse 2.5s ease-in-out infinite;
}

.nl-coming-soon-badge i {
    font-size: 11px;
    animation: csSpin 3s linear infinite;
}

@keyframes csPulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(245,158,11,0); }
    50%       { opacity: 0.75; box-shadow: 0 0 0 6px rgba(245,158,11,0.08); }
}

@keyframes csSpin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}


/* ============================================
   2. BEFORE / AFTER IMAGE TOGGLE ON CARD
   ============================================ */

/* Toggle bar sits at the bottom of .nl-prompt-thumb */
.nl-ba-toggle {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    display: flex;
    gap: 0;
    border-radius: 30px;
    overflow: hidden;
    border: 1.5px solid rgba(255,255,255,0.18);
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
    backdrop-filter: blur(6px);
}

.nl-ba-btn {
    padding: 5px 14px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.4px;
    border: none;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.22s ease;
    background: rgba(10, 12, 30, 0.75);
    color: rgba(255,255,255,0.6);
}

.nl-ba-btn:first-child {
    border-right: 1px solid rgba(255,255,255,0.12);
}

.nl-ba-btn.nl-ba-active {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
}

.nl-ba-btn:hover:not(.nl-ba-active) {
    background: rgba(99,102,241,0.25);
    color: #fff;
}

/* Fade transition when swapping images */
.nl-prompt-image.nl-ba-fade {
    animation: baFade 0.28s ease;
}

@keyframes baFade {
    from { opacity: 0.3; transform: scale(0.98); }
    to   { opacity: 1;   transform: scale(1); }
}


/* ============================================
   3. SKELETON LOADING CARDS
   Show while a JSON file is being fetched
   ============================================ */

.nl-skeleton-card {
    background: linear-gradient(145deg, rgba(20,28,65,0.88), rgba(14,20,48,0.92));
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.nl-skeleton-thumb {
    width: 100%;
    height: 200px;
    background: linear-gradient(90deg,
        rgba(255,255,255,0.04) 25%,
        rgba(255,255,255,0.09) 50%,
        rgba(255,255,255,0.04) 75%
    );
    background-size: 200% 100%;
    animation: skeletonShimmer 1.5s infinite;
}

.nl-skeleton-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.nl-skeleton-line {
    height: 12px;
    border-radius: 6px;
    background: linear-gradient(90deg,
        rgba(255,255,255,0.04) 25%,
        rgba(255,255,255,0.09) 50%,
        rgba(255,255,255,0.04) 75%
    );
    background-size: 200% 100%;
    animation: skeletonShimmer 1.5s infinite;
}

.nl-skeleton-line.nl-sk-title  { width: 65%; height: 14px; }
.nl-skeleton-line.nl-sk-text1  { width: 100%; }
.nl-skeleton-line.nl-sk-text2  { width: 88%; }
.nl-skeleton-line.nl-sk-text3  { width: 75%; }

.nl-skeleton-actions {
    display: flex;
    gap: 10px;
    margin-top: 6px;
}

.nl-skeleton-btn {
    flex: 1;
    height: 34px;
    border-radius: 40px;
    background: linear-gradient(90deg,
        rgba(255,255,255,0.04) 25%,
        rgba(255,255,255,0.09) 50%,
        rgba(255,255,255,0.04) 75%
    );
    background-size: 200% 100%;
    animation: skeletonShimmer 1.5s infinite;
}

@keyframes skeletonShimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}


/* ============================================
   4. LEARN MORE MODAL
   Full-page overlay, not a tiny popup
   ============================================ */

/* Overlay */
.nl-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(4, 6, 20, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 24px 16px 40px;
    overflow-y: auto;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.nl-modal-overlay.nl-modal-open {
    opacity: 1;
    pointer-events: all;
}

/* Modal Box */
.nl-modal-box {
    width: 100%;
    max-width: 820px;
    background: linear-gradient(145deg, rgba(16,22,56,0.98), rgba(10,14,38,0.99));
    border: 1px solid rgba(99,102,241,0.25);
    border-radius: 28px;
    overflow: hidden;
    position: relative;
    box-shadow:
        0 30px 80px rgba(0,0,0,0.6),
        0 0 0 1px rgba(255,255,255,0.04) inset;
    transform: translateY(30px);
    transition: transform 0.35s cubic-bezier(0.4,0,0.2,1);
    margin: auto;
}

.nl-modal-overlay.nl-modal-open .nl-modal-box {
    transform: translateY(0);
}

/* Close button */
.nl-modal-close {
    position: absolute;
    top: 18px;
    right: 18px;
    z-index: 10;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.06);
    color: #a0a0c0;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    backdrop-filter: blur(6px);
}

.nl-modal-close:hover {
    background: rgba(239,68,68,0.2);
    border-color: rgba(239,68,68,0.4);
    color: #ef4444;
    transform: rotate(90deg);
}

/* ── Modal: Video Section ── */
.nl-modal-video-wrap {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    position: relative;
    overflow: hidden;
}

.nl-modal-video-wrap iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* Placeholder when no video URL given */
.nl-modal-video-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: linear-gradient(135deg, rgba(99,102,241,0.08), rgba(139,92,246,0.06));
    color: #6b6b8a;
    font-size: 14px;
}

.nl-modal-video-placeholder i {
    font-size: 48px;
    color: rgba(99,102,241,0.35);
}

/* ── Modal: Body ── */
.nl-modal-body {
    padding: 32px 36px 40px;
}

/* Premium badge inside modal */
.nl-modal-premium-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 14px;
    border-radius: 50px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: #fbbf24;
    background: rgba(251,191,36,0.1);
    border: 1px solid rgba(251,191,36,0.25);
    margin-bottom: 14px;
}

/* Modal heading */
.nl-modal-heading {
    font-size: 26px;
    font-weight: 800;
    color: #fff;
    line-height: 1.3;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #ffffff 0%, #c4c8ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Modal description */
.nl-modal-desc {
    font-size: 14.5px;
    color: #9ea3c0;
    line-height: 1.75;
    margin-bottom: 28px;
}

/* Divider */
.nl-modal-divider {
    height: 1px;
    background: linear-gradient(90deg,
        transparent,
        rgba(99,102,241,0.35) 30%,
        rgba(139,92,246,0.4) 50%,
        rgba(99,102,241,0.35) 70%,
        transparent
    );
    margin: 28px 0;
}

/* ── Modal: Editable Prompt Pad ── */
.nl-modal-pad-label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: #6366f1;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 7px;
}

.nl-modal-pad-label i {
    font-size: 11px;
}

.nl-modal-pad {
    width: 100%;
    min-height: 120px;
    padding: 16px;
    border-radius: 14px;
    border: 1.5px solid rgba(99,102,241,0.25);
    background: rgba(255,255,255,0.03);
    color: #cbd5e1;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 12.5px;
    line-height: 1.7;
    resize: vertical;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
    word-break: break-word;
}

.nl-modal-pad:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
    background: rgba(255,255,255,0.05);
}

/* Loading spinner inside pad while promptFile fetches */
.nl-modal-pad-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 16px;
    border-radius: 14px;
    border: 1.5px solid rgba(99,102,241,0.15);
    background: rgba(255,255,255,0.02);
    color: #6b6b8a;
    font-size: 13px;
}

.nl-modal-pad-loading i {
    color: #6366f1;
    font-size: 16px;
}

/* ── Modal: Action Buttons ── */
.nl-modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 18px;
    flex-wrap: wrap;
}

.nl-modal-copy-btn,
.nl-modal-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    border-radius: 40px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    font-family: inherit;
    letter-spacing: 0.2px;
}

.nl-modal-copy-btn {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    flex: 1;
    justify-content: center;
}

.nl-modal-copy-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(99,102,241,0.45);
}

.nl-modal-copy-btn.nl-modal-copied {
    background: linear-gradient(135deg, #10b981, #059669);
}

.nl-modal-download-btn {
    background: rgba(99,102,241,0.12);
    color: #a5b4fc;
    border: 1.5px solid rgba(99,102,241,0.3);
    padding: 10px 20px;
}

.nl-modal-download-btn:hover {
    background: rgba(99,102,241,0.22);
    color: white;
    transform: translateY(-2px);
}

/* ── Modal: Before / After Images ── */
.nl-modal-ba-section {
    margin-top: 28px;
}

.nl-modal-ba-label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: #6366f1;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 7px;
}

.nl-modal-ba-label i {
    font-size: 11px;
}

.nl-modal-ba-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.nl-modal-ba-item {
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.07);
}

.nl-modal-ba-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.nl-modal-ba-item:hover img {
    transform: scale(1.04);
}

.nl-modal-ba-tag {
    position: absolute;
    bottom: 10px;
    left: 10px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    backdrop-filter: blur(8px);
}

.nl-modal-ba-tag.nl-tag-before {
    background: rgba(239,68,68,0.75);
    color: #fff;
    border: 1px solid rgba(239,68,68,0.5);
}

.nl-modal-ba-tag.nl-tag-after {
    background: rgba(16,185,129,0.75);
    color: #fff;
    border: 1px solid rgba(16,185,129,0.5);
}

/* Single image (only one provided) */
.nl-modal-ba-grid.nl-ba-single {
    grid-template-columns: 1fr;
    max-width: 420px;
}


/* ============================================
   5. LEARN MORE — button style override
   Makes it look like a button not an <a> link
   ============================================ */

.nl-detail-link {
    /* inherits from original CSS, just override look */
    cursor: pointer;
    text-decoration: none !important;
}


/* ============================================
   6. RESPONSIVE — Modal
   ============================================ */

@media (max-width: 767px) {
    .nl-modal-overlay {
        padding: 16px 10px 32px;
        align-items: flex-start;
    }

    .nl-modal-body {
        padding: 22px 20px 30px;
    }

    .nl-modal-heading {
        font-size: 20px;
    }

    .nl-modal-ba-grid {
        grid-template-columns: 1fr;
    }

    .nl-modal-ba-item img {
        height: 180px;
    }

    .nl-modal-actions {
        flex-direction: column;
    }

    .nl-modal-copy-btn,
    .nl-modal-download-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .nl-modal-heading {
        font-size: 18px;
    }

    .nl-modal-pad {
        font-size: 11.5px;
    }
}

/* ============================================
   7. PROMPT PREVIEW ON CARD
   Truncates long inline prompts to ~3 lines.
   Full text stays hidden in DOM for copy.
   ============================================ */

/* Wrapper clips height */
.nl-prompt-preview-wrap {
    position: relative;
    max-height: 58px;
    overflow: hidden;
    margin: 10px 0;
    border-radius: 8px;
}

/* The visible truncated text — same look as .nl-prompt-text */
.nl-prompt-preview-text {
    font-family: 'Monaco', 'Courier New', monospace;
    background: rgba(255,255,255,0.04);
    padding: 10px 12px;
    font-size: 11px;
    line-height: 1.6;
    word-break: break-word;
    white-space: normal;
    color: #cbd5e1;
    border-left: 3px solid #6366f1;
    border-radius: 8px;
}

/* Fade-out gradient at bottom edge */
.nl-prompt-fade {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 26px;
    background: linear-gradient(
        to bottom,
        transparent,
        rgba(14, 18, 48, 0.96)
    );
    pointer-events: none;
    border-radius: 0 0 8px 8px;
}


/* ============================================
   8. PROMPT FILE HINT BADGE
   Shows on cards where prompt is in promptFile.
   Disappears after first copy loads the text.
   ============================================ */

.nl-prompt-file-hint {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 500;
    color: rgba(165, 180, 252, 0.7);
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 20px;
    padding: 4px 11px;
    margin: 8px 0 10px;
    letter-spacing: 0.2px;
    user-select: none;
}

.nl-prompt-file-hint i {
    font-size: 10px;
    opacity: 0.8;
}