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

/* CARD */
.stat {
  border: 1px solid #dcecf2;
  padding: 1.2rem;
  border-radius: 10px;
  background: #fff;
  transition: all 0.25s ease;
  position: relative;

  &:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 56, 69, 0.06);
  }

  &__top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.9rem;
    border-bottom: 1px solid #eef3f6;
    margin-bottom: 0.9rem;

    h1 {
      font-size: 1.4rem;
      font-weight: 700;
      color: #003845;
    }

    h2 {
      font-size: 0.9rem;
      font-weight: 500;
      color: rgba(0, 56, 69, 0.7);
      padding-bottom: 0.2rem;
    }
  }

  &__bottom {
    button {
      color: #003845;
      font-weight: 600;
      font-size: 0.85rem;
      display: flex;
      align-items: center;
      gap: 6px;
      cursor: pointer;

      &:hover {
        opacity: 0.8;
      }
    }
  }
}

/* ICON VARIANTS (clean + consistent) */
.iconPrimary,
.iconSecondary,
.iconTertiary {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 2.4rem;
  width: 2.4rem;
  border-radius: 6px;
  font-size: 1.2rem;
}

/* toned down SaaS palette */
.iconPrimary {
  background: #eef6f8;
  color: #003845;
}

.iconSecondary {
  background: #f3eefc;
  color: #6d4c9f;
}

.iconTertiary {
  background: #edf7f1;
  color: #2a9444;
}

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

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

  .shimmer {
    position: absolute;
    inset: 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.2s infinite;
  }

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

  &__top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.9rem;
    border-bottom: 1px solid #eef3f6;
    margin-bottom: 0.9rem;

    .left {
      flex: 1;
    }

    .title {
      width: 90px;
      height: 12px;
      margin-bottom: 8px;
    }

    .value {
      width: 70px;
      height: 18px;
    }

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

  &__bottom {
    .button {
      width: 110px;
      height: 18px;
    }
  }
}

/* ANIMATION */
.fade-enter {
  opacity: 0;
  transform: translateY(8px);
}

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