* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow: hidden;
    background: #0a0a0a;
    color: #ffffff;
}

#background-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

#workspace {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    cursor: grab;
}

#workspace.panning {
    cursor: grabbing;
}

#connections-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

#nodes-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 10000px;
    height: 10000px;
    transform-origin: 0 0;
}

.node {
    position: absolute;
    background: rgba(30, 30, 35, 0.95);
    border: 2px solid #444;
    border-radius: 8px;
    min-width: 320px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
}

.node.selected {
    border-color: #4a9eff;
    box-shadow: 0 0 20px rgba(74, 158, 255, 0.5);
}

.node-header {
    background: linear-gradient(135deg, #2a2a30 0%, #1a1a20 100%);
    padding: 12px 15px;
    border-radius: 6px 6px 0 0;
    cursor: move;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #444;
}

.node-title {
    font-weight: 600;
    font-size: 14px;
    color: #fff;
}

.node-close {
    background: #ff4444;
    border: none;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.node-close:hover {
    background: #ff6666;
}

.node-body {
    padding: 15px;
}

.pointcloud-viewer {
    width: 100%;
    height: 200px;
    background: #000;
    border-radius: 4px;
    margin-bottom: 12px;
    border: 1px solid #333;
}

.control-panel {
    background: rgba(20, 20, 25, 0.8);
    padding: 12px;
    border-radius: 4px;
    border: 1px solid #333;
}

.control-group {
    margin-bottom: 10px;
}

.control-group:last-child {
    margin-bottom: 0;
}

.control-label {
    display: block;
    font-size: 11px;
    color: #aaa;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.control-input {
    width: 100%;
    background: rgba(40, 40, 45, 0.9);
    border: 1px solid #555;
    color: #fff;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 13px;
}

.control-input:focus {
    outline: none;
    border-color: #4a9eff;
}

.control-slider {
    width: 100%;
    height: 4px;
    background: #333;
    border-radius: 2px;
    outline: none;
    -webkit-appearance: none;
}

.control-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    background: #4a9eff;
    border-radius: 50%;
    cursor: pointer;
}

.control-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: #4a9eff;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.node-ports {
    position: relative;
}

.port {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 14px;
    height: 14px;
    background: #666;
    border: 2px solid #888;
    border-radius: 50%;
    cursor: crosshair;
    transition: all 0.2s;
    z-index: 10;
}

.port:hover {
    background: #4a9eff;
    border-color: #4a9eff;
    transform: translateX(-50%) scale(1.3);
}

.port.input {
    top: -22px;
    background: #4a9eff;
}

.port.output {
    bottom: -22px;
    background: #ff9900;
}

#toolbar {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 100;
    display: flex;
    gap: 10px;
    align-items: center;
}

button {
    background: linear-gradient(135deg, #4a9eff 0%, #357abd 100%);
    border: none;
    color: white;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 2px 10px rgba(74, 158, 255, 0.3);
    transition: all 0.2s;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(74, 158, 255, 0.5);
}

button:active {
    transform: translateY(0);
}

#info {
    background: rgba(30, 30, 35, 0.9);
    padding: 8px 15px;
    border-radius: 6px;
    font-size: 12px;
    color: #aaa;
    border: 1px solid #444;
}

.connection-line {
    stroke: #4a9eff;
    stroke-width: 2;
    fill: none;
    pointer-events: stroke;
    cursor: pointer;
}

.connection-line:hover {
    stroke: #ff9900;
    stroke-width: 3;
}

.temp-connection {
    stroke: #4a9eff;
    stroke-width: 2;
    fill: none;
    stroke-dasharray: 5, 5;
    pointer-events: none;
    opacity: 0.6;
}
