/* ==========================================================================
   NEEDEE visual HTML editor — DARK THEME
   --------------------------------------------------------------------------
   Companion stylesheet for css/needee.css (needee.net).
   Load it AFTER css/needee.css and after Bootstrap:

       <link rel="stylesheet" href="css/needee.css">
       ...
       <link rel="stylesheet" href="css/needee-dark.css">

   Recommended (makes Bootstrap 5.3 components dark as well):

       <html lang="en" data-bs-theme="dark">

   The file only changes colours, borders and shadows. No layout,
   sizing or positioning rules are modified, so it is safe to drop in
   on top of the existing editor.
   ========================================================================== */

:root,host {
  color-scheme: dark;

  /* Accent used by the editor for handles, highlights and active tabs. */
  --helper-color: #4d9eff;

  /* Dark palette */
  --nd-bg: #0e1217;
  /* page / workspace behind the canvas       */
  --nd-surface: #151a21;
  /* main panels and bars                     */
  --nd-surface-2: #1b2129;
  /* cards, sections, popups                  */
  --nd-surface-3: #242c36;
  /* hovered / raised controls                */
  --nd-surface-4: #2e3843;
  /* pressed / strong hover                   */
  --nd-border: #2c3540;
  --nd-border-soft: #232b34;
  --nd-text: #d8dee8;
  --nd-text-dim: #a3adbb;
  --nd-text-muted: #7f8a99;
  --nd-input: #10151b;
  --nd-danger: #ff6b6b;

  /* Bootstrap 5.3 variables (work with or without data-bs-theme) */
  --bs-body-bg: var(--nd-bg);
  --bs-body-color: var(--nd-text);
  --bs-border-color: var(--nd-border);
  --bs-secondary-bg: var(--nd-surface-2);
  --bs-tertiary-bg: var(--nd-surface-3);
  --bs-emphasis-color: #ffffff;
  --bs-secondary-color: var(--nd-text-dim);
  --bs-tertiary-color: var(--nd-text-muted);
  --bs-table-color: var(--nd-text);
  --bs-table-bg: transparent;
  /* also fixes an invalid value in the original sheet */
  --bs-table-striped-bg: rgba(255, 255, 255, .04);
  --bs-table-border-color: var(--nd-border);
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */

html,
body {
  background-color: var(--nd-bg);
  color: var(--nd-text);
}

body {
  color: var(--nd-text);
}

::selection {
  background: rgba(77, 158, 255, .35);
  color: #ffffff;
}

::placeholder {
  color: var(--nd-text-muted) !important;
  opacity: 1;
}

input[type=range],
input[type=checkbox],
input[type=radio],
progress {
  accent-color: var(--helper-color);
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
select:-webkit-autofill {
  -webkit-text-fill-color: var(--nd-text);
  -webkit-box-shadow: 0 0 0 1000px var(--nd-input) inset;
}

/* Scrollbars (Chrome/Edge/Safari + Firefox) */
* {
  scrollbar-color: #3a4450 var(--nd-bg);
  scrollbar-width: thin;
}

::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

::-webkit-scrollbar-track {
  background: var(--nd-bg);
}

::-webkit-scrollbar-thumb {
  background: #38424e;
  border: 3px solid var(--nd-bg);
  border-radius: 8px;
}

::-webkit-scrollbar-thumb:hover {
  background: #46525f;
}

::-webkit-scrollbar-corner {
  background: var(--nd-bg);
}

/* --------------------------------------------------------------------------
   Top bar and app chrome
   -------------------------------------------------------------------------- */

/* Inline background-color:#fff in the page markup */
#needee-all {
  background-color: var(--nd-surface) !important;
  box-shadow: 0px 4px 10px rgba(0, 0, 0, .55);
}

.needee-top-panel {
  background-color: var(--nd-surface);
  border-top-color: var(--nd-border-soft);
  border-bottom-color: var(--nd-border-soft);
  box-shadow: 0px -2px 8px rgba(0, 0, 0, .45);
}

.needee-top-panel i {
  color: var(--helper-color);
}

.needee-top-panel button {
  background-color: var(--nd-surface-2);
  border-color: var(--nd-border);
  box-shadow: 0 0 3px rgba(0, 0, 0, .6);
}

.needee-top-panel button:hover {
  background-color: var(--nd-surface-3);
}

/* The smart-menu icons are SVG text with a white outline in the markup */
.needee-top-panel svg text,
#cheat-sheet-icon svg text,
#sign-up-needee svg text {
  stroke: var(--nd-bg) !important;
}

