/* ============================================================================
   DEMO EDITOR CSS — Live Inline Text Editing System
   Provides editable content UI, floating toolbar, toast notifications,
   onboarding bar, modals, and conversion CTAs for demo websites.
   ============================================================================ */

/* ---- Local Nerds Brand Tokens (editor overlay layer) ---- */
:root {
    --ln-bg: #0a0a0f;
    --ln-pink: #B00D68;
    --ln-pink-hover: #d41080;
    --ln-cyan: #40C9F7;
    --ln-text: #f0f0f5;
    --ln-muted: #94a3b8;
    --ln-muted-dark: #64748b;
    --ln-font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --ln-radius: 16px;
    --ln-radius-sm: 12px;
    --ln-radius-btn: 8px;
}


/* ============================================================================
   1. Editable Element States
   ============================================================================ */

.demo-editor-editable {
    cursor: text;
    transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid transparent;
    border-radius: 4px;
    position: relative;
}

.demo-editor-editable:hover {
    border: 1px dashed var(--demo-primary, #1e40af);
    background-color: rgba(30, 64, 175, 0.04);
}

.demo-editor-editable--active,
.demo-editor-editable:focus {
    border: 2px solid var(--demo-primary, #1e40af);
    background-color: rgba(30, 64, 175, 0.06);
    outline: none;
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.12);
}


/* ============================================================================
   2. Floating Toolbar
   ============================================================================ */

.demo-editor-toolbar {
    position: absolute;
    z-index: 9000;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #1e293b;
    border-radius: var(--ln-radius-btn);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3), 0 1px 4px rgba(0, 0, 0, 0.2);
    animation: demo-editor-fade-in 0.15s ease-out;
}

/* Arrow pointer at bottom */
.demo-editor-toolbar::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-top: 7px solid #1e293b;
}

.demo-editor-toolbar__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 16px;
    border: none;
    border-radius: 6px;
    font-family: var(--ln-font);
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease;
    white-space: nowrap;
    line-height: 1.4;
}

.demo-editor-toolbar__btn:active {
    transform: scale(0.96);
}

.demo-editor-toolbar__btn--save {
    background: #10b981;
    color: #fff;
}

.demo-editor-toolbar__btn--save:hover {
    background: #059669;
}

.demo-editor-toolbar__btn--cancel {
    background: #475569;
    color: #e2e8f0;
}

.demo-editor-toolbar__btn--cancel:hover {
    background: #64748b;
}


/* ============================================================================
   3. Toast Notifications
   ============================================================================ */

.demo-editor-toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 24px;
    background: #1e293b;
    color: var(--ln-text);
    border-radius: var(--ln-radius-btn);
    font-family: var(--ln-font);
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
    animation: demo-editor-slide-up 0.3s ease-out;
    pointer-events: auto;
    max-width: calc(100% - 32px);
}

.demo-editor-toast--success {
    border-left: 4px solid #10b981;
}

.demo-editor-toast--error,
.demo-editor-toast--warning {
    border-left: 4px solid var(--ln-pink);
}

.demo-editor-toast--dismiss {
    animation: demo-editor-fade-in 0.2s ease-out reverse forwards;
}


/* ============================================================================
   4. Onboarding Bar
   ============================================================================ */

.demo-editor-onboarding {
    position: fixed;
    bottom: 48px; /* sits just above the demo banner */
    left: 0;
    right: 0;
    z-index: 950;
    background: rgba(10, 10, 15, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid rgba(176, 13, 104, 0.25);
    padding: 12px 24px;
    animation: demo-editor-slide-down 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: var(--ln-font);
}

.demo-editor-onboarding__inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.demo-editor-onboarding__icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    color: var(--ln-cyan);
    opacity: 0.9;
}

.demo-editor-onboarding__text {
    color: var(--ln-muted);
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.4;
}

.demo-editor-onboarding__text strong {
    color: var(--ln-text);
    font-weight: 600;
}

.demo-editor-onboarding__dismiss {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: transparent;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 6px;
    color: var(--ln-muted-dark);
    font-size: 1rem;
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
    margin-left: 8px;
    line-height: 1;
    font-family: var(--ln-font);
}

