/* Global Animations - HoneyFunny2 */

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Section transitions - долитащ ефект при скролване */
section {
  opacity: 0;
  transform: translateY(80px) scale(0.95);
  transition: opacity 1.2s cubic-bezier(0.34, 1.56, 0.64, 1),
              transform 1.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

section.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Wrapper за секциите също да има долитащ ефект */
.section-wrapper {
  opacity: 0;
  transform: translateY(80px) scale(0.95);
  transition: opacity 1.2s cubic-bezier(0.34, 1.56, 0.64, 1),
              transform 1.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.section-wrapper.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* When we programmatically navigate, temporarily suppress entrance animations
   to prevent layout shifts from moving the scrolled-to target. Toggled by JS. */
body.suppress-section-animations section,
body.suppress-section-animations .section-wrapper,
body.suppress-section-animations .animate-children > * {
  transition: none !important;
  transform: none !important;
  opacity: 1 !important;
}

/* Stagger animations for children - долитащ ефект */
.animate-children > * {
  opacity: 0;
  transform: translateY(50px) scale(0.9);
  transition: opacity 0.8s cubic-bezier(0.34, 1.56, 0.64, 1),
              transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.animate-children.visible > *:nth-child(1) { transition-delay: 0.1s; }
.animate-children.visible > *:nth-child(2) { transition-delay: 0.2s; }
.animate-children.visible > *:nth-child(3) { transition-delay: 0.3s; }
.animate-children.visible > *:nth-child(4) { transition-delay: 0.4s; }
.animate-children.visible > *:nth-child(5) { transition-delay: 0.5s; }
.animate-children.visible > *:nth-child(6) { transition-delay: 0.6s; }

.animate-children.visible > * {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Fade animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(60px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-60px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(60px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes slideInFromBottom {
  from {
    opacity: 0;
    transform: translateY(120px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Utility animation classes */
.fade-in {
  animation: fadeIn 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.fade-in-up {
  animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.fade-in-left {
  animation: fadeInLeft 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.fade-in-right {
  animation: fadeInRight 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.scale-in {
  animation: scaleIn 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.slide-in-bottom {
  animation: slideInFromBottom 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Parallax effect */
.parallax {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Hover grow effect */
.hover-grow {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-grow:hover {
  transform: translateY(-8px) scale(1.02);
}

/* Float animation for decorative elements */
@keyframes float {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
  }
  25% {
    transform: translateY(-15px) rotate(2deg);
  }
  50% {
    transform: translateY(-8px) rotate(-2deg);
  }
  75% {
    transform: translateY(-12px) rotate(1deg);
  }
}

.floating {
  animation: float 6s ease-in-out infinite;
}

/* Pulse effect */
@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

.pulse {
  animation: pulse 2s ease-in-out infinite;
}

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

.shimmer {
  background: linear-gradient(90deg, 
    transparent 0%, 
    rgba(255, 255, 255, 0.4) 50%, 
    transparent 100%);
  background-size: 1000px 100%;
  animation: shimmer 3s infinite;
}

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

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

/* Rotate subtle */
@keyframes rotateSubtle {
  0%, 100% {
    transform: rotate(-2deg);
  }
  50% {
    transform: rotate(2deg);
  }
}

.rotate-subtle {
  animation: rotateSubtle 4s ease-in-out infinite;
}

/* Glow effect */
@keyframes glow {
  0%, 100% {
    box-shadow: 0 0 5px rgba(255, 152, 0, 0.3);
  }
  50% {
    box-shadow: 0 0 20px rgba(255, 152, 0, 0.6),
                0 0 30px rgba(255, 152, 0, 0.4);
  }
}

.glow {
  animation: glow 2s ease-in-out infinite;
}

/* Page transition */
@keyframes pageTransition {
  from {
    opacity: 0;
    transform: scale(0.98);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

body {
  animation: pageTransition 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  html {
    scroll-behavior: auto;
  }
}
