/* ==========================================================================
   🎨 Gallery+ In-Place Lightbox Image Editor Stylesheet
   ========================================================================== */

.image-editor-container {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10050;
    display: flex;
    flex-direction: column;
    background: #0a0d14;
    user-select: none;
    animation: editorFadeIn 0.2s ease-out forwards;
}

@keyframes editorFadeIn {
    from {
        opacity: 0;
        transform: scale(0.99);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* 🎯 Editor Top Header */
.image-editor-header {
    position: relative;
    width: 100%;
    height: 64px;
    background: #0d111a;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 1060;
    flex-shrink: 0;
}

.image-editor-left,
.image-editor-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.image-editor-center {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.04);
    padding: 4px 8px;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    overflow-x: auto;
    max-width: calc(100vw - 320px);
    scrollbar-width: none;
}
.image-editor-center::-webkit-scrollbar {
    display: none;
}

/* Tool Buttons */
.editor-tool-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.85);
    font-family: 'Outfit', sans-serif;
    font-size: 13px;
    font-weight: 500;
    padding: 7px 12px;
    border-radius: 18px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    transition: all 0.18s ease;
    white-space: nowrap;
}

.editor-tool-btn i {
    font-size: 14px;
}

.editor-tool-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    transform: translateY(-1px);
}

.editor-tool-btn.active {
    background: rgba(34, 197, 94, 0.15);
    color: var(--accent-green-primary, #22c55e);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.editor-tool-divider {
    width: 1px;
    height: 20px;
    background: rgba(255, 255, 255, 0.1);
    margin: 0 4px;
}

/* Primary and Secondary Action Buttons */
.editor-btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #ffffff;
    font-family: 'Outfit', sans-serif;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.editor-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

.editor-btn-primary {
    background: linear-gradient(135deg, var(--accent-green-primary, #22c55e) 0%, #16a34a 100%);
    border: none;
    color: #080f0c;
    font-family: 'Outfit', sans-serif;
    font-size: 13px;
    font-weight: 700;
    padding: 8px 20px;
    border-radius: 20px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 14px rgba(34, 197, 94, 0.35);
}

.editor-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(34, 197, 94, 0.5);
    filter: brightness(1.06);
}

.editor-btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 🎯 Filters Sub-Toolbar */
.image-editor-subbar {
    position: relative;
    width: 100%;
    height: 52px;
    background: #111622;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 0 20px;
    z-index: 1059;
    flex-shrink: 0;
    animation: subbarSlideDown 0.2s ease-out forwards;
}

@keyframes subbarSlideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.editor-filter-chip {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.85);
    font-family: 'Outfit', sans-serif;
    font-size: 12px;
    font-weight: 500;
    padding: 5px 14px;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.editor-filter-chip:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

.editor-filter-chip.active {
    background: rgba(34, 197, 94, 0.2);
    color: var(--accent-green-primary, #22c55e);
    border-color: var(--accent-green-primary, #22c55e);
    font-weight: 600;
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.25);
}

/* 🎯 Stage Area */
.image-editor-stage {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 24px;
    background: #0a0d14;
}

.image-editor-stage-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    color: #94a3b8;
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    font-weight: 500;
}

.editor-green-spinner {
    width: 38px;
    height: 38px;
    border: 3px solid rgba(34, 197, 94, 0.15);
    border-top-color: var(--accent-green-primary, #22c55e);
    border-radius: 50%;
    animation: editorSpinnerSpin 0.75s linear infinite;
}

@keyframes editorSpinnerSpin {
    to { transform: rotate(360deg); }
}

.image-editor-preview-img {
    max-width: 92vw;
    max-height: calc(100vh - 160px);
    border-radius: 8px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.08);
    object-fit: contain;
    transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1), filter 0.2s ease;
    user-select: none;
    -webkit-user-drag: none;
}

/* 🎯 Save Options Dialog Modal */
.image-editor-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10100;
    animation: modalOverlayFade 0.2s ease-out;
}

@keyframes modalOverlayFade {
    from { opacity: 0; }
    to { opacity: 1; }
}

.image-editor-modal-card {
    background: rgba(22, 27, 34, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 18px;
    width: 90%;
    max-width: 440px;
    padding: 24px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
    font-family: 'Outfit', sans-serif;
    color: #ffffff;
    animation: modalCardScale 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes modalCardScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.image-editor-modal-card h3 {
    margin: 0 0 8px 0;
    font-size: 19px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.image-editor-modal-card p.subtitle {
    margin: 0 0 20px 0;
    font-size: 13px;
    color: var(--text-secondary, #94a3b8);
    line-height: 1.5;
}

/* Mode Selection Cards */
.editor-save-options-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.editor-save-option-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    cursor: pointer;
    transition: all 0.15s ease;
}

.editor-save-option-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.editor-save-option-card.selected {
    background: rgba(34, 197, 94, 0.1);
    border-color: var(--accent-green-primary, #22c55e);
}

.editor-save-option-card input[type="radio"] {
    margin-top: 3px;
    accent-color: var(--accent-green-primary, #22c55e);
}

.editor-save-option-text h4 {
    margin: 0 0 3px 0;
    font-size: 14px;
    font-weight: 600;
}

.editor-save-option-text p {
    margin: 0;
    font-size: 12px;
    color: var(--text-secondary, #94a3b8);
    line-height: 1.4;
}

/* Name Input Box */
.editor-name-input-group {
    margin-bottom: 20px;
    animation: inputSlideDown 0.18s ease-out;
}

@keyframes inputSlideDown {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.editor-name-input-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary, #94a3b8);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.editor-name-input {
    width: 100%;
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    color: #ffffff;
    font-family: inherit;
    font-size: 14px;
    outline: none;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

.editor-name-input:focus {
    border-color: var(--accent-green-primary, #22c55e);
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.25);
    background: rgba(0, 0, 0, 0.5);
}

/* Modal Actions */
.editor-modal-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

/* Processing Spinner Overlay */
.editor-saving-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--accent-green-primary, #22c55e);
    font-weight: 600;
}

.editor-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(34, 197, 94, 0.2);
    border-top-color: var(--accent-green-primary, #22c55e);
    border-radius: 50%;
    animation: editorSpin 0.7s linear infinite;
}

@keyframes editorSpin {
    to { transform: rotate(360deg); }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .image-editor-header {
        padding: 0 12px;
        height: 56px;
    }
    .image-editor-center {
        max-width: calc(100vw - 190px);
        padding: 3px 6px;
    }
    .editor-tool-btn {
        padding: 5px 8px;
        font-size: 12px;
    }
    .editor-tool-btn span {
        display: none;
    }
    .editor-btn-secondary,
    .editor-btn-primary {
        padding: 6px 12px;
        font-size: 12px;
    }
    .image-editor-subbar {
        top: 56px;
        height: 46px;
        overflow-x: auto;
        justify-content: flex-start;
    }
    .image-editor-stage {
        top: 56px;
        padding: 12px;
    }
}