.demo-editor-onboarding__dismiss:hover {
    color: var(--ln-text);
    border-color: rgba(148, 163, 184, 0.4);
    background: rgba(255, 255, 255, 0.05);
}


/* ============================================================================
   5. Pulsing Hint (Hero H1 first-visit indicator)
   ============================================================================ */

.demo-editor-pulse {
    border: 1px dashed var(--demo-primary, #1e40af);
    border-radius: 4px;
    animation: demo-editor-pulse 2s ease-in-out infinite;
}


/* ============================================================================
   6. Modal Backdrop
   ============================================================================ */

.demo-editor-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 9500;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    animation: demo-editor-fade-in 0.3s ease-out;
}


/* ============================================================================
   7. Modal
   ============================================================================ */

.demo-editor-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9600;
    width: 100%;
    max-width: 480px;
    background: var(--ln-bg);
    border: 1px solid rgba(176, 13, 104, 0.3);
    border-radius: var(--ln-radius);
    padding: 48px 40px;
    box-shadow:
        0 0 80px rgba(176, 13, 104, 0.15),
        0 0 160px rgba(64, 201, 247, 0.08);
    animation: demo-editor-scale-in 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: var(--ln-font);
}


/* ============================================================================
   8. Modal Elements
   ============================================================================ */

.demo-editor-modal__brand {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--ln-pink);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 12px;
}

.demo-editor-modal__heading {
    font-size: 24px;
    font-weight: 700;
    color: var(--ln-text);
    line-height: 1.3;
    margin-bottom: 16px;
}

.demo-editor-modal__body {
    font-size: 16px;
    color: var(--ln-muted);
    line-height: 1.6;
    margin-bottom: 20px;
}

.demo-editor-modal__subtext {
    font-size: 14px;
    color: var(--ln-muted-dark);
    line-height: 1.5;
    margin-bottom: 20px;
}

.demo-editor-modal__features {
    list-style: none;
    padding: 0;
    margin: 0 0 28px;
}

.demo-editor-modal__features li {
    position: relative;
    padding-left: 24px;
    font-size: 14px;
    color: var(--ln-muted);
    line-height: 1.6;
    margin-bottom: 8px;
}

.demo-editor-modal__features li::before {
    content: '\2713';
    position: absolute;
    left: 0;
    color: var(--ln-cyan);
    font-weight: 700;
}

.demo-editor-modal__features li:last-child {
    margin-bottom: 0;
}

.demo-editor-modal__cta {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 48px;
    background: var(--ln-pink);
    color: #fff;
    border: none;
    border-radius: var(--ln-radius-sm);
    font-family: var(--ln-font);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: filter 0.15s ease, transform 0.1s ease;
    text-decoration: none;
    margin-bottom: 16px;
}

.demo-editor-modal__cta:hover {
    filter: brightness(1.15);
    color: #fff;
}

.demo-editor-modal__cta:active {
    transform: scale(0.98);
}

.demo-editor-modal__dismiss {
    display: block;
    width: 100%;
    text-align: center;
    background: none;
    border: none;
    color: var(--ln-cyan);
    font-family: var(--ln-font);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    padding: 4px 0;
    transition: text-decoration 0.15s ease;
    text-decoration: none;
}

.demo-editor-modal__dismiss:hover {
    text-decoration: underline;
}

.demo-editor-modal__close {
    position: absolute;
    top: 16px;
    right: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: transparent;
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 8px;
    color: var(--ln-muted-dark);
    font-size: 1.125rem;
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
    line-height: 1;
    font-family: var(--ln-font);
}

.demo-editor-modal__close:hover {
    color: var(--ln-text);
    border-color: rgba(148, 163, 184, 0.35);
    background: rgba(255, 255, 255, 0.05);
}


/* ============================================================================
   9. Modal Upgrade Variant (gradient top border)
   ============================================================================ */