.btn-light {
  color: var(--nd-text);
  background-color: var(--nd-surface-2);
  border-color: var(--nd-border);
}

.btn-light:hover {
  background-color: var(--nd-surface-3);
  border-color: var(--nd-border);
}

.b4-btn {
  color: var(--nd-text);
}

.btn-primary {
  color: #ffffff;
  background-color: var(--helper-color);
  border-color: var(--helper-color);
}

.btn-outline-primary {
  color: var(--helper-color);
  border-color: var(--helper-color);
}

.btn-outline-primary:hover,
.btn-outline-primary:not(:disabled):not(.disabled).active,
.btn-outline-primary:not(:disabled):not(.disabled):active,
.show>.btn-outline-primary.dropdown-toggle {
  color: #ffffff;
  background-color: var(--helper-color);
  border-color: var(--helper-color);
}

.save_options_needee {
  /* the wrapper carries an inline background-color:#eee */
  background-color: var(--nd-surface-3) !important;
  border-color: var(--nd-border);
  box-shadow: 0 0 4px rgba(0, 0, 0, .6);
}

button>.kebab_menu_needee:hover {
  background-color: var(--nd-surface-3);
  box-shadow: 0 0 3px rgba(0, 0, 0, .6);
}

.needee-close,
.needee_close {
  color: var(--nd-text-muted);
}

.needee_close:hover {
  background-color: var(--nd-surface-3);
}

.responsive-btns>div>button:hover {
  background-color: rgba(255, 255, 255, .07);
}

/* Viewport switcher pop-out has an inline white background */
#needee-top-panel .btn-group[style*="background-color: white"] {
  background-color: var(--nd-surface-2) !important;
}

/* --------------------------------------------------------------------------
   Floating panels: sidebar, properties, settings, cheat sheet
   -------------------------------------------------------------------------- */

.nee-shadow {
  background-color: var(--nd-surface);
  border-color: var(--nd-border);
  box-shadow: 0 0 12px rgba(0, 0, 0, .75);
}

#properties-panel {
  background-color: var(--nd-surface);
  color: var(--nd-text);
}

#properties-needee {
  color: var(--nd-text);
}

#properties-needee .tab-pane>.header,
#properties-needee .tab-pane2>.header,
.sidebar-header {
  background-color: var(--nd-surface-2);
  color: var(--helper-color);
  border-color: var(--nd-border-soft);
}

#sidebar-title {
  color: var(--nd-text-dim) !important;
}

#settings-needee,
#export-needee,
#addfonts-needee,
.settings-panel-needee {
  background-color: var(--nd-surface);
  color: var(--nd-text);
}

/* Settings panel ships inline rgb(227,227,227) form backgrounds */
#settings-needee [style*="227, 227, 227"],
#settings-needee form,
#nd_attributes_sec {
  background-color: var(--nd-surface-2) !important;
}

#settings-needee [style*="color: royalblue"] {
  color: var(--helper-color) !important;
}

#settings-needee>label {
  background-color: var(--nd-surface-2);
  color: var(--helper-color);
  box-shadow: 0 0 5px rgba(0, 0, 0, .55);
}

#settings-needee form button {
  background-color: var(--nd-surface-3) !important;
  border: 1px solid var(--nd-border) !important;
  color: var(--nd-text-dim) !important;
  box-shadow: 0 0 4px rgba(0, 0, 0, .6) !important;
}

#settings-needee label:hover,
#assisting_elements>label:hover,
.section-needee .needee_edit_icon:hover {
  background-color: var(--nd-surface-3) !important;
}

/* Cheat sheet: inline white / lightgrey backgrounds in the markup */
#cheat-sheet-box {
  background-color: var(--nd-surface) !important;
  box-shadow: 0 0 10px rgba(0, 0, 0, .85) !important;
  border-color: var(--nd-border) !important;
}

#cheat-sheet-handle-needee {
  background-color: var(--nd-surface-2) !important;
}

#cheat-sheet-handle-needee>div {
  background-color: var(--nd-surface) !important;
  box-shadow: 0 0 8px rgba(0, 0, 0, .8);
}

#cheat-sheet-box button {
  background-color: var(--nd-surface-3) !important;
  border-color: var(--nd-border) !important;
  color: var(--nd-text) !important;
}

#cheat-sheet-box .searchinput {
  background-color: var(--nd-input);
  color: var(--nd-text);
  box-shadow: 0 0 3px rgba(0, 0, 0, .8) inset, 0 0 6px rgba(0, 0, 0, .5);
}

