$checkbox-text-gap: $slab-checkbox-height * 1.5 !default;

$icon-rowaction-font-size: 20px;

@mixin ag-header-row() {
  .ag-header-row {
    line-height: $grid-header-line-height;

    .ag-header-cell {
      overflow: hidden;
      color: white;
      border-color: white;
      font-weight: normal;
      text-align: left;
      padding: 0;

      .ag-header-select-all {
        margin-left: 5px;
      }

      .slab-grid-header-context-menu {
        display: flex;
        height: 100%;

        .slab-context-menu {
          height: 100%;
          min-width: $grid-cell-height;
          width: $grid-cell-height;

          .icon-context-menu {
            color: white;
          }
        }

        .slab-grid-header-context-menu-label {
          display: flex;
          flex-direction: column;
          justify-content: center;
          align-items: flex-start;
        }
      }

      .ag-header-cell-label {
        padding: 0 5px;
        flex-direction: column;
        justify-content: center;
        align-items: flex-start;

        > span {
          height: auto;
        }
      }

      .ag-header-cell-resize {
        cursor: ew-resize;
      }
    }
  }
}

@mixin ag-row() {
  .ag-row {

    &.ag-row-focus {
     background-color: scale-color($primary, $alpha: -90%);
    }

    &.ag-row-hover {
      background-color: scale-color($primary, $alpha: -90%);
    }

    &.ag-row-selected {
      background-color: $table-row-selected-background-color;
    }

    &.ag-row-odd :not ag-row-selected {
      background-color: $table-row-odd-background-color;
    }

    &.ag-row-even :not ag-row-selected {
      background-color: $table-row-even-background-color;
    }

    .ag-cell {
      line-height: $grid-cell-height;
      border: none;
      border-right: 1px solid white;
      padding: 0 5px;
      outline-width: 0;

      &.ag-cell-last-left-pinned {
        border-right: 1px solid white;
      }

      &.ag-cell-focus {
        border: 1px dashed scale-color($primary, $alpha: -60%);
      }

      .ag-icon {
        visibility: hidden;
      }

    }

    .ag-cell-inline-editing {
      height: $grid-cell-height;
    }
  }
}

.ag-bl-full-height {
  overflow: hidden;
}

.ag-theme-fresh .ag-root-wrapper {
  border: none !important;
}

.ag-theme-fresh .ag-ltr .ag-root {
  border: none;
  overflow: hidden;
  font: normal $slab-base-body-font-size $slab-base-body-font-family;

  .ag-header {
    border-bottom: none;
    font: normal $slab-base-body-font-size $slab-base-body-font-family;

    .ag-header-viewport, .ag-pinned-left-header {
      background-color: $table-gray;

      .ag-header-container {
        @include ag-header-row()
      }
    }

    .ag-pinned-left-header {
      @include ag-header-row()
    }

  }

  .ag-header-cell, .ag-header-group-cell {
    border-right: 1px solid white;
  }

  .ag-body-viewport {
    //overflow: auto !important;
    @include ag-row()
  }

  .ag-body-horizontal-scroll {
    .ag-horizontal-left-spacer {
      overflow-x: auto;
      border-right: none;
      background-color: #f6f6f6;
    }
  }


}

.height-hidden { //Style for the hidden element to get the proper height from Typescript
  display: none;
  line-height: $grid-cell-height; //Table Row Height
  height: $grid-header-height; //Table Header Height
}

systelab-spinner-cell {
  display: flex;
}

.ag-theme-fresh .ag-row-drag {
  background: none;
  width: 100%;
  position: absolute;
  top: 0;
  left: 0;
}
