/*******************************
   TABULATOR VS CODE THEME
*******************************/

/* Überschreibe Tabulator-Farben für VS Code Dark Theme */
html:not([data-theme]),
html[data-theme="dark"] {
  /* Tabulator Base */
  .tabulator {
    background-color: #1e1e1e;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--bulma-body-color);
  }

  /* Header */
  .tabulator .tabulator-header {
    background-color: #252526;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--bulma-body-color);
    font-weight: normal;
  }

  .tabulator .tabulator-header .tabulator-col {
    background-color: #252526;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
  }

  .tabulator .tabulator-header .tabulator-col.tabulator-sortable:hover {
    background-color: #2d2d2d;
  }

  .tabulator .tabulator-header .tabulator-col .tabulator-col-content {
    color: var(--bulma-body-color);
  }

  .tabulator .tabulator-header .tabulator-col .tabulator-col-sorter .tabulator-arrow {
    border-bottom-color: #808080;
  }

  .tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort="ascending"] .tabulator-arrow,
  .tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort="descending"] .tabulator-arrow {
    border-top-color: var(--bulma-primary)!important;
    border-bottom-color: var(--bulma-primary)!important;
  }

  /* Table Body */
  .tabulator .tabulator-tableholder {
    background-color: #1e1e1e;
  }

  .tabulator .tabulator-tableholder .tabulator-table {
    background-color: #1e1e1e;
    color: var(--bulma-body-color);
  }

  /* Rows */
  .tabulator-row {
    background-color: #1e1e1e;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--bulma-body-color);
  }

  .tabulator-row.tabulator-row-even {
    background-color: #252526;
  }

  .tabulator-row.tabulator-selectable:hover {
    background-color: #2a2d2e !important;
    color: #ffffff !important;
  }

  .tabulator-row.tabulator-selected {
    background-color: #264f78 !important;
    color: #ffffff !important;
  }

  .tabulator-row.tabulator-selected:hover {
    background-color: #2d5a87 !important;
  }

  /* Cells */
  .tabulator-row .tabulator-cell {
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--bulma-body-color);
  }

  .tabulator-row .tabulator-cell.tabulator-editing {
    border: 1px solid var(--bulma-primary);
    background-color: #1e1e1e;
  }

  .tabulator-row .tabulator-cell.tabulator-validation-fail {
    border: 1px solid #f48771;
  }

  .tabulator-row .tabulator-cell.tabulator-row-header {
    background-color: #252526;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  /* Footer */
  .tabulator .tabulator-footer {
    background-color: #252526;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--bulma-body-color);
  }

  .tabulator .tabulator-footer .tabulator-calcs-holder {
    background-color: #2d2d2d !important;
  }

  .tabulator .tabulator-footer .tabulator-page {
    background-color: #2d2d2d;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--bulma-body-color);
  }

  .tabulator .tabulator-footer .tabulator-page:hover {
    background-color: #3e3e42;
    color: #ffffff;
  }

  .tabulator .tabulator-footer .tabulator-page.active {
    background-color: var(--bulma-primary);
    color: #1e1e1e;
  }

  /* Groups */
  .tabulator-row.tabulator-group {
    background-color: #2d2d2d;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }

  .tabulator-row.tabulator-group:hover {
    background-color: #3e3e42;
  }

  .tabulator-row.tabulator-group span {
    color: var(--bulma-primary);
  }

  /* Calcs */
  .tabulator .tabulator-tableholder .tabulator-table .tabulator-row.tabulator-calcs {
    background-color: #2d2d2d !important;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  /* Placeholder */
  .tabulator .tabulator-tableholder .tabulator-placeholder .tabulator-placeholder-contents {
    color: #808080;
  }

  /* Menu/Popup */
  .tabulator-menu,
  .tabulator-edit-select-list,
  .tabulator-popup-container {
    background-color: #252526;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--bulma-body-color);
  }

  .tabulator-menu .tabulator-menu-item:hover,
  .tabulator-edit-select-list .tabulator-edit-select-list-item:hover {
    background-color: #2a2d2e;
  }

  .tabulator-edit-select-list .tabulator-edit-select-list-item.active {
    background-color: #264f78;
    color: #ffffff;
  }

  /* Range Selection */
  .tabulator .tabulator-tableholder .tabulator-range-overlay .tabulator-range {
    border-color: var(--bulma-primary);
  }

  .tabulator .tabulator-tableholder .tabulator-range-overlay .tabulator-range.tabulator-range-active::after {
    background-color: var(--bulma-primary);
  }

  .tabulator-row .tabulator-cell.tabulator-range-selected:not(.tabulator-range-only-cell-selected) {
    background-color: #264f78;
  }

  /* Header Range Selection */
  .tabulator .tabulator-header .tabulator-col.tabulator-range-selected {
    background-color: #264f78;
    color: #ffffff;
  }

  /* Status Colors (VS Code Theme) */
  .tabulator .tabulator-tableholder .tabulator-table .tabulator-row.positive,
  .tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.positive {
    background-color: rgba(115, 201, 144, 0.15) !important;
    color: #73c990 !important;
  }

  .tabulator .tabulator-tableholder .tabulator-table .tabulator-row.positive:hover,
  .tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.positive:hover {
    background-color: rgba(115, 201, 144, 0.25) !important;
  }

  .tabulator .tabulator-tableholder .tabulator-table .tabulator-row.negative,
  .tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.negative,
  .tabulator .tabulator-tableholder .tabulator-table .tabulator-row.error,
  .tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.error {
    background-color: rgba(244, 135, 113, 0.15) !important;
    color: #f48771 !important;
  }

  .tabulator .tabulator-tableholder .tabulator-table .tabulator-row.negative:hover,
  .tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.negative:hover,
  .tabulator .tabulator-tableholder .tabulator-table .tabulator-row.error:hover,
  .tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.error:hover {
    background-color: rgba(244, 135, 113, 0.25) !important;
  }

  .tabulator .tabulator-tableholder .tabulator-table .tabulator-row.warning,
  .tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.warning {
    background-color: rgba(206, 145, 120, 0.15) !important;
    color: #ce9178 !important;
  }

  .tabulator .tabulator-tableholder .tabulator-table .tabulator-row.warning:hover,
  .tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.warning:hover {
    background-color: rgba(206, 145, 120, 0.25) !important;
  }

  /* Frozen Columns */
  .tabulator .tabulator-header .tabulator-frozen.tabulator-frozen-left,
  .tabulator-row .tabulator-cell.tabulator-frozen.tabulator-frozen-left {
    border-right: 2px solid rgba(255, 255, 255, 0.15);
  }

  .tabulator .tabulator-header .tabulator-frozen.tabulator-frozen-right,
  .tabulator-row .tabulator-cell.tabulator-frozen.tabulator-frozen-right {
    border-left: 2px solid rgba(255, 255, 255, 0.15);
  }

  /* Data Tree */
  .tabulator-row .tabulator-cell .tabulator-data-tree-branch {
    border-left-color: rgba(255, 255, 255, 0.15);
    border-bottom-color: rgba(255, 255, 255, 0.15);
  }

  .tabulator-row .tabulator-cell .tabulator-data-tree-control {
    border-color: #808080;
    background-color: rgba(255, 255, 255, 0.05);
  }

  .tabulator-row .tabulator-cell .tabulator-data-tree-control:hover {
    background-color: rgba(255, 255, 255, 0.1);
  }

  .tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-collapse:after,
  .tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-expand,
  .tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-expand:after {
    background-color: var(--bulma-body-color);
  }

  /* Resize Handles */
  .tabulator .tabulator-col-resize-guide,
  .tabulator .tabulator-row-resize-guide {
    background-color: var(--bulma-primary);
  }
}

/* VS Code Light Theme für Tabulator */
html[data-theme="light"] {
  /* Tabulator Base */
  .tabulator {
    background-color: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: #1e1e1e;
  }

  /* Header */
  .tabulator .tabulator-header {
    background-color: #f3f3f3;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    color: #1e1e1e;
  }

  .tabulator .tabulator-header .tabulator-col {
    background-color: #f3f3f3;
    border-right: 1px solid rgba(0, 0, 0, 0.08);
  }

  .tabulator .tabulator-header .tabulator-col.tabulator-sortable:hover {
    background-color: #e1e1e1;
  }

  .tabulator .tabulator-header .tabulator-col .tabulator-col-sorter .tabulator-arrow {
    border-bottom-color: #6f6f6f;
  }

  .tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort="ascending"] .tabulator-arrow,
  .tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort="descending"] .tabulator-arrow {
    border-color: #007acc;
  }

  /* Table Body */
  .tabulator .tabulator-tableholder {
    background-color: #ffffff;
  }

  .tabulator .tabulator-tableholder .tabulator-table {
    background-color: #ffffff;
    color: #1e1e1e;
  }

  /* Rows */
  .tabulator-row {
    background-color: #ffffff;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    color: #1e1e1e;
  }

  .tabulator-row.tabulator-row-even {
    background-color: #f3f3f3;
  }

  .tabulator-row.tabulator-selectable:hover {
    background-color: #e1e1e1 !important;
    color: #1e1e1e !important;
  }

  .tabulator-row.tabulator-selected {
    background-color: #cce5ff !important;
    color: #1e1e1e !important;
  }

  .tabulator-row.tabulator-selected:hover {
    background-color: #b3d9ff !important;
  }

  /* Cells */
  .tabulator-row .tabulator-cell {
    border-right: 1px solid rgba(0, 0, 0, 0.08);
    color: #1e1e1e;
  }

  .tabulator-row .tabulator-cell.tabulator-editing {
    border: 1px solid #007acc;
    background-color: #ffffff;
  }

  .tabulator-row .tabulator-cell.tabulator-validation-fail {
    border: 1px solid #e51400;
  }

  .tabulator-row .tabulator-cell.tabulator-row-header {
    background-color: #f3f3f3;
    border-right: 1px solid rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  }

  /* Footer */
  .tabulator .tabulator-footer {
    background-color: #f3f3f3;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    color: #1e1e1e;
  }

  .tabulator .tabulator-footer .tabulator-calcs-holder {
    background-color: #eaeaea !important;
  }

  .tabulator .tabulator-footer .tabulator-page {
    background-color: #eaeaea;
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: #1e1e1e;
  }

  .tabulator .tabulator-footer .tabulator-page:hover {
    background-color: var(--bulma-body-color);
    color: #1e1e1e;
  }

  .tabulator .tabulator-footer .tabulator-page.active {
    background-color: #007acc;
    color: #ffffff;
  }

  /* Groups */
  .tabulator-row.tabulator-group {
    background-color: #eaeaea;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
  }

  .tabulator-row.tabulator-group:hover {
    background-color: var(--bulma-body-color);
  }

  .tabulator-row.tabulator-group span {
    color: #007acc;
  }

  /* Calcs */
  .tabulator .tabulator-tableholder .tabulator-table .tabulator-row.tabulator-calcs {
    background-color: #eaeaea !important;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  }

  /* Placeholder */
  .tabulator .tabulator-tableholder .tabulator-placeholder .tabulator-placeholder-contents {
    color: #6f6f6f;
  }

  /* Menu/Popup */
  .tabulator-menu,
  .tabulator-edit-select-list,
  .tabulator-popup-container {
    background-color: #f3f3f3;
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: #1e1e1e;
  }

  .tabulator-menu .tabulator-menu-item:hover,
  .tabulator-edit-select-list .tabulator-edit-select-list-item:hover {
    background-color: #e1e1e1;
  }

  .tabulator-edit-select-list .tabulator-edit-select-list-item.active {
    background-color: #cce5ff;
    color: #1e1e1e;
  }

  /* Range Selection */
  .tabulator .tabulator-tableholder .tabulator-range-overlay .tabulator-range {
    border-color: #007acc;
  }

  .tabulator .tabulator-tableholder .tabulator-range-overlay .tabulator-range.tabulator-range-active::after {
    background-color: #007acc;
  }

  .tabulator-row .tabulator-cell.tabulator-range-selected:not(.tabulator-range-only-cell-selected) {
    background-color: #cce5ff;
  }

  /* Header Range Selection */
  .tabulator .tabulator-header .tabulator-col.tabulator-range-selected {
    background-color: #cce5ff;
    color: #1e1e1e;
  }

  /* Status Colors (VS Code Light Theme) */
  .tabulator .tabulator-tableholder .tabulator-table .tabulator-row.positive,
  .tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.positive {
    background-color: rgba(55, 140, 75, 0.15) !important;
    color: #2d7a3e !important;
  }

  .tabulator .tabulator-tableholder .tabulator-table .tabulator-row.positive:hover,
  .tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.positive:hover {
    background-color: rgba(55, 140, 75, 0.25) !important;
  }

  .tabulator .tabulator-tableholder .tabulator-table .tabulator-row.negative,
  .tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.negative,
  .tabulator .tabulator-tableholder .tabulator-table .tabulator-row.error,
  .tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.error {
    background-color: rgba(229, 20, 0, 0.15) !important;
    color: #cd3131 !important;
  }

  .tabulator .tabulator-tableholder .tabulator-table .tabulator-row.negative:hover,
  .tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.negative:hover,
  .tabulator .tabulator-tableholder .tabulator-table .tabulator-row.error:hover,
  .tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.error:hover {
    background-color: rgba(229, 20, 0, 0.25) !important;
  }

  .tabulator .tabulator-tableholder .tabulator-table .tabulator-row.warning,
  .tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.warning {
    background-color: rgba(218, 121, 0, 0.15) !important;
    color: #bf6e00 !important;
  }

  .tabulator .tabulator-tableholder .tabulator-table .tabulator-row.warning:hover,
  .tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.warning:hover {
    background-color: rgba(218, 121, 0, 0.25) !important;
  }

  /* Frozen Columns */
  .tabulator .tabulator-header .tabulator-frozen.tabulator-frozen-left,
  .tabulator-row .tabulator-cell.tabulator-frozen.tabulator-frozen-left {
    border-right: 2px solid rgba(0, 0, 0, 0.15);
  }

  .tabulator .tabulator-header .tabulator-frozen.tabulator-frozen-right,
  .tabulator-row .tabulator-cell.tabulator-frozen.tabulator-frozen-right {
    border-left: 2px solid rgba(0, 0, 0, 0.15);
  }

  /* Data Tree */
  .tabulator-row .tabulator-cell .tabulator-data-tree-branch {
    border-left-color: rgba(0, 0, 0, 0.15);
    border-bottom-color: rgba(0, 0, 0, 0.15);
  }

  .tabulator-row .tabulator-cell .tabulator-data-tree-control {
    border-color: #6f6f6f;
    background-color: rgba(0, 0, 0, 0.05);
  }

  .tabulator-row .tabulator-cell .tabulator-data-tree-control:hover {
    background-color: rgba(0, 0, 0, 0.1);
  }

  .tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-collapse:after,
  .tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-expand,
  .tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-expand:after {
    background-color: #1e1e1e;
  }

  /* Resize Handles */
  .tabulator .tabulator-col-resize-guide,
  .tabulator .tabulator-row-resize-guide {
    background-color: #007acc;
  }
}