@use "../../../../styles/abstracts/variables";
@use "../../../../styles/abstracts/mixins";  

.invests {
  @include mixins.adminPageIntro;
  margin-top: 1.2rem;
  width: 100%;
  overflow-x: hidden;

  @media only screen and (max-width: 1000px) {
    margin-top: -0.5rem;
  }

  // ==== Tab Navigation ====
  &__tab {
    background: variables.$col-active-btn-bg;
    border-radius: 6px;
    display: flex;
    gap: 30px;
    padding: 0.5rem 0.7rem;
    align-items: center;
    font-size: 0.85rem;
    overflow-x: auto;
    white-space: nowrap;
    color: variables.$col-active-btn-color;

    @media only screen and (max-width: 1000px) {
      padding: 0.5rem 0.6rem !important;
    }

    &--item {
      text-align: center;
      cursor: pointer;
      font-weight: 400;
      color: variables.$col-white;

      @media only screen and (max-width: 1000px) {
        flex: 0 0 150px;
      }

      &--active {
        background: variables.$col-orange;
        color: variables.$col-dark;
        border-radius: 6px;
        padding: 0.5rem 1.5rem;
        font-size: 0.85rem;
        font-weight: 500;

        @media only screen and (max-width: 1000px) {
          padding: 0.6rem 1.5rem;
          font-size: 0.7rem;
          flex: 0 0 170px;
          margin-right: 1rem;
        }
      }
    }
  }

  // ==== Main content (cards or skeleton)
  &__content {
    margin-top: 1rem;
  }

  // ==== Skeleton Container ====
  &__skeleton {
    display: flex;
    overflow-x: auto;
    gap: 25px;
    padding: 1.5rem 0.5rem 1rem 0;
    scroll-behavior: smooth;

    @media only screen and (max-width: 1000px) {
      flex-direction: column;
      overflow-x: hidden;
    }

    // Skeleton Card
    &--card {
      flex: 0 0 320px;
      min-width: 320px;
      height: 280px;
      background: #1e1e1e;
      border-radius: 6px;
      animation: pulse 1.4s infinite ease-in-out;

      @media only screen and (max-width: 1000px) {
        width: 100%;
        min-width: 100%;
      }
    }
  }
}

// === Global Pulse Animation ===
@keyframes pulse {
  0% {
    background-color: #2a2a2a;
  }
  50% {
    background-color: #3b3b3b;
  }
  100% {
    background-color: #2a2a2a;
  }
}


@keyframes shimmer {
  0% {
    background-position: -600px 0;
  }

  100% {
    background-position: 600px 0;
  }
}

.planSkeleton {
  position: relative;

  display: flex;
  flex-direction: column;

  flex: 0 0 340px;

  min-width: 340px;

  padding: 1.5rem;

  border-radius: 18px;

  overflow: hidden;

  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.02),
      rgba(255, 255, 255, 0.01)
    );

  border: 1px solid rgba(255, 255, 255, 0.06);

  backdrop-filter: blur(12px);

  @media only screen and (max-width: 1000px) {
    min-width: 100%;
    flex: none;
  }

  &::after {
    content: "";

    position: absolute;

    inset: 0;

    background: linear-gradient(
      90deg,
      transparent,
      rgba(255, 255, 255, 0.05),
      transparent
    );

    transform: translateX(-100%);

    animation: skeletonSlide 1.8s infinite;
  }

  &__badge,
  &__title,
  &__price,
  &__minimum,
  &__button,
  &__row span {
    background: linear-gradient(
      90deg,
      #252525 25%,
      #333333 50%,
      #252525 75%
    );

    background-size: 600px 100%;

    animation: shimmer 1.6s infinite;

    border-radius: 8px;
  }

  &__badge {
    width: 70px;
    height: 28px;

    margin-left: auto;
    margin-bottom: 1rem;

    border-radius: 999px;
  }

  &__header {
    padding-bottom: 1rem;

    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  }

  &__title {
    width: 60%;
    height: 18px;

    margin-bottom: 1rem;
  }

  &__price {
    width: 45%;
    height: 28px;

    margin-bottom: 0.6rem;
  }

  &__minimum {
    width: 80px;
    height: 12px;
  }

  &__details {
    margin-top: 1rem;
  }

  &__row {
    display: flex;

    justify-content: space-between;

    align-items: center;

    height: 42px;

    border-bottom: 1px solid rgba(255, 255, 255, 0.03);

    span:first-child {
      width: 35%;
      height: 12px;
    }

    span:last-child {
      width: 25%;
      height: 12px;
    }
  }

  &__button {
    width: 100%;

    height: 44px;

    margin-top: 1.5rem;

    border-radius: 12px;
  }
}

@keyframes skeletonSlide {
  0% {
    transform: translateX(-100%);
  }

  100% {
    transform: translateX(100%);
  }
}