/* ═══════════════════════════════════════════════════════════════
   STUDIO BLOCK IMAGINE EFECTE — editor modal + randare overlay
   Loaded: in editor (modal) + pe user view (overlay static)
   ═══════════════════════════════════════════════════════════════ */


/* ══════════════════════════════════════════
   OVERLAY IN BLOCUL IMAGINE (editor + view)
   Formele sunt afisate peste imagine folosind procente
   ══════════════════════════════════════════ */

.studio-image-effects-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 3;
}

.studio-image-effect {
    position: absolute;
    pointer-events: none;
    aspect-ratio: 1;
}

.studio-image-effect svg {
    width: 100%;
    height: 100%;
    display: block;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.25));
}


/* ══════════════════════════════════════════
   BADGE STARE EFECTE (in editor)
   - Galben: "Efecte in editare" (nesalvate permanent)
   - Albastru: "Efecte aplicate" (salvate permanent)
   ══════════════════════════════════════════ */

.studio-image-effects-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 4px 10px;
    border-radius: 20px;
    font: 600 11px/1.3 'Inter', -apple-system, sans-serif;
    color: #fff;
    display: none;
    align-items: center;
    gap: 5px;
    z-index: 5;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.25);
}

.studio-image-effects-badge::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.85;
}

.studio-block-imagine.studio-image-effects-editing .studio-image-effects-badge {
    display: inline-flex;
    background: #f59e0b;
}

.studio-block-imagine.studio-image-effects-baked .studio-image-effects-badge {
    display: inline-flex;
    background: #2563eb;
}

.studio-block-imagine.studio-image-effects-editing .studio-image-effects-badge::after {
    content: 'Efecte in editare';
}

.studio-block-imagine.studio-image-effects-baked .studio-image-effects-badge::after {
    content: 'Efecte aplicate';
}


/* ═══════════════════════════════════════════════════════════════
   MODAL EDITOR EFECTE — fereastra care se deschide peste pagina
   ═══════════════════════════════════════════════════════════════ */

.sie-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    outline: none;
}

.sie-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

.sie-modal-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    width: min(1100px, 96vw);
    max-height: 92vh;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 40px 80px -20px rgba(15, 23, 42, 0.45);
    overflow: hidden;
    animation: sie-modal-in 0.2s ease-out;
}

@keyframes sie-modal-in {
    from { opacity: 0; transform: scale(0.96); }
    to   { opacity: 1; transform: scale(1); }
}


/* ── Header modal ── */
.sie-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.sie-modal-title {
    margin: 0;
    font: 700 18px/1.3 'Inter', -apple-system, sans-serif;
    color: #0f172a;
}

.sie-modal-close {
    width: 32px;
    height: 32px;
    border: 0;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    color: #64748b;
    transition: background 0.15s ease;
}

.sie-modal-close:hover {
    background: #e2e8f0;
    color: #0f172a;
}


/* ── Body modal ── */
.sie-modal-body {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 18px 24px;
    flex: 1;
    overflow: auto;
}


/* ── Bara cu forme ── */
.sie-shapes-bar {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    background: #f1f5f9;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.sie-shapes-label {
    font: 600 13px/1.4 'Inter', -apple-system, sans-serif;
    color: #475569;
    white-space: nowrap;
}

.sie-shapes-list {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.sie-shape-btn {
    width: 48px;
    height: 48px;
    border: 2px solid #e2e8f0;
    background: #fff;
    border-radius: 10px;
    cursor: grab;
    padding: 6px;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sie-shape-btn:hover {
    border-color: #2563eb;
    background: #eff6ff;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px -2px rgba(37, 99, 235, 0.25);
}

.sie-shape-btn:active {
    cursor: grabbing;
    transform: scale(0.95);
}

.sie-shape-btn svg {
    width: 100%;
    height: 100%;
    pointer-events: none;
}


/* ── Stage (imaginea pe care se plaseaza efectele) ── */
.sie-stage {
    display: flex;
    justify-content: center;
    align-items: center;
    background: repeating-conic-gradient(#f1f5f9 0% 25%, #e2e8f0 0% 50%) 50% / 24px 24px;
    border-radius: 12px;
    padding: 16px;
    min-height: 300px;
    max-height: 60vh;
    overflow: auto;
}

.sie-stage-inner {
    position: relative;
    display: inline-block;
    max-width: 100%;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 8px 24px -6px rgba(15, 23, 42, 0.25);
    transition: outline 0.15s ease;
    outline: 3px solid transparent;
}

.sie-stage-inner.is-drop-target {
    outline-color: #2563eb;
    outline-offset: 2px;
}

.sie-stage-image {
    display: block;
    max-width: 100%;
    max-height: 60vh;
    width: auto;
    height: auto;
    user-select: none;
    -webkit-user-drag: none;
}


/* ── Stratul cu efectele plasate pe stage ── */
.sie-effects-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
}


/* ── Efect individual pe stage (in modal) ── */
.sie-effect {
    position: absolute;
    aspect-ratio: 1;
    cursor: move;
    pointer-events: auto;
    user-select: none;
}

.sie-effect-shape {
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.sie-effect-shape svg {
    width: 100%;
    height: 100%;
    display: block;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.sie-effect.is-selected {
    outline: 2px dashed #2563eb;
    outline-offset: 4px;
}


/* ── Handle-uri pe efectul selectat ── */
.sie-effect-handle {
    position: absolute;
    width: 22px;
    height: 22px;
    background: #2563eb;
    border: 2px solid #fff;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.3);
    padding: 0;
    cursor: pointer;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    font-family: Arial, sans-serif;
}

.sie-handle-resize {
    right: -14px;
    bottom: -14px;
    cursor: nwse-resize;
}

.sie-handle-rotate {
    left: 50%;
    top: -32px;
    transform: translateX(-50%);
    cursor: ew-resize;
    background: #16a34a;
}

.sie-handle-rotate::before {
    content: '↻';
    font-size: 14px;
    color: #fff;
}

.sie-handle-delete {
    right: -14px;
    top: -14px;
    background: #dc2626;
    cursor: pointer;
}


/* ── Hint text sub stage ── */
.sie-hint {
    font: 400 12px/1.5 'Inter', -apple-system, sans-serif;
    color: #64748b;
    text-align: center;
    padding: 0 8px;
}


/* ── Footer modal ── */
.sie-modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
}

.sie-modal-footer-right {
    display: flex;
    gap: 10px;
}

.sie-btn {
    padding: 9px 18px;
    border-radius: 8px;
    border: 0;
    font: 600 13px/1.3 'Inter', -apple-system, sans-serif;
    cursor: pointer;
    transition: all 0.15s ease;
}

.sie-btn-primary {
    background: #2563eb;
    color: #fff;
}

.sie-btn-primary:hover {
    background: #1d4ed8;
    box-shadow: 0 4px 12px -2px rgba(37, 99, 235, 0.4);
}

.sie-btn-ghost {
    background: transparent;
    color: #475569;
    border: 1px solid #cbd5e1;
}

.sie-btn-ghost:hover {
    background: #f1f5f9;
    color: #0f172a;
}