/* ==========================================================================
   BATLIGO USER DASHBOARD - STYLES & YOUTUBE-STYLE SKELETON LOADERS
   ========================================================================== */

/* Shimmer Animation Sweep (YouTube / Esports Sheen Style) */
@keyframes yt-shimmer-sweep {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

.yt-skeleton-shimmer {
  position: relative !important;
  overflow: hidden !important;
  background: rgba(18, 9, 36, 0.75) !important;
}

.yt-skeleton-shimmer::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  transform: translateX(-100%);
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.03) 20%,
    rgba(122, 75, 255, 0.16) 45%,
    rgba(43, 231, 255, 0.2) 55%,
    rgba(255, 255, 255, 0.03) 80%,
    rgba(255, 255, 255, 0) 100%
  );
  animation: yt-shimmer-sweep 1.8s infinite ease-in-out;
  pointer-events: none;
  z-index: 1;
}

@media (prefers-reduced-motion: reduce) {
  .yt-skeleton-shimmer::after {
    animation: none;
    opacity: 0.2;
  }
}

/* One-by-one Slider Snap-lock rules */
.banner-track,
.announcement-track {
  scroll-snap-type: x mandatory !important;
  -webkit-overflow-scrolling: touch !important;
  overscroll-behavior-x: contain !important;
  touch-action: pan-y !important;
}

.banner-link,
.announcement-card,
.dash-skeleton-banner {
  scroll-snap-align: start !important;
  scroll-snap-stop: always !important; /* Force stopping at each slide without skipping */
}

.banner-item,
.banner-link img,
.announcement-card img {
  user-select: none !important;
  -webkit-user-drag: none !important;
}

/* Skeleton Placeholder Lines */
.dash-skel-line {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  position: relative;
  overflow: hidden;
  display: block;
}

/* Pre-styled width & height helpers for instant zero-FOUC paint */
.dash-skel-w-36 { width: 9rem; }
.dash-skel-w-64 { width: 16rem; }
.dash-skel-w-28 { width: 7rem; }
.dash-skel-w-20 { width: 5rem; }
.dash-skel-w-16 { width: 4rem; }
.dash-skel-w-24 { width: 6rem; }
.dash-skel-h-3 { height: 0.75rem; }
.dash-skel-h-2-5 { height: 0.625rem; }
.dash-skel-h-2 { height: 0.5rem; }

/* Announcement Skeleton */
.dash-skeleton-announcement {
  width: 100%;
  padding: 6px 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Banner Skeleton */
.dash-skeleton-banner {
  width: 100%;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  display: block;
  box-shadow: 0 12px 26px rgba(6, 0, 20, 0.4);
}

@media (min-width: 500px) {
  .dash-skeleton-banner {
    max-height: 250px;
    margin: 0 auto;
  }
}

.banner-link .dash-card-media {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
}

@media (min-width: 500px) {
  .banner-link .dash-card-media {
    max-height: 250px;
  }
}

.dash-skel-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(185, 193, 255, 0.2);
  display: inline-block;
}

/* Contest Mode Card Skeletons */
.dash-skeleton-card {
  display: block !important;
  pointer-events: none;
}

/* Exact aspect ratios matching real button images */
.ff-mode-card-full .dash-skel-card-banner,
.ff-mode-card-full .dash-card-media {
  width: 100%;
  aspect-ratio: 1000 / 188;
  display: block;
  background: rgba(15, 6, 32, 0.85);
}

.ff-mode-card-half .dash-skel-card-banner,
.ff-mode-card-half .dash-card-media {
  width: 100%;
  aspect-ratio: 800 / 300;
  display: block;
  background: rgba(15, 6, 32, 0.85);
}

.dash-skel-card-footer {
  width: 100%;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, rgba(18, 7, 44, 0.98), rgba(8, 2, 24, 0.98));
  border-top: 1px solid rgba(122, 75, 255, 0.15);
}

/* Smooth Image Revealing (Prevents sudden jarring pop-ins) */
.dash-img-fade {
  opacity: 0;
  transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: opacity;
}

.dash-img-fade.is-loaded {
  opacity: 1;
}

/* Card image container with subtle background placeholder */
.dash-card-media {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: rgba(15, 6, 30, 0.85);
}

/* Section Smooth Version-Update Transitions */
.dash-section-transition {
  transition: opacity 0.25s ease, transform 0.25s ease, filter 0.25s ease;
  will-change: opacity, transform;
}

.dash-section-transition.is-updating {
  opacity: 0.55;
  transform: scale(0.995);
  filter: blur(0.5px);
  pointer-events: none;
}

.dash-section-transition.is-refreshed {
  animation: dashPopRefreshed 0.4s ease-out forwards;
}

@keyframes dashPopRefreshed {
  0% {
    opacity: 0.55;
    transform: scale(0.995);
  }
  100% {
    opacity: 1;
    transform: scale(1);
    filter: blur(0);
  }
}

/* Update Notification Toast (Subtle feedback when version changes) */
.dash-update-pill {
  position: fixed;
  bottom: 74px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  z-index: 9999;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: 999px;
  background: rgba(18, 8, 38, 0.95);
  border: 1px solid rgba(43, 231, 255, 0.45);
  color: #dff7ff;
  font-size: 0.75rem;
  font-weight: 700;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 15px rgba(43, 231, 255, 0.2);
  backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

.dash-update-pill.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.dash-update-pill .pill-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #2be7ff;
  box-shadow: 0 0 8px #2be7ff;
}
