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

.attend {
  &__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;
      gap: 10px;
      @media only screen and (max-width: 1000px){
        align-items: flex-start;
      }

      &--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;
      }

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

  &__table {
    border: 1px solid $col-border-lining;
    border-radius: 10px;
    overflow-x: auto; // ✅ enable horizontal scroll
    overflow-y: hidden;
    width: 100%;
    display: block; // ✅ prevent grid collapsing during scroll
    -webkit-overflow-scrolling: touch; // ✅ smooth scrolling on iOS

    &--header {
      background: $col-active-btn-bg;
      border-bottom: 1px solid $col-border-lining;
      display: grid;
      grid-template-columns: 1.7fr 1.7fr 2.6fr 1fr 1fr;
      padding: 1rem;
      min-width: 750px; // ✅ ensure consistent column width when scrolling
      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: 2fr 1.7fr 2.6fr 1fr 1fr;
      }
    }

    &--children {
      font-weight: 500;
      display: flex;
      flex-direction: column;
      width: 100%;
      min-width: 750px; // ✅ match header width for alignment
    }
  }
}

/* ======================
   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; // match line-height of real rows
  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;
}

/* ======================
   Fade Transitions
====================== */
.fadeIn {
  animation: fadeIn 0.4s ease forwards;
}

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

/* ======================
   Keyframes
====================== */
@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;
  }
}
