/* ============================================
   BRANDED LOADING ANIMATION
   ============================================ */

/* Full page loader */
.page-loader {
  position: fixed;
  inset: 0;
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 1;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.page-loader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Football bouncing animation */
.loader-football {
  position: relative;
  width: 60px;
  height: 100px;
}

.loader-football .ball {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  font-size: 3rem;
  animation: football-bounce 0.6s ease-in-out infinite;
  filter: drop-shadow(0 20px 10px rgba(0, 0, 0, 0.3));
}

.loader-football .shadow {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 10px;
  background: radial-gradient(ellipse, rgba(0, 0, 0, 0.4) 0%, transparent 70%);
  border-radius: 50%;
  animation: shadow-pulse 0.6s ease-in-out infinite;
}

@keyframes football-bounce {
  0%, 100% {
    top: 0;
    animation-timing-function: ease-out;
  }
  50% {
    top: 50px;
    animation-timing-function: ease-in;
    transform: translateX(-50%) scaleY(0.9);
  }
}

@keyframes shadow-pulse {
  0%, 100% {
    transform: translateX(-50%) scale(0.6);
    opacity: 0.3;
  }
  50% {
    transform: translateX(-50%) scale(1);
    opacity: 0.6;
  }
}

.loader-text {
  margin-top: 1.5rem;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.2rem;
  color: var(--city-blue);
  letter-spacing: 3px;
  animation: text-pulse 1.5s ease-in-out infinite;
}

@keyframes text-pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* Inline/component loader */
.loader-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
}

.loader-inline .spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(108, 171, 221, 0.2);
  border-top-color: var(--city-blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Skeleton loading */
.skeleton {
  background: linear-gradient(
    90deg,
    rgba(108, 171, 221, 0.1) 25%,
    rgba(108, 171, 221, 0.2) 50%,
    rgba(108, 171, 221, 0.1) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
  border-radius: 4px;
}

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

.skeleton-text {
  height: 1em;
  margin-bottom: 0.5rem;
}

.skeleton-text.short { width: 40%; }
.skeleton-text.medium { width: 70%; }
.skeleton-text.long { width: 100%; }

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

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

/* ============================================
   SKELETON COMPONENTS
   ============================================ */

/* News card skeleton */
.skeleton-news-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-secondary);
  border-radius: 12px;
  overflow: hidden;
}

.skeleton-news-card .skeleton-image {
  aspect-ratio: 16/9;
  width: 100%;
}

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

.skeleton-news-card .skeleton-badge {
  width: 60px;
  height: 20px;
  border-radius: 4px;
}

.skeleton-news-card .skeleton-title {
  height: 1.5em;
  width: 90%;
}

.skeleton-news-card .skeleton-excerpt {
  height: 1em;
}

/* Fixture card skeleton */
.skeleton-fixture-card {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  background: var(--bg-secondary);
  border-radius: 8px;
}

.skeleton-fixture-card .skeleton-date {
  width: 60px;
  height: 60px;
  border-radius: 8px;
}

.skeleton-fixture-card .skeleton-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Stat card skeleton */
.skeleton-stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.5rem;
  gap: 0.5rem;
}

.skeleton-stat-card .skeleton-number {
  width: 80px;
  height: 2.5rem;
  border-radius: 4px;
}

.skeleton-stat-card .skeleton-label {
  width: 100px;
  height: 1rem;
  border-radius: 4px;
}

/* News rich card skeleton (for news list page) */
.skeleton-news-rich-card {
  display: flex;
  background: var(--bg-secondary);
  border-radius: 12px;
  overflow: hidden;
  min-height: 200px;
}

.skeleton-news-rich-card .skeleton-image {
  width: 280px;
  min-height: 200px;
  flex-shrink: 0;
}

.skeleton-news-rich-card .skeleton-content {
  flex: 1;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.skeleton-news-rich-card .skeleton-meta {
  display: flex;
  gap: 1rem;
}

.skeleton-news-rich-card .skeleton-meta-item {
  width: 80px;
  height: 1rem;
  border-radius: 4px;
}

@media (max-width: 768px) {
  .skeleton-news-rich-card {
    flex-direction: column;
  }

  .skeleton-news-rich-card .skeleton-image {
    width: 100%;
    min-height: 180px;
  }
}

/* ============================================
   IMAGE LOADING STATES
   ============================================ */

/* Image container with loading skeleton */
.img-loading-container {
  position: relative;
  overflow: hidden;
}

.img-loading-container::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(108, 171, 221, 0.1) 25%,
    rgba(108, 171, 221, 0.2) 50%,
    rgba(108, 171, 221, 0.1) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
  z-index: 1;
  transition: opacity 0.3s ease;
}

.img-loading-container.loaded::before {
  opacity: 0;
  pointer-events: none;
}

.img-loading-container img {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.img-loading-container.loaded img {
  opacity: 1;
}

/* News card image loading */
.news-card-image,
.news-rich-image {
  position: relative;
  overflow: hidden;
  background: var(--bg-tertiary, rgba(108, 171, 221, 0.1));
}

.news-card-image::before,
.news-rich-image::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(108, 171, 221, 0.05) 25%,
    rgba(108, 171, 221, 0.15) 50%,
    rgba(108, 171, 221, 0.05) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
  z-index: 1;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.news-card-image.img-loaded::before,
.news-rich-image.img-loaded::before {
  opacity: 0;
}

.news-card-image img,
.news-rich-image img {
  transition: opacity 0.4s ease;
}

.news-card-image:not(.img-loaded) img,
.news-rich-image:not(.img-loaded) img {
  opacity: 0;
}

.news-card-image.img-loaded img,
.news-rich-image.img-loaded img {
  opacity: 1;
}

/* Number counter animation */
.counter {
  display: inline-block;
}

.counter.counting {
  animation: counter-pop 0.3s ease-out;
}

@keyframes counter-pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

