/* ==========================================================================
   category-skeleton.css — placeholdery ładowania stron kategorii
   Wymaga: variables.css, category-top.css, league-header.css
   ========================================================================== */

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

.skeleton-box {
  display: block;
  flex-shrink: 0;
  border-radius: var(--radius-10);
  background: linear-gradient(
    90deg,
    var(--surface-2) 0%,
    color-mix(in srgb, var(--surface-2) 65%, var(--fg) 8%) 50%,
    var(--surface-2) 100%
  );
  background-size: 200% 100%;
  animation: category-skeleton-shimmer 1.35s ease-in-out infinite;
}

html[data-theme="dark"] .skeleton-box {
  background: linear-gradient(90deg, #2a2a2a 0%, #353535 50%, #2a2a2a 100%);
  background-size: 200% 100%;
}

@media (prefers-reduced-motion: reduce) {
  .skeleton-box {
    animation: none;
    background: var(--surface-2);
  }

  html[data-theme="dark"] .skeleton-box {
    background: #2a2a2a;
  }
}

.category-page--skeleton {
  width: 100%;
}

.category-page--skeleton .category-top {
  margin-bottom: var(--space-32);
}

.category-header--skeleton {
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
}

.skeleton-box--title {
  width: min(280px, 72%);
  height: calc(var(--fs-24) * var(--lh-tight));
  border-radius: var(--radius-10);
}

.skeleton-box--desc {
  width: min(640px, 100%);
  height: calc(var(--fs-14) * var(--lh-relaxed));
  border-radius: 8px;
}

.skeleton-box--desc-short {
  width: min(480px, 82%);
}

.category-controls--skeleton {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: var(--space-16);
}

.skeleton-box--control-date {
  width: 196px;
  height: var(--category-controls-h, 40px);
  border-radius: var(--radius-pill);
}

.skeleton-box--control-view {
  width: 300px;
  height: var(--category-controls-h, 40px);
  margin-inline: auto;
  border-radius: var(--radius-pill);
}

.skeleton-box--control-mode {
  width: 168px;
  height: var(--category-controls-h, 40px);
  margin-left: auto;
  border-radius: var(--radius-pill);
}

.category-leagues--skeleton {
  display: flex;
  flex-direction: column;
  gap: var(--space-10);
}

.league-header--skeleton {
  pointer-events: none;
  user-select: none;
}

.league-header--skeleton .league-header__head {
  padding: 10px 16px;
}

.league-header--skeleton .league-header__toggle--skeleton {
  display: flex;
  align-items: center;
  gap: var(--space-12);
  flex: 1 1 auto;
  min-width: 0;
  min-height: 56px;
  padding: 0;
  border: none;
  background: transparent;
}

.league-header--skeleton .skeleton-box--league-drag {
  width: 28px;
  height: 32px;
  border-radius: 10px;
}

.league-header--skeleton .skeleton-box--league-fav {
  width: 22px;
  height: 32px;
  border-radius: 10px;
}

.league-header--skeleton .league-header__logo-wrap .skeleton-box--league-logo {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-10);
}

.league-header--skeleton .league-header__text .skeleton-box {
  align-self: flex-start;
  max-width: 100%;
}

.league-header--skeleton .skeleton-box--league-name {
  width: 168px;
  height: calc(var(--fs-14) * var(--lh-tight));
  border-radius: 6px;
}

.league-header--skeleton .skeleton-box--league-flag {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.league-header--skeleton .skeleton-box--league-country {
  width: 96px;
  height: calc(var(--fs-12) * var(--lh-tight));
  border-radius: 6px;
}

.league-header--skeleton .skeleton-box--league-count {
  box-sizing: border-box;
  min-width: 22px;
  width: 28px;
  height: 22px;
  padding: 0 var(--space-6);
  border-radius: 6px;
}

.league-header--skeleton .skeleton-box--league-chevron {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

@media (max-width: 767px) {
  .category-controls--skeleton {
    grid-template-columns: 1fr;
    gap: var(--space-10);
  }

  .skeleton-box--control-view,
  .skeleton-box--control-mode {
    margin-inline: 0;
  }

  .league-header--skeleton .skeleton-box--league-name {
    width: min(168px, 42vw);
  }

  .league-header--skeleton .skeleton-box--league-country {
    width: min(96px, 30vw);
  }
}
