/* Art Creator Styles - Clean Light Theme v2 */

#ea-step-creator {
    background: #f1f5f9;
    padding: 0;
    height: 85vh;
    min-height: 700px;
    display: none;
    flex-direction: column;
    font-family: 'Inter', sans-serif;
    color: #334155;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    border: 1px solid #e2e8f0;
}

#ea-step-creator.active {
    display: flex;
}

.ea-creator-container {
    display: flex;
    flex: 1;
    overflow: hidden;
    height: 100%;
    position: relative;
}

/* === LEFT SIDEBAR (TOOLS) === */
.ea-creator-sidebar {
    width: 360px;
    background: #ffffff;
    border-right: 1px solid #e2e8f0;
    display: flex;
    z-index: 20;
    box-shadow: 4px 0 15px rgba(0, 0, 0, 0.03);
}

.ea-tool-tabs {
    width: 70px;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 20px;
    border-right: 1px solid #e2e8f0;
    gap: 15px;
}

.ea-tool-tab {
    width: 50px;
    height: 50px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: #64748b;
    cursor: pointer;
    font-size: 10px;
    transition: all 0.2s;
    padding: 5px;
}

.ea-tool-tab i,
.ea-tool-tab span.icon {
    font-size: 20px;
    margin-bottom: 4px;
    display: block;
}

.ea-tool-tab:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.ea-tool-tab.active {
    background: #eff6ff;
    color: #3b82f6;
    box-shadow: 0 4px 10px rgba(59, 130, 246, 0.1);
}

.ea-tool-panels {
    flex: 1;
    padding: 25px;
    overflow-y: auto;
    background: #ffffff;
}

.ea-tool-panel {
    display: none;
    animation: slideIn 0.3s ease;
}

.ea-tool-panel.active {
    display: block;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.ea-tool-panel h4 {
    margin: 0 0 20px 0;
    font-size: 18px;
    color: #0f172a;
    font-weight: 700;
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 10px;
}

/* Form Controls */
.ea-form-group {
    margin-bottom: 20px;
}

.ea-form-group label {
    color: #64748b;
    font-size: 13px;
    margin-bottom: 8px;
    display: block;
    font-weight: 500;
}

.ea-form-group select,
.ea-form-group input[type="text"] {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    color: #334155;
    padding: 10px;
    border-radius: 6px;
    width: 100%;
    font-size: 14px;
}

/* Custom Color Picker */
.ea-color-picker-wrapper {
    position: relative;
    width: 100%;
    height: 45px;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    display: flex;
    align-items: center;
    padding: 0 15px;
    cursor: pointer;
    transition: all 0.2s;
}

.ea-color-picker-wrapper:hover {
    border-color: #3b82f6;
}

.ea-color-picker-wrapper input[type="color"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.ea-color-preview {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    border: 1px solid #cbd5e1;
    margin-left: auto;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.ea-color-picker-wrapper.compact {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
}

.ea-orientation-toggle {
    background: #f1f5f9;
    padding: 4px;
    border-radius: 6px;
    display: flex;
    border: 1px solid #e2e8f0;
}

.ea-orientation-toggle button {
    flex: 1;
    background: transparent;
    border: none;
    color: #64748b;
    padding: 8px;
    cursor: pointer;
    border-radius: 4px;
    font-weight: 500;
}

.ea-orientation-toggle button.active {
    background: #ffffff;
    color: #3b82f6;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.ea-assets-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.ea-asset-item {
    aspect-ratio: 16/9;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid #e2e8f0;
    background: #f8fafc;
    transition: all 0.2s;
}

.ea-asset-item:hover {
    border-color: #3b82f6;
    transform: scale(1.02);
}

.ea-asset-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ea-shapes-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.ea-shape-btn {
    aspect-ratio: 1;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #64748b;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    gap: 5px;
    font-size: 11px;
    transition: all 0.2s;
}

.ea-shape-btn:hover {
    background: #eff6ff;
    border-color: #3b82f6;
    color: #3b82f6;
}

.ea-add-text-btn {
    width: 100%;
    padding: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #334155;
    border-radius: 6px;
    margin-bottom: 12px;
    cursor: pointer;
    text-align: left;
    transition: 0.2s;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ea-add-text-btn:hover {
    background: #eff6ff;
    border-color: #3b82f6;
    color: #3b82f6;
    padding-left: 15px;
}

.ea-upload-area {
    margin-bottom: 20px;
}

.ea-upload-area input {
    display: none;
}

.ea-upload-label {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 20px;
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    background: #f8fafc;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 600;
}

.ea-upload-label:hover {
    border-color: #3b82f6;
    background: #eff6ff;
    color: #3b82f6;
}

/* === CANVAS AREA (CENTER) === */
#ea-step-creator .ea-creator-canvas-area {
    flex: 1;
    position: relative;
    display: flex;
    flex-direction: column;
    background: #f1f5f9;
    background-image: radial-gradient(#cbd5e1 1px, transparent 1px);
    background-size: 20px 20px;
    overflow: hidden;
}

#ea-step-creator .ea-canvas-toolbar {
    height: 60px;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 15;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
}

#ea-step-creator .ea-canvas-controls,
#ea-step-creator .ea-selection-controls {
    display: flex;
    gap: 5px;
    align-items: center;
}

#ea-step-creator .ea-canvas-controls button,
#ea-step-creator .ea-selection-controls button {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    color: #334155 !important;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    cursor: pointer;
    margin-right: 2px;
    font-size: 16px;
    transition: 0.2s;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
    box-shadow: none !important;
}

/* FORÇAR COR DO ÍCONE - ALVO ESPECÍFICO */
#ea-step-creator .ea-canvas-controls button span.dashicons,
#ea-step-creator .ea-canvas-controls button span.dashicons:before,
#ea-step-creator .ea-selection-controls button span.dashicons,
#ea-step-creator .ea-selection-controls button span.dashicons:before {
    color: #334155 !important;
    opacity: 1 !important;
    font-family: 'dashicons' !important;
    /* Garantir fonte */
    display: inline-block;
    vertical-align: middle;
}

