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

.stat {
  display: flex;
  flex: 0 0 250px;
  border: 1px solid $col-border-lining;
  padding: 1.2rem;
  border-radius: 10px;
  background: #fff;
  transition: all 0.4s ease;
  position: relative;

  &__top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    min-width: 250px;

    span {
      display: flex;
      justify-content: center;
      align-items: center !important;
      height: 2.5rem;
      width: 2.5rem;
      background: #f4f4f4;
      border-radius: 6px;
      font-size: 1.4rem;
      color: #5b7dd3;
    }

    h1 {
      font-size: 1.3rem;
      font-weight: 700;
      color: $col-dark-text;
    }

    h2 {
      font-size: 1rem;
      font-weight: 500;
      color: $col-dark-text;
      padding-bottom: 0.3rem;
    }
  }

  &__bottom {
    button {
      color: $col-purple;
      font-weight: 600;
      font-size: 0.88rem;
      display: flex;
      align-items: center;
      gap: 5px;
      cursor: pointer;
    }
  }
}

/* -----------------------------
   Skeleton Loader (Same Layout)
------------------------------ */
@keyframes shimmer {
  0% {
    background-position: -450px 0;
  }
  100% {
    background-position: 450px 0;
  }
}

.skeleton {
  @extend .stat;
  overflow: hidden;
  position: relative;

  .shimmer {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
      90deg,
      rgba(255, 255, 255, 0) 0%,
      rgba(255, 255, 255, 0.4) 50%,
      rgba(255, 255, 255, 0) 100%
    );
    background-size: 800px 100%;
    animation: shimmer 1.5s infinite;
  }

  .skeleton__block {
    background-color: #e4e6eb;
    border-radius: 6px;
  }

  &__top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1rem;
    min-width: 220px;

    .left {
      flex: 1;
    }

    .title {
      width: 80px;
      height: 14px;
      margin-bottom: 10px;
    }

    .value {
      width: 60px;
      height: 20px;
    }

    .icon {
      width: 40px;
      height: 40px;
      border-radius: 6px;
    }
  }

  &__bottom {
    .button {
      width: 100px;
      height: 20px;
    }
  }
}

.fade-enter {
  opacity: 0;
  transform: translateY(10px);
}

.fade-enter-active {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
