body {
    margin: 0;
    padding: 0;
    background-color: #1a1a1a;
    color: #ffffff;
    font-family: Arial, sans-serif;
    display: flex;
    height: 100vh;
}

#playground {
    flex: 3;
    position: relative;
    background-color: #2d2d2d;
    overflow: auto;
}

#sidebar {
    width: 200px;
    background-color: #333333;
    padding: 20px;
    border-left: 2px solid #404040;
}

.gate {
    background-color: #404040;
    padding: 10px;
    margin: 10px 0;
    border-radius: 5px;
    cursor: move;
    user-select: none;
}

.draggable-gate {
    position: absolute;
    background-color: #4d4d4d;
    padding: 15px;
    border-radius: 8px;
    min-width: 80px;
    text-align: center;
    cursor: move;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.gate-title {
    font-weight: bold;
    pointer-events: none;
}

.gate-state {
    font-size: 0.8em;
    pointer-events: none;
}

.connector {
    width: 16px;
    height: 16px;
    background-color: #666;
    border-radius: 50%;
    position: absolute;
    cursor: pointer;
}

.input-connector {
    left: -6px;
}

.output-connector {
    right: -6px;
}

.wire {
    position: absolute;
    background-color: #00ff00;
    height: 2px;
    transform-origin: left center;
    pointer-events: none;
}

.on { background-color: #4CAF50 !important; }
.off { background-color: #f44336 !important; }
.active { background-color: #4CAF50 !important; }
.highlight { background-color: #00ff00 !important; }

#trash {
    position: fixed;
    bottom: 20px;
    left: 20px;
    font-size: 2em;
    padding: 10px;
    background: #ff4444;
    border-radius: 5px;
    opacity: 0.5;
    transition: opacity 0.3s;
}

#trash.hovered {
    opacity: 1;
    transform: scale(1.2);
}


#reset {
    position: fixed;
    top: 20px;
    left: 20px;
    padding: 10px 20px;
    background: #555;
    border-radius: 5px;
    cursor: pointer;
    z-index: 1000;
}

#reset:hover {
    background: #666;
}