/* Workflow module styling */

/* Modal Styles */
.workflow-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.workflow-modal.visible {
    opacity: 1;
    visibility: visible;
}

.workflow-modal-content {
    background: rgba(40, 40, 40, 0.95);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(20px);
    width: 500px;
    max-width: 90%;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.workflow-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.workflow-modal-header h3 {
    color: #ffffff;
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.workflow-modal-close {
    background: none;
    border: none;
    color: #999;
    font-size: 24px;
    cursor: pointer;
    transition: color 0.2s;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.workflow-modal-close:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.workflow-modal-body {
    padding: 20px;
}

.workflow-function-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.workflow-function-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.workflow-function-card:hover {
    background: rgba(64, 158, 255, 0.2);
    border-color: rgba(64, 158, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(64, 158, 255, 0.2);
}

.workflow-function-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.workflow-function-title {
    color: #ffffff;
    font-size: 16px;
    font-weight: 500;
    margin: 0;
}

.workflow-function-desc {
    color: #999;
    font-size: 12px;
    margin: 0;
}

/* Node Styles */
.workflow-node {
    position: absolute;
    background: rgba(40, 40, 40, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(20px);
    min-width: 280px;
    max-width: 400px;
    z-index: 100;
    cursor: move;
    /* transition: all 0.2s ease; - Removed to prevent drag lag */
    overflow: visible;
    pointer-events: auto;
    /* Essential: Override canvas container's pointer-events: none */
    user-select: none;
    -webkit-user-select: none;
}

.workflow-node input,
.workflow-node textarea {
    user-select: text;
    -webkit-user-select: text;
}

.workflow-node:hover {
    border-color: rgba(64, 158, 255, 0.5);
    box-shadow: 0 6px 20px rgba(64, 158, 255, 0.2);
}

.workflow-node.dragging {
    opacity: 0.8;
    cursor: grabbing;
    box-shadow: 0 8px 24px rgba(64, 158, 255, 0.3);
}

/* Node Header */
.workflow-node-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: rgba(64, 158, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    cursor: move;
    user-select: none;
}

.workflow-node-title {
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    margin: 0;
}

.workflow-node-delete {
    background: none;
    border: none;
    color: #999;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    flex-shrink: 0;
}

.workflow-node-delete:hover {
    color: #ff4d4f;
    background: rgba(255, 77, 79, 0.2);
}

/* Node Body */
.workflow-node-body {
    padding: 16px;
}

.workflow-node-content {
    margin-bottom: 16px;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Text Node */
.workflow-text-preview {
    color: #ffffff;
    font-size: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    padding: 8px 12px;
    border-radius: 4px;
}

.workflow-text-preview:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Image Node */
.workflow-image-preview {
    width: 100%;
    min-height: 150px;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.workflow-image-placeholder {
    color: #999;
    font-size: 14px;
    text-align: center;
}

.workflow-image-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Video Node */
.workflow-video-preview {
    width: 100%;
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.workflow-video-placeholder {
    color: #999;
    font-size: 14px;
    text-align: center;
}

.workflow-video-preview video {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Music Node */
.workflow-music-preview {
    width: 100%;
    height: 150px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.workflow-music-placeholder {
    color: #999;
    font-size: 14px;
    text-align: center;
}

.workflow-music-player {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.workflow-music-info {
    color: #ffffff;
    font-size: 12px;
    text-align: center;
    margin-top: 8px;
}

/* Camera Node */
.workflow-camera-preview {
    width: 100%;
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.workflow-camera-placeholder {
    color: #999;
    font-size: 14px;
    text-align: center;
}

.workflow-camera-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Output Node */
.workflow-output-preview {
    width: 100%;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    padding: 12px;
}

.workflow-output-placeholder {
    color: #999;
    font-size: 14px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.workflow-output-placeholder .icon {
    font-size: 24px;
}

.workflow-output-success {
    color: #67c23a;
    font-size: 14px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.workflow-output-error {
    color: #ff4d4f;
    font-size: 14px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.workflow-output-running {
    color: #409eff;
    font-size: 14px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.workflow-output-running .loading-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(64, 158, 255, 0.3);
    border-radius: 50%;
    border-top-color: #409eff;
    animation: spin 1s linear infinite;
}

/* Node Controls */
.workflow-node-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.workflow-control-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.workflow-control-group label {
    color: #cccccc;
    font-size: 12px;
    font-weight: 500;
    margin: 0;
}

.workflow-control-group input,
.workflow-control-group select,
.workflow-control-group textarea {
    background: rgba(30, 30, 30, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #ffffff;
    padding: 8px 12px;
    font-size: 13px;
    outline: none;
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    color-scheme: dark;
    -webkit-tap-highlight-color: transparent;
}

.workflow-control-group select {
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    padding-right: 32px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='rgba(255,255,255,0.6)' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: calc(100% - 10px) center;
}

.workflow-control-group select option {
    background-color: #252525;
    color: #ffffff;
    padding: 10px;
}

.workflow-control-group input:focus,
.workflow-control-group select:focus,
.workflow-control-group textarea:focus {
    border-color: rgba(64, 158, 255, 0.6);
    box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.1);
    background: rgba(45, 45, 45, 0.95);
}

.workflow-control-group textarea {
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
}

.workflow-control-group input[type="number"] {
    width: 80px;
}

.workflow-control-group input[type="color"] {
    width: 100%;
    height: 36px;
    padding: 2px;
    cursor: pointer;
}

/* Range Slider for Camera Node */
.workflow-control-group input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    outline: none;
    padding: 0;
    margin: 8px 0;
}

.workflow-control-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: #ffffff;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    transition: transform 0.1s;
}

.workflow-control-group input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.workflow-control-group input[type="range"]::-webkit-slider-thumb:active {
    transform: scale(0.95);
    background: #409eff;
}

/* Control Value Display */
.workflow-control-value {
    color: #ffffff;
    font-size: 12px;
    font-weight: 600;
    text-align: right;
    margin-top: -4px;
    font-variant-numeric: tabular-nums;
}

/* Toggle Button for Camera Node */
.workflow-toggle-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    color: #ffffff;
    padding: 8px 16px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
}

.workflow-toggle-btn:hover {
    background: rgba(64, 158, 255, 0.2);
    border-color: rgba(64, 158, 255, 0.5);
}

.workflow-toggle-btn.active {
    background: rgba(64, 158, 255, 0.3);
    border-color: rgba(64, 158, 255, 0.8);
    box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.2);
}

/* Style Buttons */
.workflow-style-buttons {
    display: flex;
    gap: 8px;
}

.workflow-style-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    color: #ffffff;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
}

.workflow-style-btn:hover {
    background: rgba(64, 158, 255, 0.2);
    border-color: rgba(64, 158, 255, 0.5);
}

.workflow-style-btn.active {
    background: rgba(64, 158, 255, 0.3);
    border-color: rgba(64, 158, 255, 0.8);
    box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.2);
}

/* Generate Button */
.workflow-generate-btn {
    background: linear-gradient(135deg, #67c23a 0%, #85ce61 100%);
    border: none;
    border-radius: 4px;
    color: #ffffff;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    margin-top: 4px;
}

.workflow-generate-btn:hover {
    background: linear-gradient(135deg, #85ce61 0%, #95d475 100%);
    box-shadow: 0 4px 12px rgba(103, 194, 58, 0.3);
}

.workflow-generate-btn:active {
    transform: translateY(1px);
}

.workflow-generate-btn:disabled {
    background: #505050;
    cursor: not-allowed;
    box-shadow: none;
    opacity: 0.6;
}

/* Node Ports */
.workflow-node-ports {
    position: absolute;
    top: 50%;
    left: -8px;
    right: -8px;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    pointer-events: none;
}

.workflow-node-port {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: rgba(64, 158, 255, 0.8);
    border: 2px solid rgba(255, 255, 255, 0.8);
    cursor: pointer;
    pointer-events: auto;
    transition: all 0.2s ease;
    box-shadow: 0 0 0 0 transparent;
}

.workflow-node-port:hover {
    transform: scale(1.2);
    box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.4);
}

.workflow-node-port:active {
    transform: scale(1.3);
    box-shadow: 0 0 0 3px rgba(64, 158, 255, 0.6);
}

.workflow-input-port {
    left: -8px;
}

.workflow-output-port {
    right: -8px;
}

/* Connection Line Styles */
.workflow-connection-line {
    position: absolute;
    pointer-events: none;
    z-index: 99;
    stroke: rgba(64, 158, 255, 0.8);
    stroke-width: 2px;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Node Type Specific Styles */
.workflow-text-node {
    background: rgba(64, 158, 255, 0.05);
}

.workflow-image-node {
    background: rgba(103, 194, 58, 0.05);
}

.workflow-video-node {
    background: rgba(230, 162, 60, 0.05);
}

.workflow-music-node {
    background: rgba(165, 81, 197, 0.05);
}

.workflow-camera-node {
    background: rgba(64, 158, 255, 0.05);
}

.workflow-output-node {
    background: rgba(236, 65, 65, 0.05);
}

.workflow-canvas-image-node {
    background: rgba(255, 193, 7, 0.05);
}

.workflow-canvas-image-node .workflow-node-header {
    background: rgba(255, 193, 7, 0.15);
}

.workflow-canvas-image-node .workflow-node-ports {
    justify-content: flex-end;
}

/* Node Type Specific Headers */
.workflow-text-node .workflow-camera-node {
    background: rgba(40, 40, 40, 0.95);
    resize: horizontal;
    overflow: hidden;
    min-width: 320px !important;
    max-width: 600px !important;
}

.workflow-camera-node .workflow-node-content {
    background: rgba(103, 194, 58, 0.15);
}

.workflow-text-node .workflow-node-header {
    background: rgba(64, 158, 255, 0.15);
}

.workflow-image-node .workflow-node-header {
    background: rgba(103, 194, 58, 0.15);
}

.workflow-video-node .workflow-node-header {
    background: rgba(230, 162, 60, 0.15);
}

.workflow-music-node .workflow-node-header {
    background: rgba(165, 81, 197, 0.15);
}

.workflow-camera-node .workflow-node-header {
    background: rgba(64, 158, 255, 0.15);
}

.workflow-output-node .workflow-node-header {
    background: rgba(236, 65, 65, 0.15);
}

.workflow-large-text-node {
    min-width: 400px;
    max-width: 600px;
}

.workflow-large-text-node .workflow-node-body {
    padding: 20px;
}

.workflow-large-text-input {
    width: 100%;
    min-height: 150px;
    padding: 16px;
    font-size: 16px;
    line-height: 1.6;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    resize: vertical;
    font-family: inherit;
}

.workflow-large-text-input:focus {
    outline: none;
    border-color: rgba(64, 158, 255, 0.5);
    background: rgba(64, 158, 255, 0.05);
}

.workflow-large-text-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.workflow-image-node .workflow-node-header {
    background: rgba(103, 194, 58, 0.15);
}

.workflow-video-node .workflow-node-header {
    background: rgba(230, 162, 60, 0.15);
}

.workflow-music-node .workflow-node-header {
    background: rgba(165, 81, 197, 0.15);
}

/* Responsive Design */
@media (max-width: 768px) {
    .workflow-modal-content {
        width: 95%;
    }

    .workflow-function-grid {
        grid-template-columns: 1fr;
    }

    .workflow-node {
        min-width: 240px;
        max-width: 90vw;
    }
}

@media (max-width: 480px) {
    .workflow-node {
        min-width: 200px;
    }

    .workflow-node-body {
        padding: 12px;
    }

    .workflow-control-group {
        gap: 4px;
    }

    .workflow-control-group input,
    .workflow-control-group select,
    .workflow-control-group textarea {
        padding: 6px 10px;
        font-size: 13px;
    }
}

/* Loading State */
.workflow-loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #ffffff;
    animation: spin 1s ease-in-out infinite;
}

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

/* Error State */
.workflow-error {
    color: #ff4d4f;
    font-size: 12px;
    margin-top: 4px;
}

/* Success State */
.workflow-success {
    color: #67c23a;
    font-size: 12px;
    margin-top: 4px;
}

/* Export/Import Buttons */
.workflow-export-btn,
.workflow-import-btn {
    background: rgba(64, 158, 255, 0.2);
    border: 1px solid rgba(64, 158, 255, 0.5);
    border-radius: 4px;
    color: #ffffff;
    padding: 8px 16px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-right: 8px;
}

.workflow-export-btn:hover,
.workflow-import-btn:hover {
    background: rgba(64, 158, 255, 0.3);
    box-shadow: 0 4px 12px rgba(64, 158, 255, 0.2);
}

.workflow-import-btn input[type="file"] {
    display: none;
}

/* Connection Handle Styles */
.workflow-connection-handle {
    position: absolute;
    width: 8px;
    height: 8px;
    background: rgba(64, 158, 255, 0.8);
    border: 2px solid #ffffff;
    border-radius: 50%;
    cursor: pointer;
    z-index: 101;
    transition: all 0.2s ease;
}

.workflow-connection-handle:hover {
    transform: scale(1.5);
    box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.4);
}

/* Connection Line Drawing */
.workflow-drawing-line {
    position: absolute;
    pointer-events: none;
    z-index: 1000;
    stroke: rgba(64, 158, 255, 0.8);
    stroke-width: 2px;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 5, 5;
    animation: dash 0.5s linear infinite;
}

@keyframes dash {
    to {
        stroke-dashoffset: -10;
    }
}

/* Node Context Menu */
.workflow-context-menu {
    position: absolute;
    background: rgba(40, 40, 40, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(20px);
    z-index: 10000;
    min-width: 180px;
    overflow: hidden;
}

.workflow-context-menu-item {
    padding: 10px 16px;
    color: #ffffff;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.workflow-context-menu-item:hover {
    background: rgba(64, 158, 255, 0.2);
}

.workflow-context-menu-item:active {
    background: rgba(64, 158, 255, 0.3);
}

/* Node Selection */
.workflow-node.selected {
    border-color: rgba(64, 158, 255, 0.8);
    box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.4);
}

/* Grid Background for Canvas */
.canvas {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: visible;
    background:
        linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 20px 20px;
    background-position: center center;
}

/* Scrollbar Styles */
.workflow-node-controls::-webkit-scrollbar {
    width: 6px;
}

.workflow-node-controls::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.workflow-node-controls::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.workflow-node-controls::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Accessibility */
.workflow-node:focus-within {
    outline: 2px solid rgba(64, 158, 255, 0.8);
    outline-offset: 2px;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    /* All styles are already dark mode */
}

/* Print Styles */
@media print {

    .workflow-modal,
    .workflow-node {
        display: none;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .workflow-node {
        border: 2px solid white;
    }

    .workflow-node-header {
        border-bottom: 2px solid white;
    }

    .workflow-node-port {
        border: 3px solid white;
    }
}

/* Workflow Context Menu */
.workflow-menu {
    position: absolute;
    width: 280px;
    background: rgba(30, 30, 30, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 12px;
    display: none;
    /* Hidden by default */
    flex-direction: column;
    z-index: 10000;
    /* Extremely high to sit on top of everything */
    overflow: hidden;
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.2s ease, transform 0.2s ease;
    padding: 8px;
}

.workflow-menu.visible {
    display: flex;
    opacity: 1;
    transform: scale(1);
}

.workflow-menu-header {
    padding: 8px 12px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    margin-bottom: 4px;
}

.workflow-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: none;
    background: transparent;
    color: #fff;
    cursor: pointer;
    text-align: left;
    border-radius: 8px;
    transition: all 0.2s ease;
    width: 100%;
}

.workflow-menu-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(4px);
}

.workflow-menu-item-icon {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #409eff;
    flex-shrink: 0;
}

.workflow-menu-item:hover .workflow-menu-item-icon {
    background: #409eff;
    color: #fff;
}

.workflow-menu-item-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.workflow-menu-item-title {
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

.workflow-menu-item-desc {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
}

.workflow-tag {
    font-size: 10px;
    background: #e6a23c;
    color: #fff;
    padding: 1px 4px;
    border-radius: 3px;
    font-weight: bold;
}

/* Output Node Actions */
.workflow-output-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.workflow-download-btn,
.workflow-canvas-btn {
    flex: 1;
    background: rgba(64, 158, 255, 0.2);
    border: 1px solid rgba(64, 158, 255, 0.5);
    border-radius: 4px;
    color: #ffffff;
    padding: 8px 12px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.workflow-download-btn:hover,
.workflow-canvas-btn:hover {
    background: rgba(64, 158, 255, 0.3);
    box-shadow: 0 2px 8px rgba(64, 158, 255, 0.2);
}

.workflow-download-btn:active,
.workflow-canvas-btn:active {
    transform: translateY(1px);
}

/* Output Results Display */
.workflow-output-results {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.workflow-output-result-item {
    width: 100%;
    border-radius: 4px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.workflow-output-result-item img {
    width: 100%;
    height: auto;
    max-height: 200px;
    object-fit: contain;
    display: block;
}

.workflow-output-result-item video {
    width: 100%;
    height: auto;
    max-height: 200px;
    object-fit: contain;
    display: block;
}

.workflow-output-result-item audio {
    width: 100%;
    display: block;
}

/* --- Integrated Camera System Port --- */
.workflow-camera-node {
    background: #050505 !important;
    border: 1px solid rgba(0, 243, 255, 0.2) !important;
    width: 420px !important;
    padding: 0 !important;
    border-radius: 20px !important;
    overflow: hidden !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8) !important;
}

.workflow-camera-node .workflow-node-header {
    background: rgba(20, 20, 25, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding: 12px 20px;
}

.workflow-camera-node .workflow-node-title {
    color: #888;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.workflow-camera-node .workflow-node-body {
    padding: 0 !important;
    display: flex;
    flex-direction: column;
}

/* 3D Monitor Area */
.workflow-camera-monitor {
    position: relative;
    width: 100%;
    height: 220px;
    background: #000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.workflow-camera-canvas-container {
    width: 100%;
    height: 100%;
}

.workflow-camera-dof-mask {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
    -webkit-mask-image: radial-gradient(circle, transparent 20%, black 80%);
    mask-image: radial-gradient(circle, transparent 20%, black 80%);
    backdrop-filter: blur(0px);

    transition: backdrop-filter 0.4s ease;
}

/* HUD Overlay inside Node */
.workflow-camera-hud-overlay {
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 10;
    background: rgba(20, 20, 25, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 10px 15px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: #fff;
    pointer-events: none;
}

.workflow-camera-hud-overlay span {
    color: #00f3ff;
}

/* Controls Area */
.workflow-camera-controls-area {
    padding: 24px;
    background: rgba(20, 20, 25, 0.4);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.workflow-camera-main-panel {
    display: flex;
    gap: 20px;
    align-items: center;
}

/* 3D Cube Interaction */
.workflow-camera-cube-box {
    width: 120px;
    height: 120px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    perspective: 600px;
    cursor: grab;
}

.workflow-camera-cube-box:active {
    cursor: grabbing;
}

.workflow-camera-visual-cube {
    width: 50px;
    height: 50px;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.1s linear;
}

.workflow-camera-face {
    position: absolute;
    width: 50px;
    height: 50px;
    background: rgba(64, 64, 64, 0.8);
    border: 1px solid #00f3ff;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #00f3ff;
    font-size: 8px;
    font-weight: 800;
}

.face-front {
    transform: translateZ(25px);
    background: rgba(0, 243, 255, 0.1);
}

.face-back {
    transform: rotateY(180deg) translateZ(25px);
}

.face-right {
    transform: rotateY(90deg) translateZ(25px);
}

.face-left {
    transform: rotateY(-90deg) translateZ(25px);
}

.face-top {
    transform: rotateX(90deg) translateZ(25px);
}

.face-bottom {
    transform: rotateX(-90deg) translateZ(25px);
}

/* Sliders */
.workflow-camera-sliders-grid {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.workflow-camera-slider-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.row-label {
    width: 30px;
    font-size: 9px;
    color: #666;
    font-weight: 800;
}

.row-val {
    width: 40px;
    font-size: 10px;
    font-weight: bold;
    text-align: right;
    color: #00f3ff;
}

.workflow-camera-range {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.05);
    height: 2px;
    border-radius: 1px;
}

.workflow-camera-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px #00f3ff;
    border: 2px solid #00f3ff;
}

/* Presets */
.workflow-camera-presets-section {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 15px;
}

.preset-header {
    font-size: 9px;
    color: #555;
    margin-bottom: 10px;
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: 1px;
}

.preset-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.camera-preset-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: #888;
    padding: 8px 2px;
    border-radius: 8px;
    font-size: 9px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.camera-preset-btn:hover {
    background: rgba(0, 243, 255, 0.1);
    color: #00f3ff;
    border-color: #00f3ff;
}

.camera-preset-btn.active {
    background: #00f3ff;
    color: #000;
    border-color: #00f3ff;
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.3);
}

/* Footer Actions */
.workflow-camera-footer {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 12px;
    margin-top: 10px;
}

.camera-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.camera-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #00f3ff;
}

.camera-btn-primary {
    background: #00f3ff;
    color: #000;
    border: none;
}

.camera-btn-primary:hover {
    background: #fff;
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 243, 255, 0.4);
}

.camera-btn svg {
    width: 14px;
    height: 14px;
}

/* Generation Overlay */
.camera-node-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.camera-node-loader {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(0, 243, 255, 0.1);
    border-top: 3px solid #00f3ff;
    border-radius: 50%;
    animation: camera-spin 1s linear infinite;
}

@keyframes camera-spin {
    to {
        transform: rotate(360deg);
    }
}

.camera-node-loading-text {
    margin-top: 15px;
    color: #00f3ff;
    font-weight: bold;
    font-size: 12px;
    letter-spacing: 1px;
}

/* SaaS Studio Compatibility Styles */
.workflow-dynamic-container {
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
}

.studio-input {
    background: #070a0f !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 8px !important;
    padding: 8px 12px !important;
    color: white !important;
    font-size: 0.85rem !important;
    width: 100% !important;
    transition: 0.2s !important;
    display: block !important;
    margin-bottom: 8px !important;
}

.studio-input:focus {
    outline: none !important;
    border-color: #6366f1 !important;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1) !important;
}

.workflow-dynamic-container textarea.studio-input {
    min-height: 100px;
    resize: vertical;
}

.workflow-dynamic-container label {
    display: block !important;
    margin-bottom: 4px !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    color: #9ca3af !important;
}

/* Base Tailwind mappings for SaaS Studio Content */
.space-y-4>*+* {
    margin-top: 1rem !important;
}

.space-y-2>*+* {
    margin-top: 0.5rem !important;
}

.space-y-1>*+* {
    margin-top: 0.25rem !important;
}

.grid {
    display: grid !important;
}

.grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

.gap-4 {
    gap: 1rem !important;
}

.gap-2 {
    gap: 0.5rem !important;
}

.w-full {
    width: 100% !important;
}

.rounded-xl {
    border-radius: 0.75rem !important;
}

.aspect-video {
    aspect-ratio: 16 / 9 !important;
}

.bg-indigo-600 {
    background-color: #4f46e5 !important;
}

.bg-blue-600 {
    background-color: #2563eb !important;
}

.text-xs {
    font-size: 0.75rem !important;
}

.font-bold {
    font-weight: 700 !important;
}

.p-6 {
    padding: 1.5rem !important;
}

.rounded-2xl {
    border-radius: 1rem !important;
}

.border {
    border-style: solid !important;
    border-width: 1px !important;
}

.border-dashed {
    border-style: dashed !important;
}

.border-white\/5 {
    border-color: rgba(255, 255, 255, 0.05) !important;
}

.border-white\/10 {
    border-color: rgba(255, 255, 255, 0.1) !important;
}

.bg-black\/20 {
    background-color: rgba(0, 0, 0, 0.2) !important;
}

.bg-white\/\[0\.02\] {
    background-color: rgba(255, 255, 255, 0.02) !important;
}

.flex {
    display: flex !important;
}

.flex-col {
    flex-direction: column !important;
}

.items-center {
    align-items: center !important;
}

.justify-center {
    justify-content: center !important;
}

.text-\[10px\] {
    font-size: 10px !important;
}

.text-gray-500 {
    color: #6b7280 !important;
}

.text-gray-600 {
    color: #4b5563 !important;
}

.text-gray-700 {
    color: #374151 !important;
}

.uppercase {
    text-transform: uppercase !important;
}

.tracking-widest {
    letter-spacing: 0.1em !important;
}

.transition-all {
    transition-property: all !important;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1) !important;
    transition-duration: 150ms !important;
}