/* ============================================================
   Roos Radar — Custom CSS
   Supplements Tailwind with brand tokens, keyframe animations,
   glassmorphism components, skeleton loaders, and responsive overrides.
   ============================================================ */

/* ------------------------------------------------------------
   1. BRAND TOKENS (CSS Custom Properties)
   ------------------------------------------------------------ */
:root {
  --rr-dark: #0a1f0a;
  --rr-dark-alt: #0d2b0d;
  --rr-green: #1a5e1a;
  --rr-gold: #ffc72c;
  --rr-light: #f5f5f0;
  --rr-muted: rgba(255, 255, 255, 0.5);

  /* Shared timing */
  --rr-transition: 300ms ease;
  --rr-transition-fast: 150ms ease;
  --rr-transition-slow: 500ms ease;
}


/* ------------------------------------------------------------
   2. BASE & SELECTION
   ------------------------------------------------------------ */
html {
  scroll-behavior: smooth;
}

::selection {
  background: var(--rr-gold);
  color: var(--rr-dark);
}

::-moz-selection {
  background: var(--rr-gold);
  color: var(--rr-dark);
}

/* Focus-visible for accessibility */
*:focus-visible {
  outline: 2px solid var(--rr-gold);
  outline-offset: 2px;
}


/* ------------------------------------------------------------
   3. SCROLLBAR STYLING (webkit)
   ------------------------------------------------------------ */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--rr-dark);
}

::-webkit-scrollbar-thumb {
  background: var(--rr-gold);
  border-radius: 4px;
  border: 2px solid var(--rr-dark);
}

::-webkit-scrollbar-thumb:hover {
  background: #e6b325;
}

/* Firefox scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--rr-gold) var(--rr-dark);
}


/* ------------------------------------------------------------
   4. KEYFRAME ANIMATIONS
   ------------------------------------------------------------ */

/* Radar sweep: conic gradient rotating 360deg */
@keyframes radar-sweep {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Radar pulse: concentric rings expand and fade */
@keyframes radar-pulse {
  0% {
    transform: scale(0.8);
    opacity: 0.6;
  }
  50% {
    opacity: 0.3;
  }
  100% {
    transform: scale(1.4);
    opacity: 0;
  }
}

/* Gold glow pulse on hero elements */
@keyframes glow-pulse {
  0%, 100% {
    box-shadow: 0 0 15px rgba(255, 199, 44, 0.1),
                0 0 30px rgba(255, 199, 44, 0.05);
  }
  50% {
    box-shadow: 0 0 25px rgba(255, 199, 44, 0.25),
                0 0 50px rgba(255, 199, 44, 0.1);
  }
}

/* Fade in + slide up */
@keyframes fade-in-up {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Shimmer sweep for skeleton loaders */
@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

/* Subtle float for decorative elements */
@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}


/* ------------------------------------------------------------
   5. ANIMATION UTILITY CLASSES
   ------------------------------------------------------------ */

/* Radar sweep: rotating line via conic gradient */
.radar-sweep {
  animation: radar-sweep 8s linear infinite;
  background: conic-gradient(
    from 0deg,
    transparent 0deg,
    rgba(255, 199, 44, 0.08) 30deg,
    transparent 60deg
  );
  border-radius: 50%;
}

/* Radar ring: pulsing concentric ring */
.radar-ring {
  animation: radar-pulse 3s ease-out infinite;
  border: 1px solid rgba(255, 199, 44, 0.15);
  border-radius: 50%;
  pointer-events: none;
}

.radar-ring:nth-child(2) {
  animation-delay: 1s;
}

.radar-ring:nth-child(3) {
  animation-delay: 2s;
}

/* Gold glow */
.radar-glow {
  animation: glow-pulse 3s ease-in-out infinite;
}

/* Fade in up — Tailwind animate-fade-in class */
.animate-fade-in {
  animation: fade-in-up 0.8s ease-out both;
}

.animate-fade-in-delay-1 {
  animation: fade-in-up 0.8s ease-out 0.15s both;
}

.animate-fade-in-delay-2 {
  animation: fade-in-up 0.8s ease-out 0.3s both;
}

.animate-fade-in-delay-3 {
  animation: fade-in-up 0.8s ease-out 0.45s both;
}


/* ------------------------------------------------------------
   6. COMPONENT STYLES
   ------------------------------------------------------------ */

/* --- Glass Card --- */
.glass-card {
  background: rgba(10, 31, 10, 0.6);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 199, 44, 0.1);
  border-radius: 1rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3),
              inset 0 1px 0 rgba(255, 255, 255, 0.03);
  transition: border-color var(--rr-transition),
              transform var(--rr-transition),
              box-shadow var(--rr-transition);
}