.demo-editor-modal--upgrade {
    border-top: 2px solid;
    border-image: linear-gradient(to right, #B00D68, #40C9F7) 1;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    /* Wrap in a container div if you need fully rounded corners with gradient border */
    overflow: hidden;
}

/* Restore visual rounding with an inner pseudo-element */
.demo-editor-modal--upgrade::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(to right, #B00D68, #40C9F7);
}


/* ============================================================================
   10. Responsive — Mobile (below 768px)
   ============================================================================ */

@media (max-width: 768px) {
    /* Modal */
    .demo-editor-modal {
        width: calc(100% - 32px);
        max-width: none;
        padding: 32px 24px;
    }

    .demo-editor-modal__heading {
        font-size: 20px;
    }

    .demo-editor-modal__body {
        font-size: 15px;
    }

    /* Toolbar */
    .demo-editor-toolbar__btn {
        min-height: 44px;
        padding: 10px 20px;
        font-size: 0.875rem;
    }

    /* Onboarding bar */
    .demo-editor-onboarding {
        padding: 14px 16px;
    }

    .demo-editor-onboarding__inner {
        flex-wrap: wrap;
        justify-content: center;
        text-align: center;
        gap: 8px;
    }

    .demo-editor-onboarding__text {
        font-size: 0.8125rem;
        flex-basis: 100%;
        order: 2;
    }

    .demo-editor-onboarding__icon {
        order: 1;
    }

    .demo-editor-onboarding__dismiss {
        position: absolute;
        top: 8px;
        right: 12px;
        order: 3;
    }

    .demo-editor-onboarding {
        position: relative;
    }

    /* Toast */
    .demo-editor-toast {
        width: calc(100% - 32px);
        max-width: none;
        bottom: 96px;
    }
}

@media (max-width: 480px) {
    .demo-editor-modal {
        padding: 28px 20px;
    }

    .demo-editor-modal__cta {
        height: 52px;
        font-size: 16px;
    }
}


/* ============================================================================
   11. Animations
   ============================================================================ */

@keyframes demo-editor-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes demo-editor-slide-up {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes demo-editor-scale-in {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes demo-editor-pulse {
    0%, 100% {
        border-color: rgba(var(--demo-primary-rgb, 30, 64, 175), 0.3);
    }
    50% {
        border-color: rgba(var(--demo-primary-rgb, 30, 64, 175), 0.7);
    }
}

@keyframes demo-editor-slide-down {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}


/* ============================================================================
   Reduced Motion Preference
   ============================================================================ */

@media (prefers-reduced-motion: reduce) {
    .demo-editor-editable {
        transition: none;
    }

    .demo-editor-toolbar,
    .demo-editor-toast,
    .demo-editor-onboarding,
    .demo-editor-modal-backdrop,
    .demo-editor-modal,
    .demo-editor-edit-modal,
    .demo-editor-section-inserting,
    .demo-editor-section-removing {
        animation: none;
    }

    .demo-editor-pulse {
        animation: none;
        border-color: rgba(var(--demo-primary-rgb, 30, 64, 175), 0.5);
    }
}


/* ============================================================================
   12. AI Propagation Badge
   ============================================================================ */

.demo-editor-ai-badge {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100002;
    background: #0a0a0f;
    border: 1px solid rgba(64, 201, 247, 0.3);
    box-shadow: 0 0 30px rgba(64, 201, 247, 0.15);
    border-radius: 12px;
    padding: 12px 24px;
    color: #40C9F7;
    font-family: var(--ln-font);
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: demo-editor-scale-in-badge 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.demo-editor-ai-badge--done {
    border-color: rgba(16, 185, 129, 0.3);
    color: #10b981;
}

.demo-editor-ai-badge--done .demo-editor-ai-spinner {
    border-color: rgba(16, 185, 129, 0.3);
    border-top-color: #10b981;
    animation: none;
}

@keyframes demo-editor-scale-in-badge {
    from {
        opacity: 0;
        transform: translateX(-50%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) scale(1);
    }
}


/* ============================================================================
   13. AI Cascade Highlight
   ============================================================================ */

.demo-editor-ai-highlight {
    transition: all 300ms ease;
    box-shadow: 0 0 0 2px rgba(64, 201, 247, 0.6), 0 0 20px rgba(64, 201, 247, 0.15);
    background: rgba(64, 201, 247, 0.05);
    border-radius: 4px;
}


/* ============================================================================
   14. AI Text Transition States
   ============================================================================ */

.demo-editor-ai-updating {
    opacity: 0;
    transform: translateY(-2px);
    transition: opacity 150ms ease, transform 150ms ease;
}

.demo-editor-ai-updated {
    opacity: 1;
    transform: translateY(0);
}


/* ============================================================================
   15. AI Badge Spinner
   ============================================================================ */

.demo-editor-ai-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(64, 201, 247, 0.3);
    border-top-color: #40C9F7;
    border-radius: 50%;
    animation: demo-editor-spin 0.8s linear infinite;
}

@keyframes demo-editor-spin {
    to {
        transform: rotate(360deg);
    }
}


/* ============================================================================
   16. AI Badge Fade-Out
   ============================================================================ */

@keyframes demo-editor-badge-fade-out {
    0% {
        opacity: 1;
        transform: translateX(-50%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) scale(0.95);
    }
}

.demo-editor-ai-badge--fade-out {
    animation: demo-editor-badge-fade-out 300ms ease forwards;
}


/* ============================================================================
   17. Image Overlay Button
   ============================================================================ */

/* Parent containers need relative positioning for the overlay */
.demo-service-card__image,
.demo-hero {
    position: relative;
}

.demo-editor-img-overlay {
    position: absolute;
    bottom: 12px;
    right: 12px;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-family: var(--ln-font);
    font-size: 13px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 200ms ease, background 150ms ease;
}

.demo-service-card__image:hover .demo-editor-img-overlay,
.demo-hero:hover .demo-editor-img-overlay {
    opacity: 1;
}

.demo-editor-img-overlay:hover {
    background: rgba(176, 13, 104, 0.8);
}

.demo-editor-img-overlay svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .demo-editor-img-overlay {
        opacity: 1;
    }
}


/* ============================================================================
   18. Unified Edit Modal (Image + Text modes)
   ============================================================================ */

.demo-editor-edit-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9600;
    width: 100%;
    max-width: 520px;
    background: var(--ln-bg);
    border: 1px solid rgba(176, 13, 104, 0.3);
    border-radius: var(--ln-radius);
    padding: 48px 40px;
    box-shadow:
        0 0 80px rgba(176, 13, 104, 0.15),
        0 0 160px rgba(64, 201, 247, 0.08);
    animation: demo-editor-scale-in 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: var(--ln-font);
}

@media (max-width: 768px) {
    .demo-editor-edit-modal {
        width: calc(100% - 32px);
        max-width: none;
        padding: 32px 24px;
    }
}


/* ============================================================================
   19. Edit Modal — Image Preview Area
   ============================================================================ */

.demo-editor-edit-modal__img-preview {
    width: 100%;
    max-height: 250px;
    border-radius: 8px;
    overflow: hidden;
    background: #1e293b;
    margin-bottom: 20px;
}

.demo-editor-edit-modal__img-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}


