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

.programs {
  border: 1px solid $col-border-lining;
  border-radius: 10px;
  padding: 1.5rem;

  &--text {
    color: $col-dark-text;
    padding-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;

    h2 {
      font-size: 1.2rem;
      font-weight: 500;
      color: $col-dark-text;
    }

    p {
      font-size: 0.9rem;
      font-weight: 500;
      color: #627081;
      padding-bottom: 1rem;
    }

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

    button {
      background: $col-purple;
      color: #fff;
      border: none;
      border-radius: 6px;
      padding: 0.6rem 1.2rem;
      font-weight: 600;
      cursor: pointer;
      display: flex;
      align-items: center;
      gap: 0.4rem;
      transition: background 0.3s ease;
      font-size: 0.9rem;
  
    }
  }

  &--programs {
    max-width: 100%;

    &--pagination{
      // background: red;
      display: flex;
      justify-content: center;
      align-items: center;
    }

    &--table {
      background: $col-active-btn-bg;
      border-bottom: 1px solid $col-border-lining;
      display: grid;
      grid-template-columns: 1fr 1fr 1.4fr 1.4fr 1fr;
      margin-bottom: 1rem;
      color: $col-dark-text;
      padding: 1rem;
      font-weight: 600;
      border-top-left-radius: 8px;
      border-top-right-radius: 8px;

      @media (max-width: 768px) {
        display: none; // hide header row on mobile
      }
    }

    &--children {
      margin-bottom: 2rem;
      @media (max-width: 768px){
        margin-bottom: 0rem;
      }

      > div {
        display: grid;
        grid-template-columns: 1fr 1fr 1.4fr 1.4fr 1fr;
        align-items: center;
        padding: 0 1rem;
        padding-bottom: 0;
        border-bottom: 1px solid $col-border-lining;
        color: $col-dark-text;
        transition: background 0.3s ease;
        padding-bottom: .5rem;
        padding-top: .5rem;

        &:nth-child(even) {
          background: rgba($col-border-lining, 0.3);
        }

        &:hover {
          background: rgba($col-purple, 0.1);
        }

        @media (max-width: 768px) {
          display: flex;
          flex-direction: column;
          align-items: flex-start;
          gap: 10px;
          padding: 1rem;
          border: 1px solid $col-border-lining;
          border-radius: 8px;
          margin-bottom: 1rem;
          background: #fff;

          span {
            width: 100%;
            text-align: left;
          }
        }
      }
    }
  }

  /* ------------------------------
      🟣 Skeleton Loader Styles
  ------------------------------ */
  .skeleton-row {
    display: grid;
    grid-template-columns: 1.2fr 2fr 1fr;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid $col-border-lining;
  }

  .skeleton-name,
  .skeleton-desc,
  .skeleton-action {
    height: 18px;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
    background: #e0e0e0; // Base background color
  }

  .skeleton-name::after,
  .skeleton-desc::after,
  .skeleton-action::after {
    content: "";
    position: absolute;
    top: 0;
    left: -150%;
    height: 100%;
    width: 150%;
    background: linear-gradient(
      90deg,
      rgba(255, 255, 255, 0) 0%,
      rgba(255, 255, 255, 0.6) 50%,
      rgba(255, 255, 255, 0) 100%
    );
    animation: shimmer 1.5s infinite;
  }

  .skeleton-name {
    width: 80%;
  }

  .skeleton-desc {
    width: 90%;
  }

  .skeleton-action {
    width: 50%;
  }

  @keyframes shimmer {
    0% {
      left: -150%;
    }
    100% {
      left: 150%;
    }
  }
}
