// todo-ss: Fix variable names and find common variable names for both light nad dark themes
@import './partials/variables/_dark-variables';

.Sticky-React-Table {

  &,
  * {
    box-sizing: border-box;
  }

  &--Header {
    background: darken($gray-lighter, 11.6%);
    color: $white;
    flex-shrink: 0;
    user-select: none;
    border-bottom: 1px solid rgba($gray-lightest, 0.15);
    cursor: pointer;

    &-Cell {
      display: flex;
      align-self: stretch;
      align-items: center;
      flex-shrink: 0;
      position: relative;
      word-wrap: break-word;
      background: inherit;
      font-weight: normal;
      padding: 3px 10px;
      z-index: 0;
    }

    &-Column-Switcher {
      color: $white;

      &-Icon {
        border-radius: 3px;
        position: relative;
        padding: 3px 10px;
        font-weight: bold;
        background: $gray;
        color: $gray-lighter;
        border: 1px solid rgba($gray-lightest, 0.25);
        cursor: pointer;
      }

      &-Dropdown {
        position: absolute;
        bottom: 0;
        right: 6px;
        padding: 10px;
        max-height: 300px;
        min-width: 200px;
        background: $dark;
        overflow: auto;
        transform: translate(0, 100%);
        box-shadow: 0 2px 5px 1px rgba($gray-lightest, 0.15);
        border: 1px solid rgba($gray-lightest, 0.15);
      }

      &-Item label {
        cursor: pointer;
      }
    }
  }

  &-Sort-Icon {
    margin-left: 5px;
  }

  &--Row {
    background: $dark;
    border-bottom: 1px solid rgba($gray-lightest, 0.1);
    color: lighten($gray-lightest, 30.5%);
    cursor: pointer;

    &:nth-child(odd) {
      background: darken($dark, 5%);
    }

    &:hover {
      background-color: $interaction;
    }

    &-Cell {
      display: flex;
      flex-shrink: 0;
      align-items: center;
      position: relative;
      padding: 3px 10px;
      word-wrap: break-word;

      &:focus {
        box-shadow: inset 0 0 0 2px darken($interaction, 17.5%);
        outline: 0;
      }
    }

    &.Sticky-React-Table--Row--is-Checked {
      background: lighten($interaction, 5%);
    }
  }

  &--Row-Cell,
  &--Header-Cell {
    border-right: 1px solid rgba($gray-lightest, 0.15);

    &:hover .Sticky-React-Table-Resize-Handler {
      background: rgba($gray-lightest, 0.5);
    }

    &-Checkbox {
      border: 2px solid transparent;
      text-align: center;

      &:focus {
        border: 2px solid transparent;
      }
    }
  }

  &--Header-Cell-Checkbox {
    display: block;
  }

  &--is-Sticky {
    &--is-Last {
      border-right: 2px solid $gray-light;
    }
  }

  &-Resize-Handler {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 5px;
    background: transparent;
    cursor: col-resize;
    z-index: 11;
    opacity: 1;
  }

  &-Global-Resize-Handler {
    position: absolute;
    top: 0;
    bottom: 0;
    z-index: 13;
    width: 3px;
    left: 200px;
    background: rgba($dark, 0.15);
  }
}
