/* ========================================
   AMMA Website - Animation System
   Inspired by: Apresentação AMMA 2025
   Libraries: AOS + CSS Animations + Motion
   ======================================== */

/* === ANIMATION VARIABLES === */
:root {
  --anim-duration-fast: 0.3s;
  --anim-duration-normal: 0.5s;
  --anim-duration-slow: 0.8s;
  --anim-duration-slower: 1.2s;
  --anim-easing: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --anim-easing-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
  --anim-easing-elastic: cubic-bezier(0.68, -0.6, 0.32, 1.6);

  /* Blob colors from presentation */
  --blob-yellow: #F7C600;
  --blob-pink: #FF6B9D;
  --blob-blue: #4A90D9;
  --blob-green: #4CAF50;
  --blob-orange: #FF9800;
}

/* ========================================
   1. FLOATING BLOBS - Background Elements
   ======================================== */

.floating-blobs {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}

/* Blobs over fullbg hero - lower opacity to not cover the image */
.hero-fullbg .floating-blobs {
  z-index: 2;
}

.hero-fullbg .blob {
  opacity: 0.4;
}

/* Hide smileys on fullbg hero to not interfere with image */
.hero-fullbg .smiley-decoration {
  display: none;
}

/* Also hide smileys added to stats section that may overlap */
.stats-section .smiley-decoration {
  display: none;
}

.blob {
  position: absolute;
  border-radius: 50% 40% 60% 50% / 50% 60% 40% 50%;
  filter: blur(0px);
  opacity: 0.6;
  animation: blobFloat 8s ease-in-out infinite;
}

.blob-1 {
  width: 300px;
  height: 300px;
  background: linear-gradient(135deg, var(--blob-yellow) 0%, var(--blob-orange) 100%);
  top: -100px;
  right: -50px;
  animation-delay: 0s;
}

