/* ===================================
   ANIMATIONS.CSS - MABL Animation & Transition Effects
   =================================== */

/* ===================================
   KEYFRAME ANIMATIONS
   =================================== */

/* Pulsing glow for primary CTAs */
@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 2px 8px rgba(249, 115, 22, 0.25);
  }
  50% {
    box-shadow: 0 4px 20px rgba(249, 115, 22, 0.4);
  }
}

/* Badge pulse animation */
@keyframes pulse-badge {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* Scroll indicator bounce */
@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-10px); }
}

/* Animated gradient background */
@keyframes gradient-shift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* Floating particles */
@keyframes float-particles {
  0%, 100% {
    transform: translateY(0) translateX(0) scale(1);
    opacity: 1;
  }
  25% {
    transform: translateY(-30px) translateX(20px) scale(1.05);
    opacity: 0.9;
  }
  50% {
    transform: translateY(-50px) translateX(-10px) scale(1.1);
    opacity: 0.8;
  }
  75% {
    transform: translateY(-20px) translateX(30px) scale(1.05);
    opacity: 0.9;
  }
}

/* Sparkle effect */
@keyframes sparkle {
  0%, 100% { opacity: 0; transform: scale(0); }
  50% { opacity: 1; transform: scale(1); }
}

/* Stat entrance animation */
@keyframes stat-entrance {
  0% {
    opacity: 0;
    transform: translateY(30px) scale(0.9);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Fade in animation */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Slide in from right */
@keyframes slideInRight {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Slide out to right */
@keyframes slideOutRight {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(400px);
    opacity: 0;
  }
}

/* Spinning loader */
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Shimmer effect for skeleton loaders */
@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

/* ===================================
   REVEAL ANIMATIONS
   =================================== */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ===================================
   LINK ANIMATIONS
   =================================== */
a {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

a:hover {
  color: var(--mabl-gold);
  transform: translateX(2px);
}

a:active {
  color: var(--mabl-gold-dark);
  transform: translateX(0);
}

/* Subtle underline animation for links */
a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--mabl-gold);
  transition: width 0.3s ease;
}

a:hover::after {
  width: 100%;
}

/* ===================================
   HOVER & INTERACTION EFFECTS
   =================================== */

/* Link hover effects in navigation */
nav a {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

nav a:hover {
  transform: translateY(-1px);
}

nav a:active {
  transform: translateY(0);
}

/* Card hover effects */
.card {
  transform: translateY(0);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
  transform: translateY(-6px) scale(1.01);
}

.card:active {
  transform: translateY(-2px) scale(1.0);
  transition: transform 0.1s ease;
}

/* Video player hover effects */
.card__video {
  transition: transform 0.3s ease;
}

.card__video:hover {
  transform: translateY(-2px);
}

.card__video-overlay {
  transition: background 0.3s ease;
}

.card__video-play {
  transition: all 0.3s ease;
}

.card__video:hover .card__video-play {
  transform: scale(1.1);
}

.card__video:active .card__video-play {
  transform: scale(1.05);
}

.card__video-play svg {
  transition: fill 0.3s ease;
}

/* Stat hover effects */
.stat {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.stat:hover {
  transform: translateY(-6px) scale(1.03);
}

.stat:active {
  transform: translateY(-2px) scale(1.01);
}

/* Pill hover effects */
.pill {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.pill:hover {
  transform: translateY(-2px);
}

.pill:active {
  transform: translateY(0);
}

/* Button hover effects */
.btn {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn--primary:hover,
.btn--donate:hover {
  transform: translateY(-2px) scale(1.02);
}

.btn--secondary:hover {
  transform: translateY(-2px) scale(1.02);
}

.btn--ghost:hover {
  transform: translateY(-1px) scale(1.01);
}

.btn--primary:active,
.btn--donate:active,
.btn--secondary:active {
  transform: translateY(0) scale(0.98);
  transition: transform 0.1s ease;
}

.btn--ghost:active {
  transform: translateY(0) scale(0.98);
}

/* Progress bar animation */
.bar span {
  transition: width 0.6s ease;
}

/* Header shadow transition */
header {
  transition: box-shadow .2s ease;
}

/* Mobile nav transition */
.mobile-nav {
  transform: translateY(0);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-nav--hidden {
  transform: translateY(100%);
}

/* Mobile nav item animations */
.mobile-nav__item {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-nav__item:active {
  transform: scale(0.95);
}

.mobile-nav__item::before {
  transition: width 0.3s ease;
}

/* Mobile menu animations */
.mobile-menu-overlay.active {
  animation: fadeIn 0.2s ease;
}

.mobile-menu {
  animation: slideInRight 0.3s ease;
}

/* Video modal animations */
.video-modal[aria-hidden="false"] {
  animation: fadeIn 0.3s ease forwards;
}

.video-player__poster {
  transition: opacity 0.3s ease;
}

.video-poster__play {
  transition: transform 0.3s ease;
}

.video-player__poster:hover .video-poster__play {
  transform: scale(1.1);
}

/* Video controls transitions */
.video-player__controls {
  transition: opacity 0.3s ease;
}

.video-controls__progress-bar {
  transition: height 0.2s ease;
}

.video-controls__progress-filled {
  transition: width 0.1s linear;
}

.video-controls__progress-filled::after {
  transition: opacity 0.2s ease;
}

.video-controls__btn {
  transition: all 0.2s ease;
}

.video-controls__btn:hover {
  transform: scale(1.1);
}

.video-controls__btn:active {
  transform: scale(0.95);
}

.video-modal__close {
  transition: all 0.2s ease;
}

.video-modal__close:hover {
  transform: scale(1.1);
}

.video-modal__close:active {
  transform: scale(0.95);
}

/* Form input transitions */
.newsletter input {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.newsletter input:hover {
  border-color: rgba(255, 255, 255, 0.5);
}

.newsletter input:focus {
  transform: translateY(-1px);
}

/* Footer link transitions */
footer a {
  transition: color 0.2s ease;
}

/* Toast notification transitions */
.toast__close {
  transition: color 0.2s ease;
}

/* ===================================
   REDUCED MOTION SUPPORT
   =================================== */
@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;
  }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .btn--primary,
  .btn--donate {
    animation: none;
  }

  .stats {
    animation: none;
  }

  .stats::before,
  .stats::after {
    animation: none;
  }

  .stat {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .scroll-indicator {
    animation: none;
  }

  .card__badge--urgent {
    animation: none;
  }
}