#ea-step-creator .ea-canvas-controls button:hover,
#ea-step-creator .ea-selection-controls button:hover {
    background: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
}

#ea-step-creator .ea-selection-controls button#ea-obj-delete {
    color: #ef4444 !important;
    border-color: #fee2e2 !important;
}

#ea-step-creator .ea-selection-controls button#ea-obj-delete:hover {
    background: #fee2e2 !important;
}

#ea-step-creator .ea-selection-controls button.active,
#ea-step-creator button#ea-text-bold.active,
#ea-step-creator button#ea-text-italic.active {
    background: #eff6ff !important;
    color: #3b82f6 !important;
    border-color: #3b82f6 !important;
}

#ea-step-creator .ea-selection-controls select {
    height: 36px;
    padding: 0 5px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    color: #334155;
    background: #f8fafc;
}

/* Parent Container explicit sizing */
#ea-step-creator .ea-creator-canvas-area {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 !important;
    height: 100% !important;
    overflow: hidden !important;
}

#ea-step-creator .ea-canvas-wrapper-outer {
    flex: 1;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: auto !important;
    width: 100% !important;
    height: 100% !important;
    padding: 30px;
    background-color: #f1f5f9;
}

/* Isolando canvas container APENAS para o editor */
#ea-step-creator .canvas-container {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1) !important;
    border: 1px solid rgba(0, 0, 0, 0.05) !important;
    background: white;
    margin: auto;
}

/* Footer do Editor */
#ea-step-creator .ea-creator-footer {
    height: 70px;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    z-index: 20;
}

.ea-btn-secondary {
    background: white;
    color: #64748b;
    border: 1px solid #cbd5e1;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.ea-btn-secondary:hover {
    border-color: #64748b;
    color: #0f172a;
}

.ea-submit-btn {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(34, 197, 94, 0.2);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.ea-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(34, 197, 94, 0.3);
}

/* Layers Panel Styles */
#ea-step-creator .ea-layers-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#ea-step-creator .ea-layer-item {
    display: flex;
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

#ea-step-creator .ea-layer-item:hover {
    border-color: #cbd5e1;
    background: #f1f5f9;
}

#ea-step-creator .ea-layer-item.active {
    border-color: #3b82f6;
    background: #eff6ff;
}

#ea-step-creator .ea-layer-thumb {
    width: 30px;
    height: 30px;
    border-radius: 4px;
    background: #fff;
    border: 1px solid #e2e8f0;
    margin-right: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    font-size: 16px;
    color: #64748b;
}

#ea-step-creator .ea-layer-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

#ea-step-creator .ea-layer-name {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 15px;
}

/* Toolbar Principal (Topo) */
#ea-step-creator .ea-canvas-toolbar {
    display: flex;
    align-items: center;
    padding: 8px 15px;
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    height: 50px;
    gap: 8px;
}

/* Context Bar (Propriedades da Seleção - Abaixo do Topo) */
#ea-step-creator .ea-context-bar {
    display: none;
    /* JS controla (flex) */
    align-items: center;
    flex-wrap: wrap;
    padding: 8px 15px;
    gap: 6px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    min-height: 45px;
    animation: slideInBar 0.2s ease;
}

@keyframes slideInBar {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#ea-step-creator .ea-canvas-controls {
    display: flex;
    gap: 4px;
    align-items: center;
}

/* Remover estilos antigos de selection-controls se houver */
#ea-step-creator .ea-selection-controls {
    border-left: none;
    padding-left: 0;
    margin-left: 0;
}

#ea-step-creator .ea-layer-actions {
    display: flex;
    gap: 2px;
}

#ea-step-creator .ea-layer-btn {
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#ea-step-creator .ea-layer-btn:hover {
    background: #e2e8f0;
    color: #334155;
}

#ea-step-creator .ea-layer-btn.delete:hover {
    background: #fee2e2;
    color: #ef4444;
}

/* Context Bar Layout Fixes */
#ea-step-creator .ea-context-bar {
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    white-space: nowrap !important;
    height: 60px !important;
    /* Fix height */
}

#ea-step-creator .ea-context-bar .ea-color-picker-wrapper {
    width: 36px !important;
    display: inline-flex !important;
    margin: 0 10px 0 0 !important;
    flex-shrink: 0;
}

#ea-step-creator .ea-context-bar .ea-control-group {
    display: inline-flex !important;
    align-items: center;
    margin: 0 10px 0 0 !important;
    flex-shrink: 0;
}

#ea-step-creator .ea-context-bar button,
#ea-step-creator .ea-context-bar select {
    flex-shrink: 0;
}

/* Hide scrollbar for cleaner look */
#ea-step-creator .ea-context-bar::-webkit-scrollbar {
    height: 4px;
}

#ea-step-creator .ea-context-bar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}


#ea-img-magic-wand.active {
    background: #8b5cf6 !important;
    color: white !important;
    border-color: #8b5cf6 !important;
}


#ea-img-eraser.active {
    background: #ef4444 !important;
    color: white !important;
    border-color: #ef4444 !important;
}

/* Context Toolbar Fixes */
#ea-img-tools,
.text-tool,
#ea-shape-tools,
#ea-shape-radius-wrapper {
    display: none;
}