/* animations.css - Global Animation System */

/* Page Transitions */
body {
  animation: pageFadeIn 0.5s ease-out forwards;
  will-change: opacity;
}

@keyframes pageFadeIn {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

body.fade-out {
  opacity: 0 !important;
  transition: opacity 0.3s ease-out !important;
}

/* Initial state for elements waiting to scroll into view */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px) scale(0.98);
  transition: opacity 0.7s cubic-bezier(0.2, 0.8, 0.2, 1), 
              transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
  will-change: opacity, transform;
}

/* Base sections can just fade up, no scaling */
section.animate-on-scroll {
  transform: translateY(40px);
}

/* Elements that have come into the viewport */
.is-visible {
  opacity: 1 !important;
  transform: translateY(0) scale(1) !important;
}

/* Overriding transition delays inline via JS, ensuring the base transition is maintained */

/* Additional Polish: Buttons and Cards Glow/Hover */
.btn-primary, .nav-cta, .player-card, .game-card {
  transition: all 0.3s ease-out;
}

.player-card:hover, .game-card:hover {
  transform: translateY(-8px) scale(1.02) !important;
  box-shadow: 0 15px 35px rgba(232, 0, 45, 0.15), 0 5px 15px rgba(0, 0, 0, 0.5);
  z-index: 10;
}

.player-bg {
  transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.player-card:hover .player-bg {
  transform: scale(1.08);
}

.nav-cta:hover, .btn-primary:hover {
  box-shadow: 0 0 20px rgba(232, 0, 45, 0.5);
}

/* Continuous slow pulse for important CTAs */
@keyframes softPulse {
  0% { box-shadow: 0 0 0 0 rgba(232, 0, 45, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(232, 0, 45, 0); }
  100% { box-shadow: 0 0 0 0 rgba(232, 0, 45, 0); }
}

.nav-cta, .btn-primary {
  animation: softPulse 3s infinite;
}

/* Tab Transitions */
.tab-content-fade {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.4s ease-out, transform 0.4s ease-out;
}

.tab-content-fade.active {
  opacity: 1;
  transform: translateY(0);
}

@keyframes slideInRight {
  from { transform: translateX(20px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.animate-slide-in {
  animation: slideInRight 0.4s ease-out forwards;
}

@keyframes pulse {
  0% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.8; transform: scale(1.05); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes slideDown {
  from { transform: translateY(-100%); }
  to { transform: translateY(0); }
}
