$primary-color: #5abac6;
$secondary-color: #86e49d;
$error-color: #dd3333;
$info-color: #ebc474;
$white-color: #ffffff;
$background-color: #fff5;
$text-color: #0004;
$highlight-color: #fff6;
$icon-size: 1.2rem;
$border-radius: 2rem;
$box-shadow: 0 0.4rem 0.8rem #0005;
$transition-speed: 0.2s;

@media print {
  .table,
  .table__body {
    overflow: visible;
    height: auto !important;
    width: auto !important;
  }
}

// Wrapper Styles
.wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 100px;
}

// Table Styles
main.table {
  width: 82vw;
  height: 90vh;
  background-color: $background-color;
  backdrop-filter: blur(7px);
  box-shadow: $box-shadow;
  border-radius: 0.8rem;
  overflow: hidden;
}

.table__header {
  width: 100%;
  height: 10%;
  background-color: #fff4;
  padding: 0.8rem 1rem;
  display: flex;
  justify-content: space-evenly;
  align-items: center;

  .input-group {
    width: 35%;
    height: 100%;
    background-color: $background-color;
    padding: 0 0.8rem;
    border-radius: $border-radius;
    border: 1px solid $primary-color;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: $transition-speed;
    cursor: pointer;

    &:hover {
      width: 45%;
      background-color: #fff8;
      box-shadow: 0 0.1rem 0.4rem $text-color;
    }

    img {
      width: $icon-size;
      height: $icon-size;
    }

    input {
      width: 100%;
      padding: 0 0.5rem 0 0.3rem;
      background-color: transparent;
      border: none;
      outline: none;
    }
  }
}

.table__body {
  width: 95%;
  max-height: calc(89% - 1.6rem);
  background-color: #fffb;
  margin: 0.8rem auto;
  border-radius: 0.6rem;
  overflow: auto;
  overflow: overlay;

  ::-webkit-scrollbar {
    width: 0.5rem;
    height: 0.5rem;
  }

  ::-webkit-scrollbar-thumb {
    border-radius: 0.5rem;
    background-color: $text-color;
    visibility: hidden;
  }

  &:hover::-webkit-scrollbar-thumb {
    visibility: visible;
  }
}

table {
  width: 100%;

  td img {
    width: 36px;
    height: 36px;
    margin-right: 0.5rem;
    border-radius: 50%;
    vertical-align: middle;
  }

  th,
  td {
    padding: 1rem;
    text-align: center;
  }

  thead th {
    position: sticky;
    top: 0;
    left: 0;
    background-color: #fff;
    text-transform: capitalize;

    .icon {
      display: flex;
      justify-content: center;
      align-items: center;
      gap: 5px;
    }

    &:hover {
      color: $primary-color;
    }

    &.active {
      color: $primary-color;

      .icon {
        background-color: $primary-color;
        color: #fff;
      }

      &.asc .icon {
        transform: rotate(180deg);
      }
    }
  }

  tbody tr:nth-child(even) {
    background-color: #0000000b;
  }

  tbody tr {
    --delay: 0.1s;
    transition: 0.5s ease-in-out var(--delay), background-color 0s;

    &.hide {
      opacity: 0;
      transform: translateX(100%);

      td,
      p {
        padding: 0;
        font: 0 / 0 sans-serif;
      }

      img {
        width: 0;
        height: 0;
      }
    }

    &:hover {
      background-color: $highlight-color !important;
    }

    td,
    p,
    img {
      transition: 0.2s ease-in-out;
    }
  }
}

// Status Styling
.status {
  padding: 0.4rem 0;
  border-radius: $border-radius;
  text-align: center;

  &.approve {
    background-color: $secondary-color;
    color: $white-color;
  }

  &.cancell {
    background-color: $error-color;
    color: $white-color;
    cursor: pointer;
  }
}

// Buttons Styling
::ng-deep .btn {
  padding: 10px 20px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;

  &.btn-success {
    background-color: #28a745;
    color: $white-color;
  }

  &.btn-danger {
    background-color: $error-color;
    color: $white-color;
  }
}

// SweetAlert Button Gap
::ng-deep .swal2-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
