@use '../../styles/variables' as *;

.list-skeleton {
  display: flex;
  min-height: 100%;
  flex-direction: column;
  pointer-events: none;
  user-select: none;
}

.list-skeleton__item {
  min-height: 72px;
  padding: 14px 20px;
  border-bottom: 1px solid $color-surface-active;

  display: flex;
  align-items: center;
  gap: 14px;

  &:last-child {
    border-bottom: none;
  }
}

.list-skeleton__icon,
.list-skeleton__line,
.list-skeleton__meta {
  position: relative;
  display: block;
  overflow: hidden;
  flex: 0 0 auto;
  background: $color-skeleton;

  &::after {
    content: '';
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(
      90deg,
      $transparent,
      $color-skeleton-highlight,
      $transparent
    );
    animation: list-skeleton-shimmer 1.35s ease-in-out infinite;
  }
}

.list-skeleton__icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
}

.list-skeleton__content {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 8px;
}

.list-skeleton__line {
  width: var(--list-skeleton-line-width, 54%);
  max-width: 100%;
  height: 13px;
  border-radius: 999px;
}

.list-skeleton__line--title {
  width: 38%;
  height: 15px;
}

.list-skeleton__meta {
  width: 72px;
  height: 28px;
  border-radius: 999px;
}

@keyframes list-skeleton-shimmer {
  to {
    transform: translateX(100%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .list-skeleton__icon,
  .list-skeleton__line,
  .list-skeleton__meta {
    &::after {
      animation: none;
    }
  }
}