.glass-card:hover {
  border-color: rgba(255, 199, 44, 0.25);
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4),
              0 0 20px rgba(255, 199, 44, 0.05),
              inset 0 1px 0 rgba(255, 255, 255, 0.05);
}


/* --- Nav Glass --- */
.nav-glass {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(10, 31, 10, 0.85);
  border-bottom: 1px solid rgba(255, 199, 44, 0.1);
  transition: background var(--rr-transition),
              box-shadow var(--rr-transition);
}

.nav-glass.scrolled {
  background: rgba(10, 31, 10, 0.95);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}


/* --- Countdown Digit --- */
.countdown-digit {
  background: rgba(13, 43, 13, 0.8);
  border: 1px solid rgba(255, 199, 44, 0.08);
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  color: var(--rr-gold);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  box-shadow: inset 0 1px 4px rgba(255, 199, 44, 0.05),
              0 4px 12px rgba(0, 0, 0, 0.2);
  transition: border-color var(--rr-transition),
              box-shadow var(--rr-transition);
}

.countdown-digit:hover {
  border-color: rgba(255, 199, 44, 0.2);
  box-shadow: inset 0 1px 8px rgba(255, 199, 44, 0.08),
              0 4px 16px rgba(0, 0, 0, 0.3);
}


/* --- Player Card --- */
.player-card {
  background: rgba(10, 31, 10, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 1rem;
  overflow: hidden;
  transition: border-color var(--rr-transition),
              transform var(--rr-transition),
              box-shadow var(--rr-transition);
}

.player-card:hover {
  border-color: rgba(255, 199, 44, 0.25);
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4),
              0 0 15px rgba(255, 199, 44, 0.05);
}

.player-card .player-card-image {
  aspect-ratio: 1 / 1;
  border-radius: 0.75rem;
  overflow: hidden;
}

.player-card .player-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  transition: transform var(--rr-transition-slow);
}

.player-card:hover .player-card-image img {
  transform: scale(1.05);
}


/* --- News Card --- */
.news-card {
  background: rgba(10, 31, 10, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 1rem;
  overflow: hidden;
  transition: border-color var(--rr-transition),
              transform var(--rr-transition),
              box-shadow var(--rr-transition);
}

.news-card:hover {
  border-color: rgba(255, 199, 44, 0.2);
  transform: translateY(-4px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4),
              0 0 20px rgba(255, 199, 44, 0.05);
}

.news-card .news-card-image {
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.news-card .news-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--rr-transition-slow);
}

.news-card:hover .news-card-image img {
  transform: scale(1.05);
}


/* --- Fixture Row --- */
.fixture-row {
  display: flex;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 0.75rem;
  transition: background var(--rr-transition),
              border-color var(--rr-transition);
}

.fixture-row:hover {
  background: rgba(255, 199, 44, 0.03);
  border-color: rgba(255, 199, 44, 0.1);
}

.fixture-row:last-child {
  border-bottom: none;
}


/* --- Shorts Card --- */
.shorts-card {
  position: relative;
  aspect-ratio: 9 / 16;
  border-radius: 1rem;
  overflow: hidden;
  cursor: pointer;
  transition: transform var(--rr-transition),
              box-shadow var(--rr-transition);
}

.shorts-card:hover {
  transform: scale(1.03);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.shorts-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--rr-transition-slow);
}

.shorts-card:hover img {
  transform: scale(1.08);
}

/* Play icon overlay on shorts */
.shorts-card .play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  background: rgba(0, 0, 0, 0.2);
  transition: opacity var(--rr-transition);
}

.shorts-card:hover .play-overlay {
  opacity: 1;
}


/* --- Lightbox --- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  padding: 1rem;
  opacity: 0;
  transition: opacity var(--rr-transition);
  pointer-events: none;
}

.lightbox.active {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-content {
  position: relative;
  width: 100%;
  max-width: 24rem;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.6);
  transform: scale(0.95);
  transition: transform var(--rr-transition);
}

.lightbox.active .lightbox-content {
  transform: scale(1);
}


/* --- Skeleton / Shimmer Loader --- */
.skeleton {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.04) 0%,
    rgba(255, 255, 255, 0.08) 40%,
    rgba(255, 255, 255, 0.04) 80%
  );
  background-size: 200% 100%;
  animation: shimmer 1.8s ease-in-out infinite;
  border-radius: 0.5rem;
}

