/*
 * alfa-node — custom editor CSS
 * Brand color: #3478C6
 */

/* Hide palette manager (install/remove nodes) */
.red-ui-palette-editor {
  display: none !important;
}

/* Hide quick-add popup (double-click on canvas) — core nodes leak through it */
.red-ui-type-search {
  display: none !important;
}

/*
 * RBAC: hide editor until JS confirms user role.
 * rbac-ui.js removes this class after permission check.
 * Prevents flash of editor for global admin on page load.
 */
body.rbac-loading #red-ui-palette,
body.rbac-loading #red-ui-workspace,
body.rbac-loading .red-ui-tabs,
body.rbac-loading #red-ui-header-button-deploy {
  visibility: hidden !important;
}

/*
 * Hide core Node-RED palette categories — only Bot Engine nodes visible.
 * Core nodes are still loaded in runtime (flows using inject etc. work).
 */
#red-ui-palette-container-common,
#red-ui-palette-container-network,
#red-ui-palette-container-sequence,
#red-ui-palette-container-parser,
#red-ui-palette-container-storage,
#red-ui-palette-container-input,
#red-ui-palette-container-output,
#red-ui-palette-container-analysis,
#red-ui-palette-container-social,
#red-ui-palette-container-advanced {
  display: none !important;
}

/* ── Deploy button ── */
#red-ui-header-button-deploy {
  background: #3478C6 !important;
  border-color: #2a63a8 !important;
  color: #ffffff !important;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3) !important;
  font-weight: 600 !important;
}
#red-ui-header-button-deploy:hover {
  background: #2a63a8 !important;
  color: #ffffff !important;
}
#red-ui-header-button-deploy:active {
  background: #1e5090 !important;
}
#red-ui-header-button-deploy img {
  filter: brightness(10) !important;
}

/* Deploy dropdown arrow */
#red-ui-header-button-deploy-options {
  background: #2a63a8 !important;
  border-color: #2a63a8 !important;
  color: #ffffff !important;
}
#red-ui-header-button-deploy-options:hover {
  background: #1e5090 !important;
}

/* Deploy menu icons (the red squares) */
.red-ui-deploy-button-group .red-ui-deploy-button-options li .red-ui-deploy-button-content img,
.red-ui-deploy-button-group img {
  filter: hue-rotate(200deg) saturate(0.8);
}

/* Deploy menu - restart icon */
.red-ui-deploy-button-group .red-ui-deploy-button-options li:last-child .red-ui-deploy-button-content img {
  filter: hue-rotate(200deg) saturate(0.8);
}

/* ── Header bar ── */
#red-ui-header {
  background: #2c3e50 !important;
}

/* ── Node highlight/selection ── */
.red-ui-flow-node-selected {
  stroke: #3478C6 !important;
}

/* ── Sidebar active tab ── */
.red-ui-sidebar-tab-selected {
  border-bottom-color: #3478C6 !important;
}

/* ── Links ── */
.red-ui-editor a,
.red-ui-panel a {
  color: #3478C6;
}