/* ============================================================================
   19b. Edit Modal — Text Original Display
   ============================================================================ */

.demo-editor-edit-modal__txt-original {
    margin-bottom: 20px;
}

.demo-editor-edit-modal__txt-original-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--ln-muted-dark);
    margin-bottom: 6px;
}

.demo-editor-edit-modal__txt-original-box {
    background: #1e293b;
    border-radius: 8px;
    padding: 12px 16px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--ln-muted);
    font-family: var(--ln-font);
    font-size: 14px;
    line-height: 1.5;
    max-height: 120px;
    overflow-y: auto;
}


/* ============================================================================
   19c. Edit Modal — Text Comparison Preview
   ============================================================================ */

.demo-editor-edit-modal__txt-compare {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.demo-editor-edit-modal__txt-compare-col {
    flex: 1;
    min-width: 0;
}

.demo-editor-edit-modal__txt-compare-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.demo-editor-edit-modal__txt-compare-label--original {
    color: var(--ln-muted-dark);
}

.demo-editor-edit-modal__txt-compare-label--generated {
    color: #10b981;
}

.demo-editor-edit-modal__txt-compare-box {
    border-radius: 8px;
    padding: 12px 16px;
    font-family: var(--ln-font);
    font-size: 13px;
    line-height: 1.5;
    min-height: 60px;
}

.demo-editor-edit-modal__txt-compare-box--original {
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--ln-muted-dark);
}

.demo-editor-edit-modal__txt-compare-box--generated {
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: var(--ln-text);
}

