@use "../../../styles/abstracts/variables" as *;

.trans {
  &__toolbar {
    padding-bottom: 1.5rem;

    form {
      display: flex;
      align-items: center;
      justify-content: space-between;

      @media only screen and (max-width: 1000px) {
        flex-direction: column;
        align-items: flex-start;
      }
    }

    &--search {
      background: transparent;
      border: 1px solid $col-border-lining;
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 0.7rem 1rem;
      border-radius: 6px;
      color: #040a17;
      width: 22rem;
      font-size: 0.9rem;
      font-weight: 500;
      transition: border-color 0.2s ease, box-shadow 0.2s ease;

      @media only screen and (max-width: 1000px) {
        margin-bottom: 1rem;
        width: 100%;
      }

      &:focus-within {
        border-color: $col-purple;
        outline: 2px solid $col-purple;
        outline-offset: 2px;
      }

      input {
        background: transparent;
        border: none;
        outline: none;
        color: #040a17;
        opacity: 1 !important;
        width: 100%;
      }
    }

    &--helpers {
      display: flex;
      align-items: center;
      gap: 10px;

      @media only screen and (max-width: 1000px) {
        flex-wrap: wrap;
        align-items: flex-start;
        margin-top: 1rem;
      }

      &--refresh,
      &--date {
        background: transparent;
        border: 1px solid $col-border-lining;
        color: #040a17;
        padding: 0.7rem 1rem;
        border-radius: 6px;
        display: flex;
        align-items: center;
        gap: 10px;
        font-weight: 500;
        font-size: 0.85rem;
        cursor: pointer;
        transition: all ease-in-out 0.4s;

        &:hover {
          background: $col-purple;
          color: #fff;
        }
      }

      /* ✅ Filter Dropdown */
      &--filter {
        border: 1px solid $col-border-lining;
        padding: 0.7rem 1rem;
        border-radius: 6px;
        font-weight: 500;
        font-size: 0.85rem;
        background: #fff;
        color: #040a17;
        cursor: pointer;
        transition: border-color 0.3s ease;

        &:focus {
          border-color: $col-purple;
          outline: none;
        }
      }
    }
  }

  &__table {
    border: 1px solid $col-border-lining;
    border-radius: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    width: 100%;
    display: block;
    -webkit-overflow-scrolling: touch;

    &--header {
      background: $col-active-btn-bg;
      border-bottom: 1px solid $col-border-lining;
      display: grid;
      grid-template-columns: 1.7fr 2.7fr 1fr 1fr 1fr 1fr;
      padding: 1rem;
      min-width: 750px;

      span {
        color: $col-primary-text;
        font-weight: 600;
        font-size: 0.85rem;
        white-space: nowrap;
      }

      @media only screen and (max-width: 1000px) {
        grid-template-columns: 1.7fr 2.7fr 1fr 1fr 1fr 1fr;
      }
    }

    &--children {
      font-weight: 500;
      display: flex;
      flex-direction: column;
      width: 100%;
      min-width: 750px;
    }
  }
}

/* Skeleton Loader */
.skeleton__wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.5rem 1rem;
}

.skeleton__row {
  display: grid;
  grid-template-columns: 1.7fr 1.7fr 2.6fr 1fr 1fr;
  align-items: center;
  height: 2rem;
  gap: 1rem;
  padding: 0 0.5rem;
}

.skeleton__cell {
  height: 1.2rem;
  border-radius: 6px;
  background: linear-gradient(90deg, #e0e0e0 25%, #f5f5f5 50%, #e0e0e0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

/* Animations */
.fadeIn {
  animation: fadeIn 0.4s ease forwards;
}

.fadeOut {
  animation: fadeOut 0.4s ease forwards;
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}
