/* ============================================================
   Sidebar: tree items, global search box, node drag & drop
   ============================================================ */

/* Sidebar tree item transitions (dark theme) */
.sidebar-item {
    transition: background-color 0.1s ease;
    border-radius: 6px;
    cursor: pointer;
    position: relative;
}
.sidebar-item:hover { background-color: #1e293b; }
.sidebar-item.active {
    background-color: rgba(59, 130, 246, 0.1);
    color: #60a5fa;
    font-weight: 500;
}
.sidebar-item.sidebar-item-keyboard-active {
    box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.55);
    background-color: rgba(59, 130, 246, 0.12);
}
.sidebar-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 16px;
    background: #3b82f6;
    border-radius: 0 3px 3px 0;
}
.sidebar-item .node-add-btn { opacity: 0; transition: opacity 0.1s ease; }
.sidebar-item:hover .node-add-btn { opacity: 1; }

/* Sidebar global search */
#global-search-box {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}
#global-search-box:focus-visible {
    outline: none;
    border-color: rgba(96, 165, 250, 0.85);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18);
}

/* ============================================================
   Sidebar Node Drag & Drop
   ============================================================ */
.sidebar-item[draggable="true"] { cursor: grab; }
.sidebar-item.node-drag-dragging { opacity: 0.35; cursor: grabbing; }
.sidebar-item.node-drop-above::before,
.sidebar-item.node-drop-below::after {
    content: '';
    position: absolute;
    left: 6px;
    right: 6px;
    height: 2px;
    background: #6366f1;
    border-radius: 9999px;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
    z-index: 10;
}
.sidebar-item.node-drop-above::before { top: -1px; }
.sidebar-item.node-drop-below::after  { bottom: -1px; }
.sidebar-item.node-drop-into {
    background-color: rgba(99, 102, 241, 0.12) !important;
    outline: 1px dashed rgba(99, 102, 241, 0.4);
    outline-offset: -2px;
}
