/**
 * GAMES & UNIFIED SLIDER STYLES
 * Club Loyalty Platform - Minigames Engagement Extension
 */

/* Horizontal Slider with Peek Effect */
.games-slider-container {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  gap: 1.25rem;
  padding-bottom: 0.75rem;
  padding-top: 0.25rem;
  /* Peek padding */
  padding-right: 2rem;
}

.games-slider-container::-webkit-scrollbar {
  height: 6px;
}
.games-slider-container::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.6);
  border-radius: 9999px;
}
.games-slider-container::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.4);
  border-radius: 9999px;
}
.games-slider-container::-webkit-scrollbar-thumb:hover {
  background: rgba(99, 102, 241, 0.7);
}

.games-slider-card {
  scroll-snap-align: start;
  flex: 0 0 295px;
  width: 295px;
  padding: 0.875rem !important;
  box-sizing: border-box;
  transition: all 0.25s ease-in-out;
}

@media (min-width: 640px) {
  .games-slider-card {
    flex: 0 0 320px;
    width: 320px;
  }
}

.games-slider-card:hover {
  transform: translateY(-2px);
}

/* Card Disabled / Locked State */
.game-card-locked {
  filter: grayscale(0.5);
  position: relative;
}

.game-card-locked::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 1rem;
  background: rgba(15, 23, 42, 0.45);
  pointer-events: none;
}

/* Modal Popup for Games */
.game-modal-backdrop {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background-color: rgba(2, 6, 23, 0.85);
}

.game-modal-box {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7), 0 0 40px rgba(99, 102, 241, 0.15);
}

/* Keyframes */
@keyframes spinSlow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.animate-spin-slow {
  animation: spinSlow 8s linear infinite;
}

@keyframes jump {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.animate-jump {
  animation: jump 0.3s ease-in-out;
}

/* ==========================================================================
   PROMINENT HERO SECTION (GAMES & CHALLENGES WRAPPER)
   ========================================================================== */
.games-hero-section {
  background: linear-gradient(135deg, rgba(30, 27, 75, 0.8) 0%, rgba(15, 23, 42, 0.95) 50%, rgba(46, 16, 101, 0.7) 100%);
  border: 2px solid rgba(129, 140, 248, 0.4);
  box-shadow: 0 20px 45px -15px rgba(2, 6, 23, 0.9), 0 0 35px rgba(99, 102, 241, 0.2);
}

.games-hero-counter-badge {
  background: rgba(99, 102, 241, 0.2);
  border: 1px solid rgba(129, 140, 248, 0.35);
  color: #c7d2fe;
}

.slider-arrow-btn {
  background: rgba(30, 41, 59, 0.85);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.slider-arrow-btn:hover {
  background: rgba(51, 65, 85, 0.95);
  color: #ffffff;
  border-color: rgba(129, 140, 248, 0.5);
  transform: scale(1.05);
}

/* ==========================================================================
   ADMIN TOGGLE SWITCH (HIGH VISIBILITY IN DARK & LIGHT THEMES)
   ========================================================================== */
.admin-switch-row {
  background-color: rgba(2, 6, 23, 0.5) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  transition: all 0.2s ease-in-out;
}

.admin-switch-track {
  width: 52px;
  height: 28px;
  background-color: #334155 !important; /* Deep Slate-700 when OFF */
  border: 2px solid #64748b !important;
  border-radius: 9999px;
  position: relative;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  flex-shrink: 0;
  display: block;
}

.admin-switch-track.is-active,
.admin-game-toggle:checked + .admin-switch-track {
  background-color: #10b981 !important; /* Vivid Emerald green when ON */
  border-color: #059669 !important;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.45) !important;
}

.admin-switch-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background-color: #ffffff !important;
  border-radius: 9999px;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4) !important;
}

.admin-switch-track.is-active .admin-switch-knob,
.admin-game-toggle:checked + .admin-switch-track .admin-switch-knob {
  transform: translateX(24px);
}

/* ==========================================================================
   LIGHT MODE OVERRIDES FOR GAMES HERO SECTION & SLIDER CARDS
   ========================================================================== */
