/* =========================================================================
   PURPLE LOGIN — IMAGE EDITOR MODAL (PROFESSIONAL)
   ========================================================================= */

.pl-editor-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.pl-editor-overlay.active { opacity: 1; visibility: visible; }

/* ===== MODAL ===== */
.pl-editor-modal {
    background: #14162b;
    border-radius: 8px;
    width: 96vw;
    max-width: 620px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255,255,255,0.05);
    transform: scale(0.92);
    transition: transform 0.3s ease;
}
.pl-editor-overlay.active .pl-editor-modal { transform: scale(1); }

/* ===== HEADER ===== */
.pl-editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    background: linear-gradient(180deg, #1c1f3a, #171a32);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.pl-editor-title {
    color: #dce1eb; font-size: 12px; font-weight: 700;
    font-family: var(--font-main, 'Share Tech', sans-serif);
    letter-spacing: 0.5px;
}
.pl-editor-close {
    background: rgba(255,255,255,0.06); border: none; color: #667;
    font-size: 14px; cursor: pointer; padding: 3px 7px; line-height: 1;
    border-radius: 4px; transition: all 0.2s;
}
.pl-editor-close:hover { color: #fff; background: rgba(233,69,96,0.3); }

/* ===== TABS ===== */
.pl-editor-tabs {
    display: flex;
    background: #0e1530;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.pl-editor-tab {
    flex: 1; padding: 7px 0; text-align: center;
    font-size: 10px; font-weight: 700; color: #556688;
    cursor: pointer; background: none; border: none;
    border-bottom: 2px solid transparent;
    font-family: var(--font-main, 'Share Tech', sans-serif);
    letter-spacing: 0.8px; text-transform: uppercase;
    transition: all 0.2s;
}
.pl-editor-tab:hover { color: #aabbcc; }
.pl-editor-tab.active { color: #e94560; border-bottom-color: #e94560; }

/* ===== BODY ===== */
.pl-editor-body {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.pl-editor-canvas-wrap {
    display: flex;
    flex-direction: row;
    background: #0a0c1a;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* --- LEFT: Filter buttons --- */
.pl-filter-presets {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 8px 6px;
    background: linear-gradient(180deg, #171a32, #131530);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    width: 90px;
    flex-shrink: 0;
}
.pl-filter-preset {
    padding: 6px 6px;
    font-size: 9px;
    font-weight: 700;
    background: rgba(15, 52, 96, 0.4);
    color: #8899bb;
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s;
    font-family: var(--font-main, 'Share Tech', sans-serif);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
    line-height: 1;
}
.pl-filter-preset:hover {
    background: rgba(30, 70, 130, 0.5);
    color: #dde4f0;
    border-color: rgba(255,255,255,0.12);
}
.pl-filter-preset.active {
    background: linear-gradient(135deg, #e94560, #c13050);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(233, 69, 96, 0.3);
}

/* --- RIGHT: Photo area --- */
.pl-editor-canvas-inner {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    min-height: 0;
    height: 280px;
    overflow: hidden;
    position: relative;
    background: #0a0c1a;
}
.pl-editor-canvas-wrap > img,
.pl-editor-canvas-inner img {
    max-width: 100%;
    max-height: 100%;
    display: block;
    object-fit: contain;
    border-radius: 2px;
}
.pl-editor-render-canvas { display: none; }

/* ===== STICKER LAYER ===== */
.pl-sticker-layer {
    position: absolute; top: 0; right: 0; bottom: 0; left: 0;
    pointer-events: none; overflow: hidden;
}
.pl-sticker-item {
    position: absolute; cursor: grab; pointer-events: auto;
    user-select: none; font-size: 24px; line-height: 1;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,0.3));
}
.pl-sticker-item:active { cursor: grabbing; }
.pl-sticker-item .pl-sticker-delete {
    position: absolute; top: -5px; right: -5px;
    width: 14px; height: 14px;
    background: #e94560; color: #fff; border: none; border-radius: 50%;
    font-size: 8px; cursor: pointer; display: none;
    align-items: center; justify-content: center; line-height: 1; padding: 0;
}
.pl-sticker-item:hover .pl-sticker-delete { display: flex; }
.pl-sticker-item .pl-sticker-resize {
    position: absolute; bottom: -3px; right: -3px;
    width: 8px; height: 8px;
    background: #0f3460; border: 1px solid #e94560; border-radius: 1px;
    cursor: se-resize; display: none;
}
.pl-sticker-item:hover .pl-sticker-resize { display: block; }

/* ===== SLIDERS ===== */
.pl-editor-controls {
    padding: 8px 14px;
    background: linear-gradient(180deg, #171a32, #14162b);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}
.pl-enhance-controls {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.pl-enhance-row {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 18px;
}
.pl-enhance-label {
    font-size: 8px; color: #667799; min-width: 60px;
    font-weight: 700; font-family: var(--font-main, 'Share Tech', sans-serif);
    text-transform: uppercase; letter-spacing: 0.4px;
}
.pl-enhance-slider {
    flex: 1; -webkit-appearance: none; appearance: none;
    height: 3px; background: #1a2040; border-radius: 2px; outline: none;
}
.pl-enhance-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px; height: 12px; background: #e94560;
    border-radius: 50%; cursor: pointer; border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}
.pl-enhance-slider::-moz-range-thumb {
    width: 12px; height: 12px; background: #e94560;
    border-radius: 50%; cursor: pointer; border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}
.pl-enhance-value {
    font-size: 8px; color: #e94560; min-width: 28px;
    text-align: right; font-weight: 700; font-family: monospace;
}

/* ===== STICKER CONTROLS ===== */
.pl-sticker-controls { display: flex; flex-direction: column; gap: 5px; }
.pl-sticker-category-label {
    font-size: 8px; color: #556; text-transform: uppercase;
    letter-spacing: 0.8px; font-weight: 700;
    font-family: var(--font-main, 'Share Tech', sans-serif);
}
.pl-sticker-grid { display: flex; flex-wrap: wrap; gap: 3px; }
.pl-sticker-pick {
    width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    font-size: 15px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 5px; cursor: pointer; transition: all 0.15s;
}
.pl-sticker-pick:hover {
    background: rgba(233, 69, 96, 0.15);
    border-color: #e94560; transform: scale(1.1);
}

/* ===== CAPTION ===== */
.pl-editor-caption-wrap {
    padding: 5px 14px;
    background: #171a32;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}
.pl-editor-caption {
    width: 100%; min-height: 28px; max-height: 36px;
    padding: 5px 8px; background: #0e1530;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px; color: #dce1eb; font-size: 11px;
    font-family: var(--font-main, 'Share Tech', sans-serif);
    resize: none; outline: none; box-sizing: border-box;
    transition: border-color 0.2s;
}
.pl-editor-caption:focus { border-color: #e94560; }
.pl-editor-caption::placeholder { color: #445; }

/* ===== FOOTER ===== */
.pl-editor-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    background: linear-gradient(180deg, #171a32, #131530);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.pl-editor-btn {
    padding: 6px 16px;
    font-size: 10px;
    font-weight: 700;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-family: var(--font-main, 'Share Tech', sans-serif);
    transition: all 0.2s;
    letter-spacing: 0.3px;
}
.pl-editor-btn--cancel {
    background: rgba(255,255,255,0.06);
    color: #8899aa;
}
.pl-editor-btn--cancel:hover { background: rgba(255,255,255,0.1); color: #fff; }
.pl-editor-btn--reset {
    background: none;
    color: #e94560;
    border: 1px solid rgba(233,69,96,0.4);
}
.pl-editor-btn--reset:hover {
    background: rgba(233,69,96,0.1);
    border-color: #e94560;
}
.pl-editor-btn--apply {
    background: linear-gradient(135deg, #e94560, #5B2C8A);
    color: #fff;
    padding: 6px 20px;
    box-shadow: 0 2px 10px rgba(233, 69, 96, 0.25);
}
.pl-editor-btn--apply:hover {
    filter: brightness(1.15);
    box-shadow: 0 4px 16px rgba(233, 69, 96, 0.35);
    transform: translateY(-1px);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 520px) {
    .pl-editor-modal { width: 100vw; max-width: 100vw; border-radius: 0; }
    .pl-filter-presets { width: 72px; padding: 6px 4px; }
    .pl-filter-preset { font-size: 8px; padding: 5px 4px; }
    .pl-editor-canvas-inner { height: 220px; padding: 8px; }
    .pl-editor-controls { padding: 6px 10px; }
    .pl-sticker-pick { width: 24px; height: 24px; font-size: 13px; }
}
