/* BP1 Template - Animation System */

/* Base animation classes */
.animate-on-scroll {
  opacity: 0;
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.animate-in {
  opacity: 1;
  transform: translate(0, 0);
}

/* Fade animations */
.fade-in-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in-up.animate-in {
  opacity: 1;
  transform: translateY(0);
}

.fade-in-left {
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in-left.animate-in {
  opacity: 1;
  transform: translateX(0);
}

.fade-in-right {
  opacity: 0;
  transform: translateX(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in-right.animate-in {
  opacity: 1;
  transform: translateX(0);
}

.fade-in-down {
  opacity: 0;
  transform: translateY(-30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in-down.animate-in {
  opacity: 1;
  transform: translateY(0);
}

/* Scale animations */
.scale-in {
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.scale-in.animate-in {
  opacity: 1;
  transform: scale(1);
}

/* Rotate animations */
.rotate-in {
  opacity: 0;
  transform: rotate(-10deg) scale(0.8);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.rotate-in.animate-in {
  opacity: 1;
  transform: rotate(0) scale(1);
}

/* Bounce animation */
@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-20px);
  }
  60% {
    transform: translateY(-10px);
  }
}

.bounce {
  animation: bounce 2s infinite;
}

.bounce-in {
  animation: bounce 0.8s ease;
}

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

.pulse {
  animation: pulse 2s infinite;
}

.pulse-once {
  animation: pulse 0.6s ease;
}

/* Shake animation */
@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  10%, 30%, 50%, 70%, 90% {
    transform: translateX(-10px);
  }
  20%, 40%, 60%, 80% {
    transform: translateX(10px);
  }
}

.shake {
  animation: shake 0.6s ease;
}

/* Spin animation */
@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

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

/* Loading animations */
@keyframes loading-spinner {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.loading-spinner {
  animation: loading-spinner 1s linear infinite;
}

/* Loading dots */
@keyframes loading-dots {
  0%, 80%, 100% {
    opacity: 0;
  }
  40% {
    opacity: 1;
  }
}

.loading-dots span {
  animation: loading-dots 1.4s infinite ease-in-out both;
}

.loading-dots span:nth-child(1) {
  animation-delay: -0.32s;
}

.loading-dots span:nth-child(2) {
  animation-delay: -0.16s;
}

/* Skeleton loading animation */
@keyframes skeleton-loading {
  0% {
    background-position: -200px 0;
  }
  100% {
    background-position: calc(200px + 100%) 0;
  }
}

.skeleton {
  background: linear-gradient(
    90deg,
    #f0f0f0 25%,
    #e0e0e0 50%,
    #f0f0f0 75%
  );
  background-size: 200px 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
}

/* Page transition animations */
.page-transition {
  opacity: 1;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.page-transition-out {
  opacity: 0;
  transform: translateY(20px);
}

/* Hover animations */
.hover-lift {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.hover-scale {
  transition: transform 0.3s ease;
}

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

.hover-rotate {
  transition: transform 0.3s ease;
}

.hover-rotate:hover {
  transform: rotate(5deg);
}

/* Stagger animations */
.animate-children > * {
  opacity: 0;
  transition: opacity 0.5s ease, transform 0.5s ease;
  transform: translateY(20px);
}

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

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

/* Text animations */
@keyframes typewriter {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

.typewriter {
  overflow: hidden;
  border-right: 3px solid;
  white-space: nowrap;
  animation: 
    typewriter 3s steps(30, end) infinite,
    blink-caret 0.75s step-end infinite;
}

@keyframes blink-caret {
  from, to {
    border-color: transparent;
  }
  50% {
    border-color: currentColor;
  }
}

/* Glitch effect */
@keyframes glitch {
  0%, 100% {
    text-shadow: 
      2px 2px 0 #ff00ff,
      -2px -2px 0 #00ffff;
  }
  25% {
    text-shadow: 
      -2px 2px 0 #ff00ff,
      2px -2px 0 #00ffff;
  }
  50% {
    text-shadow: 
      2px -2px 0 #ff00ff,
      -2px 2px 0 #00ffff;
  }
  75% {
    text-shadow: 
      -2px -2px 0 #ff00ff,
      2px 2px 0 #00ffff;
  }
}

.glitch {
  animation: glitch 2s infinite;
}

/* Parallax animation */
.parallax {
  transform: translateZ(0);
  will-change: transform;
}

/* 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;
  }
  
  .animate-on-scroll {
    opacity: 1;
    transform: none;
  }
}

/* Animation utilities */
.animate-delay-1 { animation-delay: 0.1s; }
.animate-delay-2 { animation-delay: 0.2s; }
.animate-delay-3 { animation-delay: 0.3s; }
.animate-delay-4 { animation-delay: 0.4s; }
.animate-delay-5 { animation-delay: 0.5s; }

.animate-fast { animation-duration: 0.3s; }
.animate-normal { animation-duration: 0.6s; }
.animate-slow { animation-duration: 1s; }

.animate-ease-in { animation-timing-function: ease-in; }
.animate-ease-out { animation-timing-function: ease-out; }
.animate-ease-in-out { animation-timing-function: ease-in-out; }
.animate-linear { animation-timing-function: linear; }

/* Content loading animations */
.content-section {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.content-section.content-loaded {
  opacity: 1;
  transform: translateY(0);
}

/* Notification animations */
.notification {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.notification.show {
  opacity: 1;
  transform: translateY(0);
}

/* Modal animations */
.modal {
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.modal.show {
  opacity: 1;
  transform: scale(1);
}

/* Tooltip animations */
.tooltip {
  opacity: 0;
  transform: translateY(5px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.tooltip.show {
  opacity: 1;
  transform: translateY(0);
}

/* Button animations */
.btn {
  transition: all 0.3s ease;
}

.btn:active {
  transform: scale(0.95);
}

/* Loading states */
.loading-state {
  position: relative;
  overflow: hidden;
}

.loading-state::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.4),
    transparent
  );
  animation: loading-shimmer 1.5s infinite;
}

@keyframes loading-shimmer {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}

/* Progress bar animation */
@keyframes progress-bar {
  0% {
    width: 0%;
  }
}

.progress-bar {
  animation: progress-bar 2s ease-out forwards;
}

/* Heart beat animation for likes */
@keyframes heart-beat {
  0%, 100% {
    transform: scale(1);
  }
  10%, 30% {
    transform: scale(1.3);
  }
  20% {
    transform: scale(0.9);
  }
}

.heart-beat {
  animation: heart-beat 0.8s ease;
}

/* Slide animations */
.slide-in-right {
  transform: translateX(100%);
  transition: transform 0.3s ease;
}

.slide-in-right.show {
  transform: translateX(0);
}

.slide-in-left {
  transform: translateX(-100%);
  transition: transform 0.3s ease;
}

.slide-in-left.show {
  transform: translateX(0);
}

.slide-in-up {
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.slide-in-up.show {
  transform: translateY(0);
}

.slide-in-down {
  transform: translateY(-100%);
  transition: transform 0.3s ease;
}

.slide-in-down.show {
  transform: translateY(0);
}

/* Fade toggle */
.fade-enter {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.fade-enter.fade-enter-active {
  opacity: 1;
}

.fade-exit {
  opacity: 1;
  transition: opacity 0.3s ease;
}

.fade-exit.fade-exit-active {
  opacity: 0;
}