/* ============================================
   AIRNEXUS CONFIG — Black + White overrides
   on top of midnight-red theme
   ============================================ */

:root {
  --red-ui-primary-background: #000000;
  --red-ui-secondary-background: #0a0a0a;
  --red-ui-tertiary-background: #111111;
  --red-ui-primary-text-color: #ffffff;
  --red-ui-secondary-text-color: #cccccc;
  --red-ui-border-color: #222222;
  --red-ui-form-background: #111111;
  --red-ui-form-text-color: #ffffff;
  --red-ui-tab-background: #000000;
  --red-ui-shade-color: rgba(0,0,0,0.5);
}

body, #red-ui-editor, #red-ui-main-container, .red-ui-editor {
  background: #000 !important; color: #fff !important;
}

/* Header */
.red-ui-header { background: #000 !important; border-bottom: 1px solid #222 !important; }
.red-ui-header-logo span { font-size: 0 !important; visibility: hidden !important; width: 0 !important; }

/* Canvas */
#red-ui-workspace, #red-ui-workspace-chart, .red-ui-workspace-chart-background { background: #000 !important; }
.red-ui-workspace-chart-background { fill: #000 !important; }
.red-ui-workspace-chart-grid line { stroke: #1a1a2e !important; stroke-width: 0.4 !important; }
.red-ui-workspace-chart-grid rect { fill: #000 !important; }

/* Palette (left) */
.red-ui-palette, .red-ui-palette-container, .red-ui-palette-search,
.red-ui-palette-header, .red-ui-palette-content, .red-ui-palette-scroll,
#red-ui-palette, #red-ui-palette-container { background: #000 !important; }
.red-ui-palette-header { color: #fff !important; border-color: #222 !important; }
.red-ui-palette-category-label { background: #0a0a0a !important; color: #fff !important; }
.red-ui-palette-node { background: #0a0a0a !important; border-color: #222 !important; }
.red-ui-palette-node:hover { background: #111 !important; }
.red-ui-palette-label, .red-ui-palette-node-label,
.red-ui-palette-node span, .red-ui-palette-node div { color: #fff !important; }
#red-ui-palette-search input, .red-ui-searchBox-container input {
  background: #111 !important; color: #fff !important; border-color: #333 !important;
}
#red-ui-palette-search input:focus, .red-ui-searchBox-container input:focus {
  border-color: #E04040 !important; box-shadow: 0 0 0 1px rgba(224,64,64,0.3) !important;
}

/* Sidebar (right) */
.red-ui-sidebar, .red-ui-sidebar-content, .red-ui-sidebar-content > div,
.red-ui-sidebar-info, .red-ui-sidebar-info-stack, .red-ui-sidebar-debug,
.red-ui-sidebar-config, .red-ui-sidebar-context, .red-ui-sidebar-help,
#red-ui-sidebar-debug-content, .red-ui-sidebar > div {
  background: #000 !important; color: #fff !important;
}
.red-ui-treeList, .red-ui-treeList-container, .red-ui-treeList-label,
.red-ui-treeList-row, .red-ui-editableList, .red-ui-editableList-container,
.red-ui-info-outline, .red-ui-info-outline-item, .red-ui-info-outline-list,
.red-ui-info-outline-project, .red-ui-info-table, .red-ui-info-table td {
  background: #000 !important; color: #fff !important;
}
.red-ui-treeList-row:hover, .red-ui-info-outline-item:hover { background: #111 !important; }
.red-ui-sidebar-footer, .red-ui-tips { background: #000 !important; color: #888 !important; border-color: #222 !important; }

/* Debug messages */
.red-ui-debug-msg, .red-ui-debug-msg-element, .red-ui-debug-msg-row,
.red-ui-debug-msg-object-header { background: #000 !important; color: #fff !important; border-color: #222 !important; }
.red-ui-debug-msg-type-string { color: #4a9eff !important; }
.red-ui-debug-msg-type-number { color: #00c853 !important; }
.red-ui-debug-msg-type-boolean { color: #ff9800 !important; }
.red-ui-debug-msg-name { color: #888 !important; }

/* Tab bars */
.red-ui-tabs, .red-ui-tabs li, .red-ui-tab-button { background: #000 !important; color: #ccc !important; border-color: #222 !important; }
.red-ui-tabs li.active, .red-ui-tabs li.red-ui-tab-active { background: #111 !important; border-bottom: 2px solid #E04040 !important; color: #fff !important; }
.red-ui-tabs li:hover { color: #fff !important; }
.red-ui-tabs li a { color: inherit !important; }
.red-ui-tab-button a { color: #666 !important; }
.red-ui-tab-button a:hover { color: #E04040 !important; }

/* Inputs everywhere */
input, select, textarea, .form-control {
  background: #111 !important; color: #fff !important; border-color: #333 !important;
}
input:focus, select:focus, textarea:focus {
  border-color: #E04040 !important; box-shadow: 0 0 0 1px rgba(224,64,64,0.3) !important; outline: none !important;
}
select option { background: #111 !important; color: #fff !important; }
input[type="checkbox"], input[type="radio"] { accent-color: #E04040 !important; }

/* Trays / node edit */
.red-ui-tray, .red-ui-tray-body, .red-ui-tray-content, .red-ui-tray-body form {
  background: #000 !important; color: #fff !important;
}
.red-ui-tray-header { background: #000 !important; border-bottom: 1px solid #222 !important; color: #fff !important; }
.red-ui-tray-footer, .red-ui-tray-toolbar { background: #000 !important; border-top: 1px solid #222 !important; }
.red-ui-tray-resize-handle { background: #222 !important; }
.red-ui-tray label, .red-ui-editor label { color: #ccc !important; }
.red-ui-editableList-item-content, .red-ui-editableList li { background: #0a0a0a !important; border-color: #222 !important; color: #fff !important; }
.form-row, .form-row label, .form-tips { color: #ccc !important; }

/* TypedInput */
.red-ui-typedInput-container { background: #111 !important; border-color: #333 !important; }
.red-ui-typedInput-type-select { background: #0a0a0a !important; color: #fff !important; border-color: #333 !important; }
.red-ui-typedInput-options { background: #0a0a0a !important; border-color: #333 !important; }
.red-ui-typedInput-options a { color: #fff !important; }
.red-ui-typedInput-options a:hover { background: rgba(224,64,64,0.15) !important; }
input.red-ui-typedInput-input { background: #111 !important; color: #fff !important; }
.red-ui-typedInput-option-label { color: #fff !important; }

/* jQuery UI dialogs */
.ui-dialog, .ui-dialog-titlebar, .ui-dialog-content, .ui-dialog-buttonpane,
.ui-widget-content, .ui-widget-header, .ui-state-default, .ui-tabs-panel {
  background: #000 !important; color: #fff !important; border-color: #222 !important;
}
.ui-dialog .ui-dialog-titlebar-close { color: #888 !important; }
.ui-dialog .ui-dialog-titlebar-close:hover { color: #fff !important; }
.ui-dialog button { background: #111 !important; color: #fff !important; border-color: #333 !important; }
.ui-dialog button:hover { border-color: #4a9eff !important; }
.ui-widget-overlay { background: rgba(0,0,0,0.75) !important; }
.ui-tabs-nav li.ui-tabs-active, .ui-tabs-nav li.ui-state-active {
  background: #111 !important; border-bottom: 2px solid #E04040 !important;
}
.ui-tabs-nav li a { color: #ccc !important; }
.ui-tabs-nav li.ui-tabs-active a { color: #fff !important; }

/* Menus / dropdowns / context */
.red-ui-menu, .red-ui-popover, .red-ui-popover-panel, .red-ui-popover-content,
.dropdown-menu, .red-ui-autocomplete-container, .red-ui-context-menu,
.ui-autocomplete, .ui-menu { background: #0a0a0a !important; color: #fff !important; border-color: #222 !important; }
.red-ui-menu li a, .dropdown-menu li a, .ui-menu-item a { color: #fff !important; }
.red-ui-menu li a:hover, .dropdown-menu li a:hover, .ui-menu-item:hover { background: rgba(224,64,64,0.15) !important; }
.red-ui-menu .divider, .dropdown-menu .divider { background: #222 !important; }

/* Buttons */
.red-ui-button, button.red-ui-button, .ui-button {
  background: #111 !important; color: #fff !important; border-color: #333 !important;
}
.red-ui-button:hover, button.red-ui-button:hover { border-color: #4a9eff !important; }
.red-ui-button.primary, button.red-ui-button.primary { background: #E04040 !important; border-color: #E04040 !important; color: #fff !important; }
.red-ui-button.primary:hover { background: #c53030 !important; }

/* Deploy */
#red-ui-header-button-deploy { background: #E04040 !important; border: none !important; color: #fff !important; font-weight: 600 !important; }
#red-ui-header-button-deploy:hover { background: #c53030 !important; }
#red-ui-header-button-deploy.disabled { background: #333 !important; opacity: 0.5 !important; }
#red-ui-header-button-deploy-arrow { background: #c53030 !important; }

/* Notifications */
.red-ui-notification { background: #0a0a0a !important; color: #fff !important; border-color: #222 !important; }

/* Palette manager */
.red-ui-palette-editor, .red-ui-palette-editor-header, .red-ui-palette-module-card,
#red-ui-palette-editor { background: #000 !important; color: #fff !important; border-color: #222 !important; }
.red-ui-palette-editor-item { background: #0a0a0a !important; color: #fff !important; border-color: #222 !important; }
.red-ui-palette-editor-item:hover { background: #111 !important; }
.red-ui-palette-editor input { background: #111 !important; color: #fff !important; }

/* Import/export */
.red-ui-clipboard-dialog-textarea, .red-ui-clipboard-dialog textarea {
  background: #0a0a0a !important; color: #fff !important; border-color: #333 !important; font-family: "Fira Code",Consolas,monospace !important;
}

/* Search */
.red-ui-search-container { background: #0a0a0a !important; border-color: #222 !important; }
.red-ui-search-container input { background: #111 !important; color: #fff !important; }
.red-ui-search-result { color: #fff !important; border-color: #222 !important; }
.red-ui-search-result:hover, .red-ui-search-result.selected { background: #111 !important; }

/* Subflow */
.red-ui-subflow-toolbar { background: #000 !important; color: #fff !important; border-color: #222 !important; }

/* Monaco editor */
.monaco-editor, .monaco-editor .margin, .monaco-editor-background { background: #0a0a0a !important; }

/* Wires */
.red-ui-flow-link-line { stroke: #4a9eff !important; stroke-width: 2.5px !important; }
.red-ui-flow-link-line.red-ui-flow-link-selected, .red-ui-flow-link-line.link_selected {
  stroke: #E04040 !important; stroke-width: 3px !important;
}
.red-ui-flow-link-link { stroke: #ec407a !important; stroke-dasharray: 8 4 !important; }

/* Node pill shape */
.red-ui-flow-node rect { rx: 10; ry: 10; }

/* Force ALL node text to bright white */
.red-ui-flow-node text,
.red-ui-flow-node-label,
.red-ui-flow-node text.red-ui-flow-node-label,
.red-ui-flow-node tspan,
.red-ui-flow-node-label-text,
.red-ui-flow-node-sublabel,
.red-ui-flow-node text.red-ui-flow-sublabel {
  fill: #ffffff !important;
  color: #ffffff !important;
  opacity: 1 !important;
}
.red-ui-flow-node-status-label { fill: #cccccc !important; opacity: 1 !important; }
.red-ui-flow-port-label text { fill: #ffffff !important; }
.red-ui-flow-group text { fill: #cccccc !important; }

/* Selection box */
.red-ui-flow-selection-box { fill: rgba(224,64,64,0.08) !important; stroke: #E04040 !important; }

/* Groups */
.red-ui-flow-group rect { rx: 10; ry: 10; stroke: rgba(74,158,255,0.2) !important; fill: rgba(74,158,255,0.03) !important; }

/* Status dot glow */
.red-ui-flow-node-status-dot { filter: drop-shadow(0 0 3px currentColor) !important; }

/* Scrollbars */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #000; }
::-webkit-scrollbar-thumb { background: #333; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #444; }

/* Selection highlight */
::selection { background: rgba(224,64,64,0.3) !important; color: #fff !important; }

/* Links */
a { color: #4a9eff !important; }

/* Loading */
#red-ui-loading-progress { background: #000 !important; }
#red-ui-loading-progress .red-ui-loading-bar { background: #E04040 !important; }

/* ============================================
   LOGIN PAGE
   ============================================ */
#node-dialog-login {
  background: #000 !important;
  border: none !important;
  box-shadow: none !important;
}

/* Login dialog background overlay */
.ui-widget-overlay {
  background: #000 !important;
  opacity: 1 !important;
}

/* Login form container */
#node-dialog-login-fields {
  background: #0a0a0a !important;
  border: 1px solid #222 !important;
  border-radius: 8px !important;
  padding: 30px !important;
}

/* Hide the Node-RED logo image, replace with our branding */
#node-dialog-login-image {
  background: #000 !important;
  text-indent: -9999px !important;
  overflow: hidden !important;
  height: 60px !important;
}

/* Login inputs */
#node-dialog-login input[type="text"],
#node-dialog-login input[type="password"],
#node-dialog-login input {
  background: #111 !important;
  color: #fff !important;
  border: 1px solid #333 !important;
  border-radius: 5px !important;
  padding: 10px 12px !important;
  font-size: 14px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}
#node-dialog-login input:focus {
  border-color: #E04040 !important;
  box-shadow: 0 0 0 2px rgba(224,64,64,0.2) !important;
  outline: none !important;
}
#node-dialog-login input::placeholder {
  color: #666 !important;
}

/* Login labels */
#node-dialog-login label {
  color: #ccc !important;
  font-size: 13px !important;
  margin-bottom: 6px !important;
}

/* Login submit button */
#node-dialog-login-submit {
  background: #E04040 !important;
  color: #fff !important;
  border: none !important;
  border-radius: 5px !important;
  padding: 10px 24px !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  width: 100% !important;
  letter-spacing: 0.5px !important;
}
#node-dialog-login-submit:hover {
  background: #c53030 !important;
}

/* Failed login message */
#node-dialog-login-failed {
  color: #E04040 !important;
  background: rgba(224,64,64,0.1) !important;
  border: 1px solid rgba(224,64,64,0.3) !important;
  border-radius: 5px !important;
  padding: 8px !important;
}

/* Cancel button */
#node-dialog-login-cancel {
  background: #111 !important;
  color: #ccc !important;
  border: 1px solid #333 !important;
  border-radius: 5px !important;
}

/* Login spinner */
.login-spinner {
  color: #E04040 !important;
}

/* Hide any Node-RED branding text in login */
#node-dialog-login .ui-dialog-titlebar {
  display: none !important;
}