.blob-2 {
  width: 200px;
  height: 200px;
  background: linear-gradient(135deg, var(--blob-pink) 0%, #FF8FAB 100%);
  bottom: 20%;
  left: -80px;
  animation-delay: -2s;
  animation-duration: 10s;
}

.blob-3 {
  width: 150px;
  height: 150px;
  background: linear-gradient(135deg, var(--blob-blue) 0%, #6BB3F8 100%);
  top: 40%;
  right: 5%;
  animation-delay: -4s;
  animation-duration: 12s;
}

.blob-4 {
  width: 180px;
  height: 180px;
  background: linear-gradient(135deg, var(--blob-green) 0%, #81C784 100%);
  bottom: 10%;
  right: 20%;
  animation-delay: -1s;
  animation-duration: 9s;
}

@keyframes blobFloat {
  0%, 100% {
    transform: translate(0, 0) rotate(0deg) scale(1);
    border-radius: 50% 40% 60% 50% / 50% 60% 40% 50%;
  }
  25% {
    transform: translate(20px, -30px) rotate(5deg) scale(1.05);
    border-radius: 60% 50% 40% 60% / 40% 50% 60% 50%;
  }
  50% {
    transform: translate(-10px, 20px) rotate(-5deg) scale(0.95);
    border-radius: 40% 60% 50% 40% / 60% 40% 50% 60%;
  }
  75% {
    transform: translate(-30px, -10px) rotate(3deg) scale(1.02);
    border-radius: 50% 40% 60% 50% / 50% 60% 40% 50%;
  }
}

/* ========================================
   2. SMILEY DECORATIONS
   ======================================== */

.smiley-decoration {
  position: absolute;
  width: 60px;
  height: 60px;
  background: var(--amma-yellow);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: smileWiggle 3s ease-in-out infinite;
  box-shadow: 0 4px 15px rgba(247, 198, 0, 0.4);
  z-index: 2;
}

/* SVG Smiley face */
.smiley-decoration::before {
  content: '';
  width: 100%;
  height: 100%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Ccircle cx='50' cy='50' r='45' fill='%23F7C600'/%3E%3Ccircle cx='35' cy='40' r='6' fill='%231A1A1A'/%3E%3Ccircle cx='65' cy='40' r='6' fill='%231A1A1A'/%3E%3Cpath d='M30 60 Q50 80 70 60' stroke='%231A1A1A' stroke-width='5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
}

.smiley-small {
  width: 40px;
  height: 40px;
  font-size: 20px;
}

.smiley-small::before {
  font-size: 16px;
}

.smiley-large {
  width: 80px;
  height: 80px;
}

.smiley-large::before {
  font-size: 32px;
}

@keyframes smileWiggle {
  0%, 100% {
    transform: rotate(-5deg) scale(1);
  }
  25% {
    transform: rotate(5deg) scale(1.05);
  }
  50% {
    transform: rotate(-3deg) scale(1);
  }
  75% {
    transform: rotate(8deg) scale(1.03);
  }
}

/* ========================================
   3. CONFETTI / PARTICLES
   ======================================== */

.confetti-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}

.confetti {
  position: absolute;
  width: 10px;
  height: 10px;
  opacity: 0.8;
}

.confetti-circle {
  border-radius: 50%;
}

.confetti-square {
  border-radius: 2px;
  transform: rotate(45deg);
}

.confetti-triangle {
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-bottom: 10px solid currentColor;
}

.confetti-yellow { background: var(--blob-yellow); color: var(--blob-yellow); }
.confetti-pink { background: var(--blob-pink); color: var(--blob-pink); }
.confetti-blue { background: var(--blob-blue); color: var(--blob-blue); }
.confetti-green { background: var(--blob-green); color: var(--blob-green); }
.confetti-orange { background: var(--blob-orange); color: var(--blob-orange); }

@keyframes confettiFall {
  0% {
    transform: translateY(-100px) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0;
  }
}

@keyframes confettiFloat {
  0%, 100% {
    transform: translateX(0) rotate(0deg);
  }
  25% {
    transform: translateX(30px) rotate(90deg);
  }
  50% {
    transform: translateX(-20px) rotate(180deg);
  }
  75% {
    transform: translateX(15px) rotate(270deg);
  }
}

/* ========================================
   4. ENTRANCE ANIMATIONS (AOS-like)
   ======================================== */

/* Base state for animated elements */
[data-animate] {
  opacity: 0;
  transition: opacity var(--anim-duration-slow) var(--anim-easing),
              transform var(--anim-duration-slow) var(--anim-easing);
}

[data-animate].animated {
  opacity: 1;
}

/* Fade animations */
[data-animate="fade-up"] {
  transform: translateY(40px);
}
[data-animate="fade-up"].animated {
  transform: translateY(0);
}

[data-animate="fade-down"] {
  transform: translateY(-40px);
}
[data-animate="fade-down"].animated {
  transform: translateY(0);
}

[data-animate="fade-left"] {
  transform: translateX(40px);
}
[data-animate="fade-left"].animated {
  transform: translateX(0);
}

[data-animate="fade-right"] {
  transform: translateX(-40px);
}
[data-animate="fade-right"].animated {
  transform: translateX(0);
}

/* Zoom animations */
[data-animate="zoom-in"] {
  transform: scale(0.8);
}
[data-animate="zoom-in"].animated {
  transform: scale(1);
}

[data-animate="zoom-out"] {
  transform: scale(1.2);
}
[data-animate="zoom-out"].animated {
  transform: scale(1);
}

/* Bounce animations - alegria infantil */
[data-animate="bounce-up"] {
  transform: translateY(60px);
  transition: opacity var(--anim-duration-slow) var(--anim-easing),
              transform var(--anim-duration-slow) var(--anim-easing-bounce);
}
[data-animate="bounce-up"].animated {
  transform: translateY(0);
}

[data-animate="bounce-in"] {
  transform: scale(0.5);
  transition: opacity var(--anim-duration-slow) var(--anim-easing),
              transform var(--anim-duration-slow) var(--anim-easing-elastic);
}
[data-animate="bounce-in"].animated {
  transform: scale(1);
}

/* Flip animations */
[data-animate="flip-up"] {
  transform: perspective(1000px) rotateX(30deg) translateY(40px);
}
[data-animate="flip-up"].animated {
  transform: perspective(1000px) rotateX(0) translateY(0);
}

/* Slide animations */
[data-animate="slide-up"] {
  transform: translateY(100px);
  opacity: 1;
}
[data-animate="slide-up"].animated {
  transform: translateY(0);
}

/* ========================================
   5. STAGGER ANIMATIONS (Cards in sequence)
   ======================================== */

.stagger-container [data-animate] {
  transition-delay: calc(var(--stagger-index, 0) * 0.1s);
}

/* Auto-stagger for grids */
.grid [data-animate]:nth-child(1) { --stagger-index: 0; }
.grid [data-animate]:nth-child(2) { --stagger-index: 1; }
.grid [data-animate]:nth-child(3) { --stagger-index: 2; }
.grid [data-animate]:nth-child(4) { --stagger-index: 3; }
.grid [data-animate]:nth-child(5) { --stagger-index: 4; }
.grid [data-animate]:nth-child(6) { --stagger-index: 5; }
.grid [data-animate]:nth-child(7) { --stagger-index: 6; }
.grid [data-animate]:nth-child(8) { --stagger-index: 7; }

/* ========================================
   6. HOVER EFFECTS
   ======================================== */

/* Card lift effect */
.card {
  transition: transform var(--anim-duration-fast) var(--anim-easing),
              box-shadow var(--anim-duration-fast) var(--anim-easing);
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* Card image zoom */
.card-image img {
  transition: transform var(--anim-duration-normal) var(--anim-easing);
}

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

/* Button bounce */
.btn {
  transition: transform var(--anim-duration-fast) var(--anim-easing-bounce),
              background-color var(--anim-duration-fast) var(--anim-easing),
              box-shadow var(--anim-duration-fast) var(--anim-easing);
}

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

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

/* Icon wiggle on hover */
.btn i,
.card-link i,
.section-link i {
  transition: transform var(--anim-duration-fast) var(--anim-easing);
}

.btn:hover i,
.card-link:hover i,
.section-link:hover i {
  animation: iconWiggle 0.5s ease-in-out;
}

@keyframes iconWiggle {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(4px); }
  75% { transform: translateX(-2px); }
}

/* Link underline animation */
.nav-link,
.card-link,
.section-link {
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--amma-yellow);
  transition: width var(--anim-duration-fast) var(--anim-easing);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

/* ========================================
   7. HEARTBEAT ANIMATION (Donate buttons)
   ======================================== */

.heartbeat {
  animation: heartbeat 1.5s ease-in-out infinite;
}

.heartbeat-hover:hover {
  animation: heartbeat 1s ease-in-out infinite;
}

@keyframes heartbeat {
  0%, 100% {
    transform: scale(1);
  }
  15% {
    transform: scale(1.1);
  }
  30% {
    transform: scale(1);
  }
  45% {
    transform: scale(1.05);
  }
  60% {
    transform: scale(1);
  }
}

/* Heart icon specific */
.fa-heart {
  transition: transform var(--anim-duration-fast) var(--anim-easing);
}

.btn:hover .fa-heart {
  animation: heartPulse 0.6s ease-in-out infinite;
}

@keyframes heartPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

/* ========================================
   8. WAVE ANIMATION (Hero section)
   ======================================== */

.hero-wave {
  animation: waveMove 8s ease-in-out infinite;
}

@keyframes waveMove {
  0%, 100% {
    transform: translateX(0);
  }
  50% {
    transform: translateX(-20px);
  }
}

/* Animated wave SVG paths */
.wave-animated path {
  animation: wavePath 6s ease-in-out infinite;
}

@keyframes wavePath {
  0%, 100% {
    d: path("M0,64L80,69.3C160,75,320,85,480,80C640,75,800,53,960,48C1120,43,1280,53,1360,58.7L1440,64L1440,120L0,120Z");
  }
  50% {
    d: path("M0,80L80,74.7C160,69,320,59,480,64C640,69,800,91,960,96C1120,101,1280,91,1360,85.3L1440,80L1440,120L0,120Z");
  }
}

/* ========================================
   9. COUNTER ANIMATION (Stats)
   ======================================== */

.stat-number {
  display: inline-block;
}

.stat-number.counting {
  animation: countPulse 0.1s ease-out;
}

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

/* Stat block entrance */
.stat-block {
  transition: transform var(--anim-duration-normal) var(--anim-easing);
}

.stat-block:hover {
  transform: scale(1.05);
}

.stat-block:hover .stat-number {
  animation: numberBounce 0.5s var(--anim-easing-bounce);
}

@keyframes numberBounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

/* ========================================
   10. WHATSAPP BUTTON ANIMATION
   ======================================== */

.whatsapp-float {
  animation: whatsappPulse 2s ease-in-out infinite;
}

@keyframes whatsappPulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 6px 30px rgba(37, 211, 102, 0.6);
  }
}

