/**
 * Workflow Designer Styles
 */

.workflow-designer {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
}

.workflow-canvas {
    background: white;
    padding: 30px;
    border-radius: 8px;
    min-height: 400px;
    overflow-x: auto;
}

.task-flow {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

/* Flow Nodes */
.flow-node {
    background: white;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    min-width: 300px;
    max-width: 400px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.flow-node:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.start-node, .end-node {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    padding: 20px;
    min-width: 150px;
    font-weight: 600;
}

.start-node i, .end-node i {
    font-size: 2rem;
    display: block;
    margin-bottom: 8px;
}

.task-node {
    cursor: move;
    border-left: 4px solid #0d6efd;
}

.task-node.disabled {
    opacity: 0.6;
    border-left-color: #6c757d;
}

.task-node.dragging {
    opacity: 0.5;
    transform: rotate(2deg);
}

.node-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}

.node-icon {
    width: 40px;
    height: 40px;
    background: #e7f3ff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.node-icon i {
    font-size: 1.25rem;
    color: #0d6efd;
}

.node-title {
    flex: 1;
}

.task-name {
    font-weight: 600;
    font-size: 1rem;
    color: #212529;
    margin-bottom: 2px;
}

.task-type {
    font-size: 0.75rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.node-actions {
    display: flex;
    gap: 4px;
}

.node-actions .btn {
    padding: 2px 6px;
    font-size: 0.875rem;
}

.node-body {
    padding-left: 52px;
}

.config-summary {
    font-size: 0.875rem;
    color: #495057;
    margin-bottom: 8px;
    font-family: 'Courier New', monospace;
    background: #f8f9fa;
    padding: 6px 10px;
    border-radius: 4px;
}

.task-description {
    font-size: 0.875rem;
    color: #6c757d;
    margin-bottom: 8px;
    font-style: italic;
}

.task-meta {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

/* Connectors */
.flow-connector {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0;
    padding: 0;
}

.connector-line {
    width: 2px;
    height: 30px;
    background: linear-gradient(to bottom, #dee2e6, #adb5bd);
}

.connector-arrow {
    color: #adb5bd;
    font-size: 1.5rem;
    line-height: 1;
    margin-top: -8px;
}

.connector-split, .connector-merge {
    background: #fff;
    border: 2px solid #dee2e6;
    border-radius: 20px;
    padding: 8px 16px;
    margin: 10px 0;
    font-size: 0.75rem;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Parallel Tasks */
.parallel-tasks {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    margin: 20px 0;
    position: relative;
}

.parallel-tasks::before {
    content: '';
    position: absolute;
    top: -20px;
    left: 50%;
    width: 80%;
    height: 2px;
    background: #dee2e6;
    transform: translateX(-50%);
}

.parallel-tasks::after {
    content: '';
    position: absolute;
    bottom: -20px;
    left: 50%;
    width: 80%;
    height: 2px;
    background: #dee2e6;
    transform: translateX(-50%);
}

/* List View */
.workflow-canvas.list-view .task-flow {
    align-items: stretch;
}

.workflow-canvas.list-view .flow-node {
    max-width: 100%;
}

.workflow-canvas.list-view .parallel-tasks {
    flex-direction: column;
}

.workflow-canvas.list-view .parallel-tasks::before,
.workflow-canvas.list-view .parallel-tasks::after {
    display: none;
}

/* Legend */
.workflow-legend {
    padding: 12px;
    background: #e7f3ff;
    border-radius: 6px;
    border-left: 4px solid #0d6efd;
}

/* Responsive */
@media (max-width: 768px) {
    .flow-node {
        min-width: 250px;
        max-width: 100%;
    }

    .parallel-tasks {
        flex-direction: column;
    }

    .node-body {
        padding-left: 0;
        margin-top: 12px;
    }
}

/* Animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.flow-node.executing {
    border-color: #198754;
    animation: pulse 2s infinite;
}

.flow-node.failed {
    border-color: #dc3545;
    background: #fff5f5;
}

.flow-node.completed {
    border-color: #198754;
    background: #f0fff4;
}