html[data-theme="light"] .games-hero-section {
  background: linear-gradient(135deg, #eef2ff 0%, #ffffff 45%, #f5f3ff 100%) !important;
  border: 2.5px solid #6366f1 !important;
  box-shadow: 0 20px 40px -10px rgba(99, 102, 241, 0.22), 0 4px 16px -2px rgba(99, 102, 241, 0.12) !important;
}

html[data-theme="light"] .hero-glow-blob-1 {
  background: rgba(99, 102, 241, 0.18) !important;
}

html[data-theme="light"] .hero-glow-blob-2 {
  background: rgba(168, 85, 247, 0.15) !important;
}

html[data-theme="light"] .games-hero-title {
  color: #0f172a !important;
}

html[data-theme="light"] .games-hero-title span {
  background: linear-gradient(135deg, #4338ca, #7c3aed) !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  color: transparent !important;
}

html[data-theme="light"] .games-hero-subtitle {
  color: #475569 !important;
}

html[data-theme="light"] .games-hero-counter-badge {
  background: #e0e7ff !important;
  border-color: #c7d2fe !important;
  color: #3730a3 !important;
}

html[data-theme="light"] .slider-arrow-btn {
  background: #ffffff !important;
  color: #1e293b !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.06) !important;
}

html[data-theme="light"] .slider-arrow-btn:hover {
  background: #f1f5f9 !important;
  color: #0f172a !important;
  border-color: #6366f1 !important;
}

/* Light mode for Game and Challenge Cards in slider */
html[data-theme="light"] .games-hero-section .games-slider-card {
  background: #ffffff !important;
  border: 1.5px solid #cbd5e1 !important;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04) !important;
}

html[data-theme="light"] .games-hero-section .games-slider-card:hover {
  border-color: #818cf8 !important;
  box-shadow: 0 16px 30px -6px rgba(99, 102, 241, 0.22) !important;
}

html[data-theme="light"] .games-hero-section .games-slider-card h4 {
  color: #0f172a !important;
}

html[data-theme="light"] .games-hero-section .games-slider-card p {
  color: #475569 !important;
}

html[data-theme="light"] .games-hero-section .games-slider-card .border-t {
  border-color: #e2e8f0 !important;
}

html[data-theme="light"] .games-hero-section .games-slider-card span.text-slate-400 {
  color: #64748b !important;
}

html[data-theme="light"] .games-hero-section .games-slider-card .bg-white\/5 {
  background-color: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
}

/* Light mode badge contrasts in challenges and boosters */
html[data-theme="light"] .games-hero-section .games-slider-card .text-amber-300 {
  color: #b45309 !important;
}
html[data-theme="light"] .games-hero-section .games-slider-card .bg-amber-500\/10 {
  background-color: #fef3c7 !important;
  border-color: #fcd34d !important;
}
html[data-theme="light"] .games-hero-section .games-slider-card .text-emerald-400 {
  color: #047857 !important;
}
html[data-theme="light"] .games-hero-section .games-slider-card .bg-emerald-500\/10 {
  background-color: #d1fae5 !important;
  border-color: #a7f3d0 !important;
}
html[data-theme="light"] .games-hero-section .games-slider-card .text-violet-300 {
  color: #6d28d9 !important;
}
html[data-theme="light"] .games-hero-section .games-slider-card .bg-violet-500\/10 {
  background-color: #ede9fe !important;
  border-color: #ddd6fe !important;
}
html[data-theme="light"] .games-hero-section .games-slider-card .bg-slate-950 {
  background-color: #f1f5f9 !important;
  border-color: #e2e8f0 !important;
}

html[data-theme="light"] .games-slider-container::-webkit-scrollbar-track {
  background: #e2e8f0;
}

html[data-theme="light"] .games-slider-container::-webkit-scrollbar-thumb {
  background: #a5b4fc;
}

html[data-theme="light"] .games-slider-container::-webkit-scrollbar-thumb:hover {
  background: #818cf8;
}

/* Light mode for admin switch row and track */
html[data-theme="light"] .admin-switch-row {
  background-color: #f8fafc !important;
  border: 1.5px solid #cbd5e1 !important;
}

html[data-theme="light"] .admin-switch-track {
  background-color: #cbd5e1 !important; /* Clearly visible cool gray track when OFF */
  border: 2px solid #94a3b8 !important;
}

html[data-theme="light"] .admin-switch-track.is-active,
html[data-theme="light"] .admin-game-toggle:checked + .admin-switch-track {
  background-color: #10b981 !important; /* Crisp high-contrast emerald when ON */
  border-color: #047857 !important;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.4) !important;
}

html[data-theme="light"] .admin-switch-knob {
  background-color: #ffffff !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25) !important;
}
