/* Smart Print Visual Selection Overlay Styling */

.smart-print-btn {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    border: none;
}

/* Full Screen Overlay */
.smart-print-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #e0e0e0;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-family: sans-serif;
}

/* Top Control Bar */
.smart-print-topbar {
    background: #fff;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    z-index: 10;
}

.smart-print-topbar-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
}

.smart-print-topbar-info {
    font-size: 0.9rem;
    color: #666;
    margin-left: 15px;
}

.smart-print-actions {
    display: flex;
    gap: 15px;
}

.smart-print-action-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.2s;
}

.smart-print-action-btn.cancel {
    background: #f8f9fa;
    border: 1px solid #ddd;
    color: #333;
}

.smart-print-action-btn.cancel:hover {
    background: #e2e6ea;
}

.smart-print-action-btn.generate {
    background: #007bff;
    color: #fff;
    box-shadow: 0 4px 6px rgba(0, 123, 255, 0.2);
}

.smart-print-action-btn.generate:hover {
    background: #0056b3;
}

/* Preview Area */
.smart-print-preview-area {
    flex: 1;
    overflow: auto;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 40px;
}

/* The Cloned Container (1380px wide) */
.smart-print-clone-wrapper {
    background: #fff;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    transform-origin: top center;
    /* width is forced inline by JS based on user request (1380px) */
    position: relative;
    /* transition: transform 0.2s ease-out; */
}

/* Prevent clicking links in preview */
.smart-print-clone-wrapper a {
    pointer-events: none !important;
}

/* Hover & Delete Interaction */
.smart-print-clone-wrapper .elementor-section, 
.smart-print-clone-wrapper .elementor-widget,
.smart-print-clone-wrapper .elementor-accordion-item,
.smart-print-clone-wrapper .e-n-accordion-item {
    position: relative;
    transition: box-shadow 0.2s, opacity 0.3s;
}

/* Hover border */
.smart-print-clone-wrapper .sp-hoverable:hover {
    box-shadow: 0 0 0 3px #007bff inset !important;
    cursor: pointer;
}

/* The X button */
.sp-delete-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #ff4d4f;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 14px;
    line-height: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transition: opacity 0.2s, transform 0.1s;
}

.smart-print-clone-wrapper .sp-hoverable:hover > .sp-delete-btn {
    opacity: 1;
    pointer-events: auto;
}

.sp-delete-btn:hover {
    transform: scale(1.1);
    background: #ff7875;
}

/* Deleted State */
.smart-print-clone-wrapper .sp-deleted {
    opacity: 0 !important;
    pointer-events: none !important;
    /* display: none would collapse the layout, opacity 0 keeps the layout. But the user asked to 'hide it'. 
       If they want "What you see is what you get", if we hide it with display:none it collapses. 
       Usually opacity: 0.3 or display: none is fine. The prompt says "opacity: 0 or display: none". 
       Let's use display: none so the page shrinks properly. */
    display: none !important;
}

/* Hide modal when printing and isolate the final output */
@media print {
    body.smart-print-active > *:not(#smart-print-final-output) {
        display: none !important;
    }
    #smart-print-final-output {
        display: block !important;
    }
    .smart-print-overlay {
        display: none !important;
    }
}
