/* Estilos para Drag & Drop de Etapas */

/* Elemento mientras se arrastra */
[data-stage-id].dragging {
    opacity: 0.5;
    cursor: move;
    background-color: #f0f0f0;
    border: 2px dashed #999;
}

/* Zona válida para soltar (hover) */
[data-stage-id].drag-over {
    background-color: #e3f2fd;
    border: 2px solid #2196F3;
    transform: scale(1.02);
    transition: all 0.2s ease;
}

/* Cursor durante el arrastre */
[data-stage-id][draggable="true"] {
    cursor: move;
    transition: all 0.2s ease;
}

[data-stage-id][draggable="true"]:hover {
    background-color: #f5f5f5;
}

/* Icono de arrastre */
.drag-handle {
    cursor: move;
    padding: 4px;
    color: #666;
    display: inline-flex;
    align-items: center;
}

.drag-handle:hover {
    color: #333;
}

/* Animación al soltar */
@keyframes dropAnimation {
    0% {
        transform: scale(1.05);
        background-color: #c8e6c9;
    }
    100% {
        transform: scale(1);
        background-color: transparent;
    }
}

[data-stage-id].just-dropped {
    animation: dropAnimation 0.3s ease;
}

/* Contenedor de etapas con jerarquía */
.stage-item {
    padding: 12px;
    margin: 8px 0;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: white;
    position: relative;
}

.stage-item.level-1 {
    margin-left: 20px;
}

.stage-item.level-2 {
    margin-left: 40px;
}

.stage-item.level-3 {
    margin-left: 60px;
}

/* Botones de acción */
.stage-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.btn-export-structure,
.btn-save-default {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.btn-export-structure {
    background-color: #4CAF50;
    color: white;
}

.btn-export-structure:hover {
    background-color: #45a049;
}

.btn-save-default {
    background-color: #2196F3;
    color: white;
}

.btn-save-default:hover {
    background-color: #0b7dda;
}

/* Indicador visual de etapa padre */
.stage-parent-indicator {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background-color: #2196F3;
    border-radius: 4px 0 0 4px;
}

/* Estilos para la vista de árbol */
.stage-tree {
    list-style: none;
    padding: 0;
    margin: 0;
}

.stage-tree .stage-tree {
    margin-left: 24px;
    padding-left: 12px;
    border-left: 2px solid #e0e0e0;
}

.stage-tree-item {
    margin: 4px 0;
}

/* Responsive */
@media (max-width: 768px) {
    .stage-item.level-1 { margin-left: 12px; }
    .stage-item.level-2 { margin-left: 24px; }
    .stage-item.level-3 { margin-left: 36px; }
}
