/*
 * Copyright (c) 2010, 2023 BSI Business Systems Integration AG
 *
 * This program and the accompanying materials are made
 * available under the terms of the Eclipse Public License 2.0
 * which is available at https://www.eclipse.org/legal/epl-2.0/
 *
 * SPDX-License-Identifier: EPL-2.0
 */
.cell-editor-popup {
  /* make sure it is behind the scrollbar but above selection */
  z-index: 1;
}

.cell-editor-field {
  --padding-top: var(--table-row-padding-y) - @item-selection-border-width;
  --padding-bottom: var(--table-row-padding-y) - @item-selection-border-width;
  padding: calc(var(--padding-top)) @table-cell-padding-right - @item-selection-border-width calc(var(--padding-bottom)) @table-cell-padding-left - @item-selection-border-width;
  border-width: @item-selection-border-width;
  background-color: @cell-editor-background-color;

  .cell-editor-popup.overflow-top & {
    --padding-top: var(--table-row-padding-y) - @item-selection-border-width + 1px; // cell editor is moved up by 1px
    --padding-bottom: var(--table-row-padding-y) - @item-selection-border-width + 1px; // bottom row has 1px border
  }

  .cell-editor-popup.overflow-bottom & {
    --padding-bottom: var(--table-row-padding-y) - @item-selection-border-width + 2px; // bottom row has 1px border and cell editor is moved down by 1px
  }

  &:focus,
  &.focused {
    border-color: @item-selection-border-color;
    box-shadow: none;

    &.has-error {
      border-color: @error-border-color;
      box-shadow: none;
    }
  }
}