.whatsapp-float:hover {
  animation: whatsappBounce 0.6s var(--anim-easing-bounce);
}

@keyframes whatsappBounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

/* ========================================
   11. PARTNERS CAROUSEL ANIMATION
   ======================================== */

.partners-track {
  transition: transform var(--anim-duration-normal) var(--anim-easing);
}

/* Infinite scroll animation */
.partners-track.auto-scroll {
  animation: partnersScroll 30s linear infinite;
}

@keyframes partnersScroll {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

.partner-logo {
  transition: transform var(--anim-duration-fast) var(--anim-easing),
              filter var(--anim-duration-fast) var(--anim-easing);
  filter: grayscale(100%);
  opacity: 0.7;
}

.partner-logo:hover {
  transform: scale(1.1);
  filter: grayscale(0%);
  opacity: 1;
}

/* ========================================
   12. TESTIMONIAL CARDS
   ======================================== */

.testimonial-card {
  transition: transform var(--anim-duration-normal) var(--anim-easing),
              box-shadow var(--anim-duration-normal) var(--anim-easing);
}

.testimonial-card:hover {
  transform: translateY(-5px) rotate(1deg);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
}

.testimonial-avatar {
  transition: transform var(--anim-duration-fast) var(--anim-easing);
}

.testimonial-card:hover .testimonial-avatar {
  transform: scale(1.1);
}

/* ========================================
   13. TEXT ANIMATIONS
   ======================================== */

/* Highlight text animation */
.highlight {
  background: linear-gradient(120deg, var(--amma-yellow) 0%, var(--amma-yellow) 100%);
  background-repeat: no-repeat;
  background-size: 0% 100%;
  background-position: 0 88%;
  transition: background-size 0.5s ease-out;
}

.highlight.animated {
  background-size: 100% 30%;
}

/* Typing effect */
.typing-text {
  overflow: hidden;
  border-right: 3px solid var(--amma-yellow);
  white-space: nowrap;
  animation: typing 3s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
  from { width: 0; }
  to { width: 100%; }
}

@keyframes blink-caret {
  from, to { border-color: transparent; }
  50% { border-color: var(--amma-yellow); }
}

/* ========================================
   14. LOADING ANIMATIONS
   ======================================== */

.skeleton {
  background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-100) 50%, var(--gray-200) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

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

/* ========================================
   15. SCROLL INDICATOR
   ======================================== */

.scroll-indicator {
  animation: scrollBounce 2s ease-in-out infinite;
}

@keyframes scrollBounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-15px);
  }
  60% {
    transform: translateY(-7px);
  }
}