@media (max-width: 768px) {
    .demo-editor-edit-modal__txt-compare {
        flex-direction: column;
    }
}


/* ============================================================================
   20. Image Tab Switcher
   ============================================================================ */

.demo-editor-edit-modal__tabs {
    display: flex;
    gap: 0;
    margin-bottom: 16px;
}

.demo-editor-edit-modal__tab {
    padding: 10px 20px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--ln-muted-dark);
    font-family: var(--ln-font);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: color 150ms ease, border-color 150ms ease;
}

.demo-editor-edit-modal__tab--active {
    border-bottom-color: var(--ln-pink);
    color: #fff;
}


/* ============================================================================
   21. Prompt Input
   ============================================================================ */

.demo-editor-edit-modal__prompt {
    width: 100%;
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 12px 16px;
    color: #fff;
    font-family: var(--ln-font);
    font-size: 14px;
    margin-bottom: 8px;
    box-sizing: border-box;
    transition: border-color 150ms ease;
}

.demo-editor-edit-modal__prompt::placeholder {
    color: var(--ln-muted-dark);
}

.demo-editor-edit-modal__prompt:focus {
    border-color: var(--ln-pink);
    outline: none;
}


/* ============================================================================
   22. Prompt Hint
   ============================================================================ */

.demo-editor-edit-modal__hint {
    font-size: 12px;
    color: var(--ln-muted-dark);
    margin-bottom: 20px;
}


/* ============================================================================
   23. Generate Button
   ============================================================================ */

.demo-editor-edit-modal__generate {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 48px;
    background: var(--ln-pink);
    color: #fff;
    border: none;
    border-radius: var(--ln-radius-sm);
    font-family: var(--ln-font);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: filter 0.15s ease, transform 0.1s ease;
}

.demo-editor-edit-modal__generate:hover {
    filter: brightness(1.15);
}

.demo-editor-edit-modal__generate:active {
    transform: scale(0.98);
}

.demo-editor-edit-modal__generate:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    filter: none;
    transform: none;
}


/* ============================================================================
   24. Remaining Count
   ============================================================================ */

.demo-editor-edit-modal__remaining {
    text-align: center;
    font-size: 12px;
    color: var(--ln-muted-dark);
    margin-top: 12px;
}


/* ============================================================================
   25. Result Buttons
   ============================================================================ */

.demo-editor-edit-modal__result {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.demo-editor-edit-modal__result-use {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 48px;
    background: var(--ln-pink);
    color: #fff;
    border: none;
    border-radius: var(--ln-radius-sm);
    font-family: var(--ln-font);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: filter 0.15s ease, transform 0.1s ease;
}

.demo-editor-edit-modal__result-use:hover {
    filter: brightness(1.15);
}

.demo-editor-edit-modal__result-use:active {
    transform: scale(0.98);
}

.demo-editor-edit-modal__result-retry {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 48px;
    background: transparent;
    color: var(--ln-cyan);
    border: 1px solid var(--ln-cyan);
    border-radius: var(--ln-radius-sm);
    font-family: var(--ln-font);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease;
}

.demo-editor-edit-modal__result-retry:hover {
    background: rgba(64, 201, 247, 0.1);
}

.demo-editor-edit-modal__result-retry:active {
    transform: scale(0.98);
}


/* ============================================================================
   26. Shimmer Loading Animation
   ============================================================================ */

.demo-editor-edit-modal__shimmer {
    background: linear-gradient(90deg, #1e293b 25%, #2d3748 50%, #1e293b 75%) !important;
    background-size: 200% 100% !important;
    animation: demo-editor-shimmer 1.5s infinite;
}

@keyframes demo-editor-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}


/* ============================================================================
   27. Image Crossfade Transitions
   ============================================================================ */

.demo-editor-img-crossfade {
    transition: opacity 300ms ease;
}

.demo-editor-img-crossfade--out {
    opacity: 0;
}

.demo-editor-img-crossfade--in {
    opacity: 1;
}


/* ============================================================================
   28. Toolbar AI Button
   ============================================================================ */

.demo-editor-toolbar__separator {
    width: 1px;
    height: 20px;
    background: rgba(255, 255, 255, 0.15);
    margin: 0 2px;
}

.demo-editor-toolbar__btn--ai {
    background: var(--ln-pink);
    color: #fff;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.demo-editor-toolbar__btn--ai:hover {
    background: var(--ln-pink-hover);
}


/* ============================================================================
   29. Text Crossfade Transitions
   ============================================================================ */

.demo-editor-txt-crossfade--out {
    opacity: 0;
    transition: opacity 300ms ease;
}

.demo-editor-txt-crossfade--in {
    opacity: 1;
    transition: opacity 300ms ease;
}


/* ============================================================================
   30. Section Builder — Plus Trigger
   ============================================================================ */

.demo-editor-section-trigger {
    position: relative;
    height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
    padding: 30px 0;
    margin: -30px 0;
    z-index: 100;
    pointer-events: auto;
}

.demo-editor-section-trigger__line,
.demo-editor-section-trigger__btn {
    opacity: 0;
    transition: opacity 0.25s ease;
}

.demo-editor-section-trigger:hover .demo-editor-section-trigger__line,
.demo-editor-section-trigger:hover .demo-editor-section-trigger__btn {
    opacity: 1;
}

.demo-editor-section-trigger__line {
    opacity: 0;
}

.demo-editor-section-trigger--visible .demo-editor-section-trigger__line,
.demo-editor-section-trigger--visible .demo-editor-section-trigger__btn {
    opacity: 1;
}

.demo-editor-section-trigger__line {
    position: absolute;
    left: 5%;
    right: 5%;
    height: 2px;
    background: var(--ln-pink);
}

.demo-editor-section-trigger__btn {
    position: relative;
    z-index: 1;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--ln-pink);
    color: #fff;
    border: none;
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(176, 13, 104, 0.4);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.demo-editor-section-trigger__btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 16px rgba(176, 13, 104, 0.5);
}


