/**
 * Dispo2 Animation System - CSS Implementation
 *
 * Mobile-first micro-interactions for sports team management
 */

/* ========================================
   KEYFRAME DEFINITIONS
   ======================================== */

@keyframes slide-up {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fade-scale {
  from {
    transform: scale(0.96);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

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

@keyframes toast-enter {
  0% {
    transform: translateY(100px);
    opacity: 0;
  }
  60% {
    transform: translateY(-8px);
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

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

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

/* ========================================
   ANIMATION UTILITIES
   ======================================== */

.animate-slide-up {
  animation: slide-up 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-fade-in {
  animation: fade-in 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-fade-scale {
  animation: fade-scale 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-shimmer {
  background: linear-gradient(
    90deg,
    var(--color-neutral-200) 0%,
    var(--color-neutral-300) 50%,
    var(--color-neutral-200) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.animate-toast-enter {
  animation: toast-enter 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.animate-bounce {
  animation: bounce 1s infinite;
}

.animate-spin {
  animation: spin 1s linear infinite;
}

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

/* ========================================
   INTERACTIVE STATES
   ======================================== */

.transition-all {
  transition-property: all;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 200ms;
}

.transition-fast {
  transition-duration: 150ms;
}

.transition-base {
  transition-duration: 200ms;
}

.transition-slow {
  transition-duration: 300ms;
}

/* Button Press */
.btn-press:active {
  transform: scale(0.98);
}

/* Card Hover (Desktop) */
@media (hover: hover) {
  .card-interactive:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
  }
}

/* Focus Visible */
.focus-ring:focus-visible {
  outline: 2px solid var(--color-primary-500);
  outline-offset: 2px;
}

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

.skeleton {
  background: linear-gradient(
    90deg,
    var(--color-neutral-200) 0%,
    var(--color-neutral-300) 50%,
    var(--color-neutral-200) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px;
}

.spinner {
  border: 2px solid var(--color-neutral-200);
  border-top-color: var(--color-primary-500);
  border-radius: 50%;
  animation: spin 600ms linear infinite;
}

/* ========================================
   SPORT ROTATOR ANIMATION
   ======================================== */

.sport-text {
  display: inline-block;
  transition: opacity 300ms cubic-bezier(0.4, 0, 0.2, 1),
              transform 300ms cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 150px;
  text-align: left;
}

/* ========================================
   HEADLINE UNDERLINE ANIMATION
   ======================================== */

.headline-word {
  display: inline-block;
  position: relative;
  transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

.headline-word::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -4px;
  height: 4px;
  background: linear-gradient(to right, #4CAF50, #43A047);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

.headline-word.word-underlined::after {
  transform: scaleX(1);
}

/* ========================================
   HERO SCREENSHOT ROTATION
   ======================================== */

/* Hero container with modern Material Design 3 elevated shadow */
.hero-container {
  /* Multi-layered shadow for elevated floating effect */
  box-shadow:
    0 6px 10px 4px rgba(0, 0, 0, 0.15),
    0 2px 3px 0 rgba(0, 0, 0, 0.30);
  transition: box-shadow 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

.hero-container:hover {
  /* Subtle elevation increase on hover */
  box-shadow:
    0 8px 12px 6px rgba(0, 0, 0, 0.15),
    0 4px 4px 0 rgba(0, 0, 0, 0.30);
}

/* Individual slide container */
.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 500ms cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1;
}

.hero-slide.active {
  opacity: 1;
  z-index: 2;
}

/* Screenshot image */
.hero-screenshot-image {
  /* No additional styling needed */
}

/* Caption below screenshot (outside container) */
.hero-caption {
  position: absolute;
  left: 0;
  right: 0;
  opacity: 0;
  transition: opacity 500ms cubic-bezier(0.4, 0, 0.2, 1);
  font-weight: 500;
  letter-spacing: 0.02em;
  z-index: 1;
}

.hero-caption.active {
  opacity: 1;
  z-index: 2;
}

/* ========================================
   ACCESSIBILITY (Reduced Motion)
   ======================================== */

@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;
  }

  .animate-shimmer {
    animation: none;
    background: var(--color-neutral-200);
  }

  .hero-slide,
  .hero-caption {
    transition-duration: 0.01ms !important;
  }
}