/* Template gallery opens with an inline white background */
#demo-templates {
  background-color: var(--nd-bg) !important;
}

#demo-templates>div:not(:first-child) {
  box-shadow: 0 0 6px rgba(0, 0, 0, .7);
}

/* --------------------------------------------------------------------------
   Sections, accordions, tabs
   -------------------------------------------------------------------------- */

.section-needee {
  background-color: var(--nd-surface-2);
  color: var(--nd-text-dim);
  /* keeps the original layout (border:none) while adding a dark outline */
  box-shadow: 0 0 0 1px var(--nd-border-soft), 0 0 6px rgba(0, 0, 0, .55);
  border-color: transparent;
}

#properties-needee .tab-pane .section-needee,
#properties-needee .tab-pane2 .section-needee {
  box-shadow: 0 0 0 1px var(--nd-border-soft), 0 0 5px rgba(0, 0, 0, .6);
}

.panel-needee,
.accordion-needee {
  background-color: var(--nd-surface-2);
  color: var(--nd-text);
}

.accordion-needee.active,
.accordion-needee:hover {
  background-color: var(--nd-surface-3);
}

button.accordion-needee:after {
  color: var(--helper-color) !important;
}

#properties-needee .btn-group {
  box-shadow: 0 0 3px rgba(0, 0, 0, .65);
}

#properties-needee i {
  color: inherit;
}

#properties-needee .blue_button {
  color: #ffffff;
  background-color: var(--helper-color);
}

#properties-needee .grey_button {
  background-color: var(--nd-surface-3);
  border-color: var(--nd-border);
  box-shadow: 0 0 3px rgba(0, 0, 0, .6);
  color: var(--nd-text-dim);
}

.nav-tabs .nav-link.active {
  background-color: var(--nd-surface-2) !important;
  border-bottom-color: var(--nd-surface-2) !important;
}

#sidebar-needee .nav-item>.active,
#properties-needee .nav-item>.active {
  color: var(--nd-text);
}

.nav-item>.nonactive {
  border-left-color: var(--nd-border-soft);
  border-right-color: var(--nd-border-soft);
  box-shadow: 0 3px 3px rgba(0, 0, 0, .45);
}

.selectAllBar {
  background-color: var(--nd-surface-2);
  color: var(--helper-color);
}

#files-tab>div:hover,
#files-tabb>div:hover {
  background-color: var(--nd-surface-3);
}

#properties-needee .tab-pane>.header>i,
#properties-needee .tab-pane2>.header>i {
  color: var(--helper-color);
}

/* --------------------------------------------------------------------------
   Edit bars, mini bar, dropdowns
   -------------------------------------------------------------------------- */

.needee-edit-bar {
  background-color: var(--nd-surface-2);
  box-shadow: 0 1px 12px rgba(0, 0, 0, .8);
}

.needee-edit-bar>.needee_edit_icon,
#textPropertiesSec .section-needee>.form-group>.needee_edit_icon {
  background-color: var(--nd-surface-3);
  border-color: var(--nd-border);
  box-shadow: 0 0 3px rgba(0, 0, 0, .7);
}

.needee-edit-bar>.needee_edit_icon:hover {
  background-color: var(--nd-surface-4);
}

.needee_select1,
.needee-select_menu {
  background-color: var(--nd-surface-2);
  color: var(--nd-text);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .75);
}

.needee_select1>div:not(.ui-resizable-handle),
.needee-select_menu>div,
.needee-select_menu>h5 {
  border-top-color: var(--nd-border);
}

.needee_select1_wrap,
.needee-select {
  color: var(--nd-text-dim);
  background-color: transparent;
}

.needee_hover>div:hover,
#needee-options .kebab_menu_needee div div:not(#transUnits *):hover,
.needee-select_menu>div:hover {
  background-color: rgba(255, 255, 255, .07);
}

.selected-needee {
  background-color: rgba(77, 158, 255, .16);
}

.needee-select_menu>h5 {
  color: var(--nd-text-muted);
}

#needee-slider {
  background-color: var(--nd-surface-2);
  box-shadow: 0 0 10px rgba(0, 0, 0, .8);
}

#indicator_top_needee>div,
#indicator_left_needee>div {
  background-color: var(--nd-surface-3);
  color: var(--nd-text);
}

#file_menu_needee {
  background-color: var(--nd-surface-2);
  box-shadow: 0 0 10px rgba(0, 0, 0, .8);
}

#file_menu_needee>div {
  color: var(--helper-color);
}

#file_menu_needee>div:hover {
  background-color: rgba(255, 255, 255, .07);
}

