/**
 * Skeleton Screens - Loading States 2026
 *
 * Modern loading placeholders that match the layout being loaded.
 * Better perceived performance than spinners.
 */

/* Base skeleton animation */
@keyframes skeleton-pulse {
  0%, 100% {
    opacity: 0.4;
  }
  50% {
    opacity: 0.7;
  }
}

@keyframes skeleton-shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

/* Base skeleton element */
.skeleton {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.03) 0%,
    rgba(255, 255, 255, 0.08) 50%,
    rgba(255, 255, 255, 0.03) 100%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
  border-radius: 4px;
}

/* Alternative pulse animation (for reduced motion) */
@media (prefers-reduced-motion: reduce) {
  .skeleton {
    animation: skeleton-pulse 2s ease-in-out infinite;
    background: rgba(255, 255, 255, 0.05);
  }
}

/* Skeleton variants */
.skeleton-text {
  height: 1em;
  margin-bottom: 0.5em;
  border-radius: 4px;
}

.skeleton-text--short {
  width: 40%;
}

.skeleton-text--medium {
  width: 70%;
}

.skeleton-text--long {
  width: 90%;
}

.skeleton-title {
  height: 1.5em;
  width: 60%;
  margin-bottom: 1rem;
  border-radius: 6px;
}

.skeleton-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
}

.skeleton-avatar--large {
  width: 80px;
  height: 80px;
}

.skeleton-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
}

.skeleton-image--square {
  aspect-ratio: 1 / 1;
}

.skeleton-image--portrait {
  aspect-ratio: 3 / 4;
}

.skeleton-button {
  height: 44px;
  width: 120px;
  border-radius: 8px;
}

.skeleton-badge {
  height: 24px;
  width: 60px;
  border-radius: 12px;
}

/* ===== SKELETON CARD LAYOUTS ===== */

/* Generic card skeleton */
.skeleton-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.skeleton-card__media {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
}

.skeleton-card__content {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Concert card skeleton */
.skeleton-concert-card {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
}

.skeleton-concert-card__date {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  flex-shrink: 0;
}

.skeleton-concert-card__content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Work modal skeleton */
.skeleton-work-modal {
  padding: 1.5rem;
}

.skeleton-work-modal__header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.skeleton-work-modal__list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.skeleton-work-modal__item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 8px;
}

/* News card skeleton */
.skeleton-news-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  overflow: hidden;
}

.skeleton-news-card__image {
  width: 100%;
  aspect-ratio: 16 / 10;
}

.skeleton-news-card__content {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Composer card skeleton */
.skeleton-composer-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
}

.skeleton-composer-card__portrait {
  width: 100px;
  height: 100px;
  border-radius: 50%;
}

.skeleton-composer-card__name {
  height: 1.25em;
  width: 80%;
}

.skeleton-composer-card__stats {
  height: 1em;
  width: 50%;
}

/* ===== SKELETON GRID LAYOUTS ===== */

.skeleton-grid {
  display: grid;
  gap: 1.5rem;
}

.skeleton-grid--2 {
  grid-template-columns: repeat(2, 1fr);
}

.skeleton-grid--3 {
  grid-template-columns: repeat(3, 1fr);
}

.skeleton-grid--4 {
  grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 768px) {
  .skeleton-grid--2,
  .skeleton-grid--3,
  .skeleton-grid--4 {
    grid-template-columns: 1fr;
  }
}

/* ===== INLINE LOADING INDICATOR ===== */

.loading-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.9rem;
}

.loading-inline__dots {
  display: inline-flex;
  gap: 4px;
}

.loading-inline__dot {
  width: 6px;
  height: 6px;
  background: var(--accent-color, #d4af37);
  border-radius: 50%;
  animation: loading-dot 1.4s ease-in-out infinite;
}

.loading-inline__dot:nth-child(2) {
  animation-delay: 0.2s;
}

.loading-inline__dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes loading-dot {
  0%, 80%, 100% {
    transform: scale(0.6);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .loading-inline__dot {
    animation: skeleton-pulse 2s ease-in-out infinite;
  }
}
