/* ============================================
   OPTIPIX — Editor CSS (toolbar, canvas, brush)
   ============================================ */

.editor-container {
    display: none;
    max-width: 960px;
    margin: 0 auto 60px;
    padding: 0 24px;
}

.editor-container.visible {
    display: block;
}

/* ---- Toolbar Sections ---- */
.toolbar-section {
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 10px;
    overflow: hidden;
    background: var(--bg-card);
}

.toolbar-section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: linear-gradient(135deg, rgba(99,102,241,0.06) 0%, rgba(99,102,241,0.02) 100%);
    border-bottom: 1px solid var(--border);
    user-select: none;
}

.toolbar-section-header-retouch {
    background: linear-gradient(135deg, rgba(6,182,212,0.06) 0%, rgba(6,182,212,0.02) 100%);
}

.toolbar-section-header-blur {
    background: linear-gradient(135deg, rgba(139,92,246,0.06) 0%, rgba(139,92,246,0.02) 100%);
}

.toolbar-section-icon {
    font-size: 1rem;
}

.toolbar-section-title {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.toolbar-section-body {
    padding: 10px 16px;
}

.toolbar-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.toolbar-row-secondary {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(0,0,0,0.05);
}

/* Toolbar base (kept for compatibility) */

.toolbar-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.toolbar-divider {
    width: 1px;
    height: 28px;
    background: var(--border);
}

.toolbar-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-light);
    white-space: nowrap;
}

.toolbar-value {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary);
    min-width: 36px;
    text-align: center;
}

.toolbar-slider {
    width: 80px;
    accent-color: var(--primary);
}

.toolbar-select {
    padding: 5px 8px;
    font-size: 0.78rem;
    font-family: 'Inter', sans-serif;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: white;
    cursor: pointer;
}

/* Tool buttons */
.tool-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 7px 12px;
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-light);
    background: white;
    border: 2px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.tool-btn:hover {
    border-color: var(--primary-light);
    color: var(--text);
}

.tool-btn.active {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(99, 102, 241, 0.06);
}

.tool-btn-icon {
    font-size: 0.95rem;
}

.tool-btn-sm {
    padding: 5px 10px;
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-light);
    background: white;
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.tool-btn-sm:hover {
    background: var(--bg-card);
    color: var(--text);
}

.tool-btn-sm:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Canvas wrapper */
.editor-canvas-wrapper {
    position: relative;
    border: 1px solid var(--border);
    border-top: none;
    background: repeating-conic-gradient(#e8e8e8 0% 25%, #ffffff 0% 50%) 50% / 16px 16px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    max-height: 600px;
    cursor: none;
}

.editor-canvas-wrapper.bg-white { background: #ffffff; }
.editor-canvas-wrapper.bg-black { background: #1a1a1a; }
.editor-canvas-wrapper.bg-red { background: #ff4444; }

#editorCanvas {
    max-width: 100%;
    max-height: 600px;
    display: block;
}

/* Brush cursor */
.brush-cursor {
    position: absolute;
    pointer-events: none;
    border-radius: 50%;
    border: 2px solid rgba(99, 102, 241, 0.8);
    transform: translate(-50%, -50%);
    display: none;
    z-index: 10;
}

.brush-cursor.restore {
    border-color: rgba(16, 185, 129, 0.8);
    background: rgba(16, 185, 129, 0.08);
}

.brush-cursor.erase {
    border-color: rgba(239, 68, 68, 0.8);
    background: rgba(239, 68, 68, 0.08);
}

.brush-cursor.edge-aware {
    box-shadow: 0 0 8px rgba(99, 102, 241, 0.5);
}

/* Hint */
.editor-hint {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-light);
    padding: 10px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
    line-height: 1.5;
}

/* Action buttons */
.editor-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.editor-actions .btn-download { flex: 1; }
.editor-actions .btn-reset { white-space: nowrap; }

/* Responsive */
@media (max-width: 768px) {
    .toolbar-section-body { padding: 8px 10px; }
    .toolbar-row { gap: 6px; }
    .toolbar-divider { display: none; }
    .toolbar-slider { width: 60px; }
    .editor-canvas-wrapper { min-height: 200px; }
    .tool-btn { padding: 6px 8px; font-size: 0.75rem; }
    .tool-btn-sm { padding: 4px 8px; font-size: 0.7rem; }
    .retouche-slider { width: 50px; }
    .toolbar-section-header { padding: 6px 12px; }
}

/* ============================================
   RETOUCHE TOOLBAR
   ============================================ */

.retouche-slider {
    width: 70px;
    accent-color: var(--secondary);
}

.toolbar-section .tool-btn-sm.active {
    background: rgba(6, 182, 212, 0.1);
    color: var(--secondary);
    border-color: var(--secondary);
}

/* ============================================
   BLUR TOOLBAR
   ============================================ */

.blur-slider {
    width: 70px;
    accent-color: #8b5cf6;
}

.toolbar-section .blur-toolbar-active {
    border-color: #8b5cf6;
    color: #8b5cf6;
    background: rgba(139, 92, 246, 0.06);
}

.brush-cursor.blur-cursor {
    border-color: rgba(139, 92, 246, 0.8);
    background: rgba(139, 92, 246, 0.1);
}