/* ========================================
   16. GRADIENT ANIMATION (CTA Section)
   ======================================== */

.gradient-animated {
  background: linear-gradient(-45deg, var(--amma-yellow), var(--amma-gold), #FFD54F, var(--amma-yellow));
  background-size: 400% 400%;
  animation: gradientShift 8s ease infinite;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ========================================
   17. PARALLAX HELPERS
   ======================================== */

.parallax-slow {
  will-change: transform;
}

.parallax-medium {
  will-change: transform;
}

.parallax-fast {
  will-change: transform;
}

/* ========================================
   18. 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;
  }

  .blob,
  .confetti,
  .smiley-decoration,
  .whatsapp-float,
  .partners-track.auto-scroll {
    animation: none !important;
  }
}

/* ========================================
   19. PERFORMANCE OPTIMIZATIONS
   ======================================== */

.blob,
.confetti,
.smiley-decoration {
  will-change: transform;
  backface-visibility: hidden;
}

/* GPU acceleration for smooth animations */
[data-animate],
.card,
.btn,
.testimonial-card {
  transform: translateZ(0);
}

/* ========================================
   20. SPONSORSHIP PAGE SPECIAL ANIMATIONS
   ======================================== */

/* Step image overlay effect */
.step-image::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    135deg,
    rgba(247, 198, 0, 0.1) 0%,
    transparent 50%,
    rgba(247, 198, 0, 0.1) 100%
  );
  opacity: 0;
  transition: opacity 0.4s ease;
}