#quick_save_menu_needee {
  background-color: var(--nd-surface-2);
  color: var(--nd-text-dim);
  box-shadow: 0 0 10px rgba(0, 0, 0, .8);
}

#autofill-input-needee {
  background-color: var(--nd-surface-2);
  border-color: var(--nd-border);
  color: var(--nd-text);
}

#autofill-needee {
  box-shadow: 0 0 5px rgba(0, 0, 0, .6);
}

/* Dropdown arrows are dark SVG data-URIs in the original sheet */
.custom-select {
  background-color: var(--nd-input);
  color: var(--nd-text);
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'%3E%3Cpath fill='%23a3adbb' d='M2 0L0 2h4zm0 5L0 3h4z'/%3E%3C/svg%3E");
}

.needee_fonts {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='24px' height='24px' viewBox='0 0 24 24'%3e%3cpath fill='%23c3ccd8' d='M7 10l5 5 5-5H7z'/%3e%3c/svg%3e");
}

/* --------------------------------------------------------------------------
   Form controls
   -------------------------------------------------------------------------- */

.form-control,
.form-select,
.custom-select,
.needee_input_field,
.searchinput,
#input-needee,
#needee-fonts2,
.custom_select_nd,
.needee-select_arrow {
  background-color: var(--nd-input);
  color: var(--nd-text);
  border-color: var(--nd-border);
  box-shadow: 0 0 3px rgba(0, 0, 0, .5) inset, 0 0 0 1px var(--nd-border);
}

#properties-needee select,
#properties-needee input:not(input[type=checkbox]),
#properties-needee textarea,
#properties-needee .custom_select_nd,
#properties-needee #needee-fonts2 {
  background-color: var(--nd-input);
  color: var(--nd-text);
  box-shadow: 0 0 0 1px var(--nd-border), 0 0 4px rgba(0, 0, 0, .55);
}

#properties-needee button {
  color: var(--nd-text);
  border-color: var(--nd-border);
  box-shadow: 0 0 4px rgba(0, 0, 0, .6);
}

#properties-needee select option,
select option {
  background-color: var(--nd-surface-2);
  color: var(--nd-text);
}

.searchinput:focus,
#input-needee:focus,
.form-control:focus,
.form-select:focus,
.needee_input_field:focus {
  background-color: var(--nd-input);
  color: var(--nd-text);
  border-color: var(--helper-color) !important;
  box-shadow: 0 0 6px rgba(77, 158, 255, .55);
}

#properties-needee input:focus {
  border-color: var(--helper-color);
  box-shadow: 0 0 6px rgba(77, 158, 255, .55);
}

.form-control::placeholder,
.searchinput::placeholder {
  color: var(--nd-text-muted) !important;
}

/* Colour swatch inputs stay dark around the swatch */
input[type=color] {
  background-color: var(--nd-surface-3);
  border-color: var(--nd-border);
}

/* Toggle switches (inline SVG assets are rebuilt for dark surfaces) */
.toggle_switch_needee,
.checkbox_toggle_needee {
  background-color: var(--nd-surface-3);
  border-color: var(--nd-border);
  box-shadow: 0 0 5px rgba(0, 0, 0, .65);
}

.toggle_switch_needee>div {
  background-color: var(--helper-color);
  box-shadow: 0 0 5px rgba(0, 0, 0, .7);
}

.toggle_switch_off_needee {
  background-color: var(--nd-surface-4) !important;
}

.toggle_switch_disabled_needee,
.checkbox_toggle_needee:disabled {
  background-color: var(--nd-surface-2);
  box-shadow: none;
}

.toggle_switch_disabled_needee>div {
  background-color: #55606d !important;
}

.checkbox_toggle_needee {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 130 130'%3E%3Ccircle cx='65' cy='65' r='50' fill='%236b7684'/%3E%3C/svg%3E");
}

.checkbox_toggle_needee:checked {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 130 130'%3E%3Ccircle cx='65' cy='65' r='50' fill='%234d9eff'/%3E%3C/svg%3E");
}

.checkbox_toggle_needee:disabled {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 130 130'%3E%3Ccircle cx='65' cy='65' r='50' fill='%234a535e'/%3E%3C/svg%3E");
}

/* --------------------------------------------------------------------------
   Lists, cards, files, tables
   -------------------------------------------------------------------------- */

.listbox {
  background-color: rgba(255, 255, 255, .035);
  border-color: var(--nd-border);
  box-shadow: 0 0 4px rgba(0, 0, 0, .6);
}

