/* ====================== 05-NODE-MENU-BTN.CSS ====================== */
/* Стили ТОЛЬКО для кнопок и меню УЗЛОВ дерева */

.node-menu-btn,
.node-btn {
    width: 34px;
    height: 34px;
    border: none;
    background: var(--bg-surface);
    color: var(--text-muted);
    font-size: 19px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-left: auto;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
}

/* Hover / Active — только для узлов */
.node-menu-btn:hover,
.node-btn:hover { /* ... */ }

.node-menu-btn:active,
.node-btn:active { /* ... */ }

/* ====================== РЕЖИМ ПЕРЕТАСКИВАНИЯ ====================== */
body.reorder-enabled .node-menu-btn,
body.reorder-enabled .node-menu,
.drag-drop-active .node-menu-btn,
.drag-drop-active .node-menu {
    display: none !important;
}

/* Тёмная тема — только для узлов */
body.theme-dark .node-menu-btn,
body.theme-dark .node-btn { /* ... */ }


/* ====================== NODE MENU (выпадающее меню узла) ====================== */

.node-menu {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    padding: 6px 0;
    min-width: 180px;
    font-size: 0.95em;
    color: var(--text-primary);
    overflow: hidden;
    z-index: 99999;
}

/* Пункты меню */
.node-menu .menu-item {
    display: block;
    width: 100%;
    padding: 10px 16px;
    text-align: left;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 0.95em;
    cursor: pointer;
    transition: background-color 0.15s ease;
    white-space: nowrap;
}

.node-menu .menu-item:hover {
    background-color: var(--bg-surface);
}

.node-menu .menu-item:active {
    background-color: var(--accent);
    color: white;
}

/* Опасные действия (Удалить) */
.node-menu .menu-item.btn-danger {
    color: #e74c3c;
}

.node-menu .menu-item.btn-danger:hover {
    background-color: rgba(231, 76, 60, 0.1);
}

/* Успешные действия (в режиме перемещения) */
.node-menu .menu-item.btn-success {
    color: #27ae60;
    font-weight: 500;
}

.node-menu .menu-item.btn-success:hover {
    background-color: rgba(39, 174, 96, 0.1);
}

/* Заблокированный пункт */
.node-menu .menu-disabled {
    padding: 10px 16px;
    color: var(--text-muted);
    font-size: 0.9em;
    text-align: center;
    cursor: default;
}

/* ====================== КНОПКА МЕНЮ ⋮ ====================== */

.node-menu-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.4em;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    margin-left: auto;
}

.node-menu-btn:hover {
    background: var(--bg-surface);
    color: var(--text-primary);
}

.node-menu-btn:active {
    transform: scale(0.95);
}

/* В тёмной теме */
body.theme-dark .node-menu-btn:hover {
    background: #334155;
}