.lea-table {
  float: left;
  width: 100%;
  overflow: auto;
  height: 300px;
  table {
    padding: 0;
    width: 100%;
    float: left;
    border-collapse: collapse;
    th {
      font-size: 0.8rem;
      color: $accent;
      text-align: left;
      transition: 0.2s;
      background-color: $white;
      transition: 0.5s;
      padding: 0;
      min-width: 10rem;
      .th-container {
        position: relative;
        float: left;
        width: 100%;
        border-bottom: $border-table-header;
        padding: 0.5rem 1rem;
        box-sizing: border-box;
      }
      span {
        float: left;
      }
      .sort {
        opacity: 0;
        transition: 0.2s;
        border: none;
        outline: none;
        background: transparent;
        width: 1rem;
        float: right;
        position: relative;
        cursor: pointer;
        .lea-icon {
          color: $accent;
          font-size: 0.6rem;
          &.inactive-sort {
            color: lighten($color: $accent, $amount: 50%);
          }
        }
        .icon-arrow_up {
          position: absolute;
        }
        .icon-arrow_down {
          margin-top: 0.5rem;
        }
      }
      .hide {
        opacity: 0;
        transition: 0.2s;
        border: none;
        outline: none;
        background: transparent;
        width: 1rem;
        float: left;
        position: relative;
        cursor: pointer;
        .lea-icon {
          color: $accent;
        }
      }

      &:hover {
        .sort,
        .hide {
          opacity: 1;
          transition: 0.2s;
        }
      }
    }
    tbody {
      box-sizing: border-box;
      font-size: 0.9rem;
      color: $dark-grey;
      transition: 0.2s;
      td {
        padding: 0;
        border: 0;
        min-width: 10rem;
      }
      .td-container {
        padding: 1rem;
        border-bottom: $border-table-body;
      }

      tr {
        &:last-of-type {
          td {
            .td-container {
              border-bottom: 0;
            }
          }
        }
      }
    }
    tfoot {
      box-sizing: border-box;
      font-size: 0.9rem;
      color: $dark-grey;
      transition: 0.2s;
      td {
        padding: 0;
        border: 0;
        font-weight: bold;
        min-width: 10rem;
      }
      .tf-container {
        padding: 1rem;
        border-top: $border-table-body;
      }
    }
    .hidden {
      width: 2px;
      border-left: 1px solid $accent;
      border-right: 1px solid $accent;
      padding: 0;
      cursor: pointer;
      border-bottom: 0;
      transition: 0.2s;
      .th-container {
        border-bottom: 0;
        padding: 0;
      }
      .tf-container {
        border-top: 0;
        padding: 0;
      }
      span {
        width: 0;
        display: none;
      }
      .sort,
      .hide {
        display: none;
      }
    }

    &.sticky-header {
      th {
        top: 0px;
        position: sticky;
        z-index: 100;
      }
    }
    &.sticky-footer {
      tfoot {
        td {
          bottom: 0px;
          position: sticky;
          z-index: 10;
          background-color: $white;
          transition: 0.5s;
          bottom: -1px;
        }
      }
    }
    &.sticky-start {
      th {
        &:first-of-type {
          left: 0px;
          position: sticky;
          z-index: 1000;
          background-color: $white;
          transition: 0.5s;
          .th-container {
            border-right: $border-table-body;
          }
        }
        &:last-of-type {
          right: 0px;
          position: sticky;
          z-index: 1000;
          background-color: $white;
          transition: 0.5s;
          .th-container {
            border-left: $border-table-body;
          }
        }
      }
      tbody {
        tr {
          td {
            &:first-of-type {
              left: 0px;
              position: sticky;
              z-index: 1;
              background-color: $white;
              transition: 0.5s;
              .td-container {
                border-right: $border-table-body;
              }
            }
            &:last-of-type {
              right: 0px;
              position: sticky;
              z-index: 1;
              background-color: $white;
              transition: 0.5s;
              .td-container {
                border-left: $border-table-body;
              }
            }
          }
        }
      }
      tfoot {
        tr {
          td {
            &:first-of-type {
              left: 0px;
              position: sticky;
              z-index: 100;
              background-color: $white;
              transition: 0.5s;
              .tf-container {
                border-right: $border-table-body;
              }
            }
            &:last-of-type {
              right: 0px;
              position: sticky;
              z-index: 100;
              background-color: $white;
              transition: 0.5s;
              .tf-container {
                border-left: $border-table-body;
              }
            }
          }
        }
      }
    }
  }
}

.dark-mode {
  .lea-table {
    table {
      th {
        background-color: $darkmode-bg;
        transition: 0.5s;
      }
      &.sticky-footer {
        tfoot {
          td {
            background-color: $darkmode-bg;
            transition: 0.5s;
          }
        }
      }
      &.sticky-start {
        th {
          &:first-of-type {
            background-color: $darkmode-bg;
            transition: 0.5s;
          }
          &:last-of-type {
            background-color: $darkmode-bg;
            transition: 0.5s;
          }
        }
        tbody {
          tr {
            td {
              &:first-of-type {
                background-color: $darkmode-bg;
                transition: 0.5s;
              }
              &:last-of-type {
                background-color: $darkmode-bg;
                transition: 0.5s;
              }
            }
          }
        }
        tfoot {
          tr {
            td {
              &:first-of-type {
                background-color: $darkmode-bg;
                transition: 0.5s;
              }
              &:last-of-type {
                background-color: $darkmode-bg;
                transition: 0.5s;
              }
            }
          }
        }
      }
    }
  }
}
