/*
 * Copyright (c) 2010, 2025 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
 */
.table-footer {
  position: absolute;
  bottom: 0;
  min-height: @table-footer-height;
  width: 100%;
  white-space: nowrap;
  border-top: 1px solid @border-color;
  background-color: @table-footer-background-color;
}

.table-control-resize {
  position: absolute;
  width: 100%;
  left: 0;
  height: 16px;
  cursor: row-resize;
  z-index: 2;
  border-top: @table-control-resize-border-width solid @table-control-resize-border-color;
}

.table-control-container {
  position: absolute;
  overflow: hidden;
  outline: none;
  background-color: @table-control-container-background-color;
  bottom: @table-footer-height;
  width: 100%;

  /* Default value for TableControl.js */
  height: @table-control-container-height;

  &.dense {
    height: @table-control-container-height-dense;
  }

  display: none;
  z-index: 2; // Must not be smaller than z-index of scrollbar, see Table.less
  /* Reset nowrap, forms may have fields which need wrapping (e.g. label field) */
  white-space: normal;

  &:not(.has-resizer) {
    border-top: 2px solid @border-color;
  }
}

.table-control-content {
  height: 100%;
  width: 100%;

  & > .form {
    background-color: @table-control-container-background-color;

    & > .root-group-box {

      & > .group-box-body {
        /* to make sure fields are not drawn over the menubar when making table control container very small */
        overflow: hidden;
      }

      & > .main-menubar {
        #scout.main-menubar-light;
        border-color: transparent;
      }
    }
  }
}

.table-controls {
  position: absolute;
  height: 100%;
  margin-left: @bench-padding-x;
  display: flex;
  align-items: center;
}

.table-info {
  position: absolute;
  right: 0;
  display: inline-flex;
  align-items: center;
  height: 100%;
  margin-right: @bench-padding-x - @table-info-margin-x;
}

.table-filter {
  position: relative;
  margin-right: @table-info-margin-x;
}

.table-text-filter {
  min-height: @table-footer-text-filter-height;
  width: @table-footer-text-filter-width;
  font-size: 13px;

  &:focus {
    &.has-text {
      padding-right: @text-field-padding-x + 15px;

      & ~ .clear-icon {
        display: flex;
      }
    }
  }

  & ~ .clear-icon {
    display: none;
    position: absolute;
    right: 0;
    top: 0;
    min-height: @table-footer-text-filter-height;
  }
}

.table-info-item.hiding {
  visibility: hidden;
}

.table-info-item {
  flex-shrink: 0;
  flex-grow: 0;
  color: @table-info-color;
  cursor: pointer;
  line-height: 19px;
  font-size: @font-size-smaller;
  #scout.overflow-nowrap();
  margin: 0 @table-info-margin-x - @table-info-inner-margin-x;
  transition: margin 300ms;

  & > span {
    display: block;
    margin: 0 @table-info-inner-margin-x;
  }

  &.disabled {
    cursor: default;

    &:is(:hover, :active) > .table-info-button,
    & > .table-info-button {
      color: @table-info-color;
    }
  }

  & > .table-info-button {
    color: @link-color;

    & > .key-box {
      bottom: 2px;
    }
  }

  &:hover > .table-info-button {
    color: @link-hover-color;
  }

  &:active > .table-info-button {
    color: @link-active-color;
  }

  &:focus {
    #scout.focus-box-shadow();
    border-radius: @border-radius;
  }
}

.table-info-status {
  color: @table-info-color;
  margin: 0 @table-info-inner-margin-x;

  &:hover {
    color: @table-info-hover-color;
  }

  /* normal */

  & > .font-icon {
    display: inline-block;
    line-height: normal;
    vertical-align: middle;
    padding: 8px 0;
    margin: 0 @table-info-margin-x - @table-info-inner-margin-x;

    &::before {
      content: @icon-info;
      #scout.font-icon();
      font-size: 22px;
    }
  }

  /* error */

  &.error > .font-icon::before {
    content: @icon-exclamation-mark-circle;
  }

  &.error.tooltip-active {
    color: @table-info-error-color;
  }

  &.error.tooltip-active:hover {
    color: @table-info-error-hover-color;
  }

  /* warning */

  &.warning > .font-icon::before {
    content: @icon-exclamation-mark-circle;
  }

  &.warning.tooltip-active {
    color: @table-info-warning-color;
  }

  &.warning.tooltip-active:hover {
    color: @table-info-warning-hover-color;
  }
}