.listbox>span {
  color: var(--nd-text-dim);
}

.listbox>span>span:first-of-type {
  color: var(--helper-color);
}

.listbox>span>span:last-of-type {
  color: #e3b341;
}

.listbox_remove,
#children-buttons>div {
  background-color: var(--nd-surface-2);
  border-color: var(--nd-border) !important;
  box-shadow: 0 0 5px rgba(0, 0, 0, .6);
  color: var(--nd-text);
}

#add-css-needee>button {
  background-color: var(--nd-surface-2);
  border-color: var(--nd-border);
  box-shadow: 0 0 5px rgba(0, 0, 0, .6);
  color: var(--nd-text);
}

.arrow-button-needee {
  color: #ffffff;
}

.card_needee {
  background-color: rgba(255, 255, 255, .045);
  box-shadow: 0 0 10px rgba(0, 0, 0, .7);
}

.card_button_needee {
  background-color: var(--nd-surface-3);
  border-color: var(--nd-border);
  color: var(--nd-text);
}

.colors_needee {
  color: var(--nd-text-dim);
  background-color: var(--nd-surface-2);
}

.colors_needee:hover {
  background-color: var(--nd-surface-3);
}

.grey_needee {
  background-color: var(--nd-surface-2);
}

.plan_needeed {
  color: var(--nd-danger);
  background-color: var(--nd-surface-2);
}

.files-icon {
  box-shadow: 0 0 3px rgba(0, 0, 0, .7);
}

.files-icon:hover {
  background-color: rgba(255, 255, 255, .08);
}

.file-explorer a {
  color: var(--nd-text-dim);
}

.file-explorer a:hover {
  background-color: rgba(255, 255, 255, .06);
}

.error-message {
  background-color: rgba(198, 40, 40, .16);
  color: #ff8a80;
  border-color: rgba(255, 138, 128, .35);
}

.needee_color_box {
  border-color: var(--nd-border);
}

.smart_table_needee {
  background-color: var(--nd-surface-2);
  color: var(--nd-text-dim);
}

.table-bordered {
  border-color: var(--nd-border);
}

.table-striped tbody tr:nth-of-type(2n+1) {
  background-color: rgba(255, 255, 255, .04);
}

#properties-needee pre {
  background-color: var(--nd-input);
  color: var(--nd-text-dim);
}

#properties-needee pre:has(code) {
  background-color: #05070a;
  color: #cfd6df;
}

#properties-needee .pre {
  border-color: var(--nd-border);
  box-shadow: 0 0 6px rgba(0, 0, 0, .7);
}

.highlight_needee {
  color: var(--helper-color);
}

/* --------------------------------------------------------------------------
   Thumbnails palette
   -------------------------------------------------------------------------- */

.leftsidebar .needee-thumbnailHolder {
  background-color: var(--nd-surface-2);
  border-color: var(--nd-border-soft);
  box-shadow: 0 0 5px rgba(0, 0, 0, .55);
}

.needee-thumbnailHolder:hover {
  background-color: var(--nd-surface-3);
}

/* --------------------------------------------------------------------------
   Third-party widgets (Bootstrap / jQuery UI)
   -------------------------------------------------------------------------- */

.form-control,
.form-select {
  background-color: var(--nd-input);
  color: var(--nd-text);
}

.btn-close {
  filter: invert(1) grayscale(1) brightness(1.6);
}

.dropdown-menu,
.modal-content,
.offcanvas,
.popover {
  background-color: var(--nd-surface-2);
  color: var(--nd-text);
  border-color: var(--nd-border);
}

.dropdown-item {
  color: var(--nd-text);
}

.dropdown-item:hover,
.dropdown-item:focus {
  background-color: var(--nd-surface-3);
  color: #ffffff;
}

.modal-header,
.modal-footer,
.popover-header {
  border-color: var(--nd-border);
}

.ui-widget-content,
.ui-dialog,
.ui-datepicker,
.ui-menu {
  background: var(--nd-surface-2);
  color: var(--nd-text);
  border-color: var(--nd-border);
}

.ui-widget-header {
  background: var(--nd-surface-3);
  color: var(--nd-text);
  border-color: var(--nd-border);
}

.ui-state-default,
.ui-widget-content .ui-state-default,
.ui-widget-header .ui-state-default {
  background: var(--nd-surface-2);
  color: var(--nd-text-dim);
  border-color: var(--nd-border);
}

.ui-state-hover,
.ui-state-focus,
.ui-state-active {
  background: var(--nd-surface-3);
  color: #ffffff;
  border-color: var(--helper-color);
}