/* ============================================================================
   31. Step Indicator
   ============================================================================ */

.demo-editor-section-step {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.demo-editor-section-step__label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ln-pink);
}

.demo-editor-section-step__dots {
    display: flex;
    gap: 4px;
}

.demo-editor-section-step__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
}

.demo-editor-section-step__dot--active {
    background: var(--ln-pink);
}

.demo-editor-section-step__dot--done {
    background: var(--ln-cyan);
}


/* ============================================================================
   32. Type Picker (Step 1)
   ============================================================================ */

.demo-editor-section-types {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.demo-editor-section-type {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: #1e293b;
    border: 2px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.demo-editor-section-type:hover {
    border-color: rgba(176, 13, 104, 0.3);
    background: #253046;
}

.demo-editor-section-type--selected {
    border-color: var(--ln-pink);
    background: rgba(176, 13, 104, 0.1);
}

.demo-editor-section-type__icon {
    font-size: 1.5rem;
    margin-bottom: 6px;
}

.demo-editor-section-type__label {
    font-size: 12px;
    font-weight: 600;
    color: var(--ln-text);
}


/* ============================================================================
   33. Layout Picker (Step 2)
   ============================================================================ */

.demo-editor-section-layouts {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.demo-editor-section-layout {
    flex: 1;
    min-width: 80px;
    max-width: 120px;
    padding: 10px;
    background: #1e293b;
    border: 2px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
    text-align: center;
}

.demo-editor-section-layout:hover {
    border-color: rgba(176, 13, 104, 0.3);
    background: #253046;
}

.demo-editor-section-layout--selected {
    border-color: var(--ln-pink);
    background: rgba(176, 13, 104, 0.1);
}

.demo-editor-section-layout__wireframe {
    width: 100%;
    height: 40px;
    margin-bottom: 6px;
}

.demo-editor-section-layout__wireframe svg {
    width: 100%;
    height: 100%;
}

.demo-editor-section-layout__label {
    font-size: 10px;
    color: var(--ln-muted);
    transition: color 0.15s ease;
}

.demo-editor-section-layout--selected .demo-editor-section-layout__label {
    color: #fff;
}


/* ============================================================================
   34. Preview Area
   ============================================================================ */

.demo-editor-section-preview {
    max-height: 300px;
    overflow-y: auto;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: #fff;
    color: #1e293b;
}

.demo-editor-section-preview__inner {
    transform: scale(0.6);
    transform-origin: top left;
    width: 166.67%;
    pointer-events: none;
}


/* ============================================================================
   35. Navigation Buttons
   ============================================================================ */

.demo-editor-section-nav {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

.demo-editor-section-nav__back {
    background: transparent;
    color: var(--ln-muted);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: var(--ln-radius-btn);
    padding: 10px 20px;
    font-family: var(--ln-font);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease;
}

.demo-editor-section-nav__back:hover {
    border-color: rgba(148, 163, 184, 0.4);
    color: var(--ln-text);
}

.demo-editor-section-nav__next {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 48px;
    background: var(--ln-pink);
    color: #fff;
    border: none;
    border-radius: var(--ln-radius-sm);
    font-family: var(--ln-font);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: filter 0.15s ease, transform 0.1s ease;
}

.demo-editor-section-nav__next:hover {
    filter: brightness(1.15);
}

.demo-editor-section-nav__next:active {
    transform: scale(0.98);
}

.demo-editor-section-nav__next:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    filter: none;
    transform: none;
}


/* ============================================================================
   36. Section Controls (Drag + Delete)
   ============================================================================ */

.demo-editor-section-controls {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 100;
    display: flex;
    gap: 4px;
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 8px;
    padding: 4px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

[data-added-section] {
    position: relative;
}

[data-added-section]:hover > .demo-editor-section-controls {
    opacity: 1;
}

.demo-editor-section-controls__btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.demo-editor-section-controls__btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.demo-editor-section-controls__btn--drag {
    cursor: grab;
}

.demo-editor-section-controls__btn--drag:active {
    cursor: grabbing;
}

.demo-editor-section-controls__btn--delete:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.demo-editor-section-controls__confirm {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--ln-text);
    font-family: var(--ln-font);
}

.demo-editor-section-controls__confirm-btn {
    padding: 4px 10px;
    border: none;
    border-radius: 4px;
    font-family: var(--ln-font);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: filter 0.15s ease;
}

.demo-editor-section-controls__confirm-btn--yes {
    background: #ef4444;
    color: #fff;
}

.demo-editor-section-controls__confirm-btn--yes:hover {
    filter: brightness(1.15);
}

.demo-editor-section-controls__confirm-btn--no {
    background: rgba(255, 255, 255, 0.1);
    color: var(--ln-text);
}

.demo-editor-section-controls__confirm-btn--no:hover {
    background: rgba(255, 255, 255, 0.15);
}


/* ============================================================================
   37. Drag-and-Drop States
   ============================================================================ */

.demo-editor-section-dragging {
    opacity: 0.4;
    outline: 2px dashed var(--ln-cyan);
}

.demo-editor-section-drop-indicator {
    height: 4px;
    background: var(--ln-cyan);
    border-radius: 2px;
    margin: 0 5%;
    box-shadow: 0 0 12px rgba(64, 201, 247, 0.5);
    z-index: 200;
    position: relative;
}


/* ============================================================================
   38. Insertion / Removal Animations
   ============================================================================ */

.demo-editor-section-inserting {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    animation: demo-editor-section-expand 0.5s ease forwards;
}

@keyframes demo-editor-section-expand {
    0% {
        max-height: 0;
        opacity: 0;
    }
    100% {
        max-height: 2000px;
        opacity: 1;
    }
}

.demo-editor-section-removing {
    animation: demo-editor-section-collapse 0.3s ease forwards;
}

@keyframes demo-editor-section-collapse {
    0% {
        max-height: 2000px;
        opacity: 1;
    }
    100% {
        max-height: 0;
        opacity: 0;
        overflow: hidden;
    }
}


/* ============================================================================
   39. Responsive — Section Builder (below 768px)
   ============================================================================ */

@media (max-width: 768px) {
    .demo-editor-section-layouts {
        flex-wrap: wrap;
    }

    .demo-editor-section-layout {
        min-width: 70px;
    }

    .demo-editor-section-preview__inner {
        transform: scale(0.5);
        width: 200%;
    }

    .demo-editor-section-controls {
        opacity: 1;
    }

    .demo-editor-section-trigger__btn {
        opacity: 0.6;
    }

    .demo-editor-section-trigger__line {
        opacity: 0;
    }
}