.how-it-works-step:hover .step-image::after {
  opacity: 1;
}

/* Step number badge animation */
.step-number-badge {
  animation: badgePulse 2s ease-in-out infinite;
}

/* Value card shine effect - DISABLED to prevent overflow issues */
/* .value-card::after removed */

/* Floating hearts animation */
.floating-hearts {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.floating-heart {
  position: absolute;
  font-size: 20px;
  color: var(--amma-yellow);
  opacity: 0;
  animation: floatHeart 6s ease-in-out infinite;
}

.floating-heart:nth-child(1) { left: 10%; animation-delay: 0s; }
.floating-heart:nth-child(2) { left: 25%; animation-delay: 1s; }
.floating-heart:nth-child(3) { left: 40%; animation-delay: 2s; }
.floating-heart:nth-child(4) { left: 55%; animation-delay: 3s; }
.floating-heart:nth-child(5) { left: 70%; animation-delay: 4s; }
.floating-heart:nth-child(6) { left: 85%; animation-delay: 5s; }

@keyframes floatHeart {
  0% {
    bottom: -20px;
    opacity: 0;
    transform: translateX(0) scale(0.5);
  }
  20% {
    opacity: 0.8;
  }
  100% {
    bottom: 100%;
    opacity: 0;
    transform: translateX(20px) scale(1);
  }
}

/* Sponsor badge rotation */
.sponsorship-hero-badge i {
  animation: heartPulse 1s ease-in-out infinite;
}

/* Stats counter effect */
.sponsorship-stat-number {
  background: linear-gradient(135deg, var(--amma-yellow), var(--amma-gold));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Timeline item entrance animations */
.timeline-item[data-animate].animated .timeline-dot {
  animation: popIn 0.5s var(--anim-easing-bounce);
}

@keyframes popIn {
  0% {
    transform: translateX(-50%) scale(0);
  }
  70% {
    transform: translateX(-50%) scale(1.2);
  }
  100% {
    transform: translateX(-50%) scale(1);
  }
}

/* Value card icon float */
.value-card-icon {
  animation: iconFloat 3s ease-in-out infinite;
}

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

/* Hero glow effect */
.sponsorship-hero-title .text-yellow {
  text-shadow: 0 0 40px rgba(247, 198, 0, 0.5);
}

/* CTA button special pulse */
.sponsorship-hero .btn-primary {
  position: relative;
  overflow: hidden;
}

.sponsorship-hero .btn-primary::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
}

.sponsorship-hero .btn-primary:hover::before {
  width: 300px;
  height: 300px;
}