/* Alternative skeleton for dark backgrounds */
.skeleton-dark {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.03) 0%,
    rgba(255, 255, 255, 0.06) 40%,
    rgba(255, 255, 255, 0.03) 80%
  );
  background-size: 200% 100%;
  animation: shimmer 1.8s ease-in-out infinite;
  border-radius: 0.5rem;
}


/* --- Stale Indicator --- */
.stale-indicator {
  font-size: 0.75rem;
  font-style: italic;
  color: var(--rr-muted);
  opacity: 0.7;
  transition: opacity var(--rr-transition);
}

.stale-indicator:hover {
  opacity: 1;
}


/* --- Announcement Banner --- */
.announcement-banner {
  border: 1px solid var(--rr-gold);
  background: rgba(255, 199, 44, 0.08);
  border-radius: 0.75rem;
  padding: 0.75rem 1.5rem;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background var(--rr-transition),
              border-color var(--rr-transition);
}

.announcement-banner:hover {
  background: rgba(255, 199, 44, 0.12);
}


/* ------------------------------------------------------------
   7. SWIPER CAROUSEL OVERRIDES
   ------------------------------------------------------------ */
.shorts-swiper {
  overflow: visible;
  padding-bottom: 1rem;
}

.shorts-swiper .swiper-slide {
  width: 180px;
  transition: transform var(--rr-transition);
}

.shorts-swiper .swiper-slide:hover {
  transform: translateY(-4px);
}

/* Swiper navigation dots (if used) */
.swiper-pagination-bullet {
  background: rgba(255, 199, 44, 0.3) !important;
  opacity: 1 !important;
  transition: background var(--rr-transition),
              transform var(--rr-transition);
}

.swiper-pagination-bullet-active {
  background: var(--rr-gold) !important;
  transform: scale(1.3);
}


/* ------------------------------------------------------------
   8. ALPINE.JS CLOAK
   ------------------------------------------------------------ */
[x-cloak] {
  display: none !important;
}


/* ------------------------------------------------------------
   9. UTILITY HELPERS
   ------------------------------------------------------------ */

/* Line clamp fallback */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Tabular nums for counters */
.tabular-nums {
  font-variant-numeric: tabular-nums;
}

/* Gold text gradient */
.text-gradient-gold {
  background: linear-gradient(135deg, #ffc72c 0%, #ffd966 50%, #ffc72c 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Decorative divider */
.divider-gold {
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 199, 44, 0.3) 50%,
    transparent 100%
  );
}


/* ------------------------------------------------------------
   10. RESPONSIVE OVERRIDES
   ------------------------------------------------------------ */

/* Mobile (< 768px) */
@media (max-width: 767px) {
  /* Reduce hero padding */
  #hero {
    min-height: 90vh;
  }

  #hero .pt-24 {
    padding-top: 5rem;
  }

  /* Smaller countdown digits */
  .countdown-digit {
    padding: 0.5rem 0.75rem;
    font-size: 1.5rem;
    min-width: 60px;
  }

  /* Shorts swiper slide sizing */
  .shorts-swiper .swiper-slide {
    width: 150px;
  }

  /* Tighter section spacing */
  section {
    scroll-margin-top: 4rem;
  }
}

/* Small tablets (>= 768px) */
@media (min-width: 768px) {
  .shorts-swiper .swiper-slide {
    width: 200px;
  }

  section {
    scroll-margin-top: 5rem;
  }
}

/* Desktop (>= 1024px) */
@media (min-width: 1024px) {
  .shorts-swiper .swiper-slide {
    width: 220px;
  }
}

/* Large desktop (>= 1280px) */
@media (min-width: 1280px) {
  .shorts-swiper .swiper-slide {
    width: 240px;
  }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .radar-sweep,
  .radar-ring,
  .radar-glow,
  .skeleton,
  .skeleton-dark {
    animation: none;
  }
}


/* ------------------------------------------------------------
   11. PRINT STYLES
   ------------------------------------------------------------ */
@media print {
  .nav-glass,
  nav,
  .lightbox,
  .shorts-swiper,
  footer .flex.items-center.gap-4 {
    display: none !important;
  }

  body {
    background: white;
    color: black;
  }

  .glass-card,
  .player-card,
  .news-card {
    background: white;
    border: 1px solid #ccc;
    backdrop-filter: none;
  }
}
