/* ==========================================================================
   Animations Utility Styles
   ONLY using: golden-green (#8B9A46), dark-red (#8B2C2C), pale-yellow (#FFF8DC)
   ========================================================================== */

/* Animation Variables */
:root {
  --duration-fast: 150ms;
  --duration-base: 250ms;
  --duration-slow: 350ms;
  --duration-slower: 500ms;
  --duration-slowest: 1000ms;
  
  --easing-linear: linear;
  --easing-ease: ease;
  --easing-ease-in: ease-in;
  --easing-ease-out: ease-out;
  --easing-ease-in-out: ease-in-out;
  --easing-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
  --easing-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

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

@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

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

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

/* Scale Animations */
@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes scaleOut {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(0.8);
  }
}

@keyframes scaleUp {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(1.05);
  }
}

@keyframes scaleDown {
  from {
    transform: scale(1.05);
  }
  to {
    transform: scale(1);
  }
}

/* Slide Animations */
@keyframes slideInUp {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

@keyframes slideInDown {
  from {
    transform: translateY(-100%);
  }
  to {
    transform: translateY(0);
  }
}

@keyframes slideInLeft {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}

@keyframes slideOutUp {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(-100%);
  }
}

@keyframes slideOutDown {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(100%);
  }
}

@keyframes slideOutLeft {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-100%);
  }
}

@keyframes slideOutRight {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(100%);
  }
}

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

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

/* Bounce Animations */
@keyframes bounce {
  0%, 20%, 53%, 80%, 100% {
    animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000);
    transform: translate3d(0,0,0);
  }
  40%, 43% {
    animation-timing-function: cubic-bezier(0.755, 0.050, 0.855, 0.060);
    transform: translate3d(0, -30px, 0);
  }
  70% {
    animation-timing-function: cubic-bezier(0.755, 0.050, 0.855, 0.060);
    transform: translate3d(0, -15px, 0);
  }
  90% {
    transform: translate3d(0,-4px,0);
  }
}

@keyframes bounceIn {
  from,
  20%,
  40%,
  60%,
  80%,
  to {
    animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
  }
  0% {
    opacity: 0;
    transform: scale3d(0.3, 0.3, 0.3);
  }
  20% {
    transform: scale3d(1.1, 1.1, 1.1);
  }
  40% {
    transform: scale3d(0.9, 0.9, 0.9);
  }
  60% {
    opacity: 1;
    transform: scale3d(1.03, 1.03, 1.03);
  }
  80% {
    transform: scale3d(0.97, 0.97, 0.97);
  }
  to {
    opacity: 1;
    transform: scale3d(1, 1, 1);
  }
}

/* Shake Animation */
@keyframes shake {
  from,
  to {
    transform: translate3d(0, 0, 0);
  }
  10%,
  30%,
  50%,
  70%,
  90% {
    transform: translate3d(-10px, 0, 0);
  }
  20%,
  40%,
  60%,
  80% {
    transform: translate3d(10px, 0, 0);
  }
}

/* Pulse Animation */
@keyframes pulse {
  from {
    transform: scale3d(1, 1, 1);
  }
  50% {
    transform: scale3d(1.05, 1.05, 1.05);
  }
  to {
    transform: scale3d(1, 1, 1);
  }
}

@keyframes pulseGlow {
  0% {
    box-shadow: 0 0 0 0 rgba(139, 154, 70, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(139, 154, 70, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(139, 154, 70, 0);
  }
}

/* Wobble Animation */
@keyframes wobble {
  from {
    transform: translate3d(0, 0, 0);
  }
  15% {
    transform: translate3d(-25%, 0, 0) rotate3d(0, 0, 1, -5deg);
  }
  30% {
    transform: translate3d(20%, 0, 0) rotate3d(0, 0, 1, 3deg);
  }
  45% {
    transform: translate3d(-15%, 0, 0) rotate3d(0, 0, 1, -3deg);
  }
  60% {
    transform: translate3d(10%, 0, 0) rotate3d(0, 0, 1, 2deg);
  }
  75% {
    transform: translate3d(-5%, 0, 0) rotate3d(0, 0, 1, -1deg);
  }
  to {
    transform: translate3d(0, 0, 0);
  }
}

/* Float Animation */
@keyframes float {
  0% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-20px);
  }
  100% {
    transform: translateY(0px);
  }
}

/* Flip Animations */
@keyframes flipInX {
  from {
    transform: perspective(400px) rotate3d(1, 0, 0, 90deg);
    animation-timing-function: ease-in;
    opacity: 0;
  }
  40% {
    transform: perspective(400px) rotate3d(1, 0, 0, -20deg);
    animation-timing-function: ease-in;
  }
  60% {
    transform: perspective(400px) rotate3d(1, 0, 0, 10deg);
    opacity: 1;
  }
  80% {
    transform: perspective(400px) rotate3d(1, 0, 0, -5deg);
  }
  to {
    transform: perspective(400px);
  }
}

@keyframes flipInY {
  from {
    transform: perspective(400px) rotate3d(0, 1, 0, 90deg);
    animation-timing-function: ease-in;
    opacity: 0;
  }
  40% {
    transform: perspective(400px) rotate3d(0, 1, 0, -20deg);
    animation-timing-function: ease-in;
  }
  60% {
    transform: perspective(400px) rotate3d(0, 1, 0, 10deg);
    opacity: 1;
  }
  80% {
    transform: perspective(400px) rotate3d(0, 1, 0, -5deg);
  }
  to {
    transform: perspective(400px);
  }
}

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

@keyframes loadingDots {
  0%, 80%, 100% {
    opacity: 0;
    transform: scale(0.8);
  }
  40% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes loadingBars {
  0%, 40%, 100% {
    transform: scaleY(0.4);
  }
  20% {
    transform: scaleY(1);
  }
}

/* Typing Animation */
@keyframes typing {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

@keyframes blink {
  0%, 50% {
    border-color: transparent;
  }
  51%, 100% {
    border-color: currentColor;
  }
}

/* Gradient Animation */
@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* Animation Utility Classes */
.animate-fade-in {
  animation: fadeIn var(--duration-base) var(--easing-ease-out);
}

.animate-fade-out {
  animation: fadeOut var(--duration-base) var(--easing-ease-out);
}

.animate-fade-in-up {
  animation: fadeInUp var(--duration-base) var(--easing-ease-out);
}

.animate-fade-in-down {
  animation: fadeInDown var(--duration-base) var(--easing-ease-out);
}

.animate-fade-in-left {
  animation: fadeInLeft var(--duration-base) var(--easing-ease-out);
}

.animate-fade-in-right {
  animation: fadeInRight var(--duration-base) var(--easing-ease-out);
}

.animate-scale-in {
  animation: scaleIn var(--duration-base) var(--easing-ease-out);
}

.animate-scale-out {
  animation: scaleOut var(--duration-base) var(--easing-ease-out);
}

.animate-slide-in-up {
  animation: slideInUp var(--duration-base) var(--easing-ease-out);
}

.animate-slide-in-down {
  animation: slideInDown var(--duration-base) var(--easing-ease-out);
}

.animate-slide-in-left {
  animation: slideInLeft var(--duration-base) var(--easing-ease-out);
}

.animate-slide-in-right {
  animation: slideInRight var(--duration-base) var(--easing-ease-out);
}

.animate-bounce {
  animation: bounce var(--duration-slowest) infinite;
}

.animate-bounce-in {
  animation: bounceIn var(--duration-slow) var(--easing-ease-out);
}

.animate-shake {
  animation: shake var(--duration-slower) var(--easing-ease-in-out);
}

.animate-pulse {
  animation: pulse var(--duration-slowest) infinite;
}

.animate-pulse-glow {
  animation: pulseGlow var(--duration-slowest) infinite;
}

.animate-wobble {
  animation: wobble var(--duration-slowest) var(--easing-ease-in-out);
}

.animate-float {
  animation: float 3s ease-in-out infinite;
}

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

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

.animate-flip-in-x {
  animation: flipInX var(--duration-slow) var(--easing-ease-out);
}

.animate-flip-in-y {
  animation: flipInY var(--duration-slow) var(--easing-ease-out);
}

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

.animate-gradient {
  background-size: 400% 400%;
  animation: gradientShift 4s ease infinite;
}

/* Animation Duration Utilities */
.animate-fast {
  animation-duration: var(--duration-fast) !important;
}

.animate-slow {
  animation-duration: var(--duration-slow) !important;
}

.animate-slower {
  animation-duration: var(--duration-slower) !important;
}

.animate-slowest {
  animation-duration: var(--duration-slowest) !important;
}

/* Animation Delay Utilities */
.animate-delay-100 {
  animation-delay: 100ms;
}

.animate-delay-200 {
  animation-delay: 200ms;
}

.animate-delay-300 {
  animation-delay: 300ms;
}

.animate-delay-500 {
  animation-delay: 500ms;
}

.animate-delay-700 {
  animation-delay: 700ms;
}

.animate-delay-1000 {
  animation-delay: 1000ms;
}

/* Animation Fill Mode Utilities */
.animate-fill-forwards {
  animation-fill-mode: forwards;
}

.animate-fill-backwards {
  animation-fill-mode: backwards;
}

.animate-fill-both {
  animation-fill-mode: both;
}

/* Animation Iteration Utilities */
.animate-infinite {
  animation-iteration-count: infinite;
}

.animate-once {
  animation-iteration-count: 1;
}

.animate-twice {
  animation-iteration-count: 2;
}

/* Animation State Utilities */
.animate-paused {
  animation-play-state: paused;
}

.animate-running {
  animation-play-state: running;
}

/* Transition Utilities */
.transition-none {
  transition: none;
}

.transition-all {
  transition: all var(--duration-base) var(--easing-ease-in-out);
}

.transition-colors {
  transition: color var(--duration-base) var(--easing-ease-in-out),
              background-color var(--duration-base) var(--easing-ease-in-out),
              border-color var(--duration-base) var(--easing-ease-in-out);
}

.transition-opacity {
  transition: opacity var(--duration-base) var(--easing-ease-in-out);
}

.transition-shadow {
  transition: box-shadow var(--duration-base) var(--easing-ease-in-out);
}

.transition-transform {
  transition: transform var(--duration-base) var(--easing-ease-in-out);
}

/* Transform Utilities */
.transform {
  transform: translateZ(0); /* Enable 3D acceleration */
}

.scale-0 {
  transform: scale(0);
}

.scale-50 {
  transform: scale(0.5);
}

.scale-75 {
  transform: scale(0.75);
}

.scale-90 {
  transform: scale(0.9);
}

.scale-95 {
  transform: scale(0.95);
}

.scale-100 {
  transform: scale(1);
}

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

.scale-110 {
  transform: scale(1.1);
}

.scale-125 {
  transform: scale(1.25);
}

.scale-150 {
  transform: scale(1.5);
}

.rotate-0 {
  transform: rotate(0deg);
}

.rotate-45 {
  transform: rotate(45deg);
}

.rotate-90 {
  transform: rotate(90deg);
}

.rotate-180 {
  transform: rotate(180deg);
}

.rotate-270 {
  transform: rotate(270deg);
}

.translate-x-0 {
  transform: translateX(0);
}

.translate-y-0 {
  transform: translateY(0);
}

.translate-x-1 {
  transform: translateX(0.25rem);
}

.translate-y-1 {
  transform: translateY(0.25rem);
}

.-translate-x-1 {
  transform: translateX(-0.25rem);
}

.-translate-y-1 {
  transform: translateY(-0.25rem);
}

/* Hover Animations */
.hover-scale:hover {
  transform: scale(1.05);
  transition: transform var(--duration-base) var(--easing-ease-out);
}

.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 30px rgba(139, 44, 44, 0.2);
  transition: all var(--duration-base) var(--easing-ease-out);
}

.hover-glow:hover {
  box-shadow: 0 0 20px rgba(139, 154, 70, 0.4);
  transition: box-shadow var(--duration-base) var(--easing-ease-out);
}

.hover-rotate:hover {
  transform: rotate(5deg);
  transition: transform var(--duration-base) var(--easing-ease-out);
}

.hover-skew:hover {
  transform: skew(-2deg, -1deg);
  transition: transform var(--duration-base) var(--easing-ease-out);
}

/* Scroll Animations */
.scroll-fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: all var(--duration-slow) var(--easing-ease-out);
}

.scroll-fade-in.in-view {
  opacity: 1;
  transform: translateY(0);
}

.scroll-slide-left {
  opacity: 0;
  transform: translateX(-50px);
  transition: all var(--duration-slow) var(--easing-ease-out);
}

.scroll-slide-left.in-view {
  opacity: 1;
  transform: translateX(0);
}

.scroll-slide-right {
  opacity: 0;
  transform: translateX(50px);
  transition: all var(--duration-slow) var(--easing-ease-out);
}

.scroll-slide-right.in-view {
  opacity: 1;
  transform: translateX(0);
}

.scroll-scale-in {
  opacity: 0;
  transform: scale(0.8);
  transition: all var(--duration-slow) var(--easing-ease-out);
}

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

/* Loading Spinner Components */
.spinner {
  width: 24px;
  height: 24px;
  border: 2px solid rgba(139, 154, 70, 0.2);
  border-top-color: var(--golden-green);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.spinner-lg {
  width: 40px;
  height: 40px;
  border-width: 3px;
}

.spinner-sm {
  width: 16px;
  height: 16px;
  border-width: 1px;
}

.dots-loader {
  display: flex;
  gap: 4px;
}

.dots-loader > div {
  width: 8px;
  height: 8px;
  background: var(--golden-green);
  border-radius: 50%;
  animation: loadingDots 1.4s ease-in-out infinite both;
}

.dots-loader > div:nth-child(1) { animation-delay: -0.32s; }
.dots-loader > div:nth-child(2) { animation-delay: -0.16s; }
.dots-loader > div:nth-child(3) { animation-delay: 0s; }

.bars-loader {
  display: flex;
  gap: 2px;
  align-items: end;
}

.bars-loader > div {
  width: 4px;
  height: 20px;
  background: var(--golden-green);
  animation: loadingBars 1.2s ease-in-out infinite;
}

.bars-loader > div:nth-child(1) { animation-delay: -1.1s; }
.bars-loader > div:nth-child(2) { animation-delay: -1.0s; }
.bars-loader > div:nth-child(3) { animation-delay: -0.9s; }
.bars-loader > div:nth-child(4) { animation-delay: -0.8s; }

/* 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-bounce,
  .animate-pulse,
  .animate-spin,
  .animate-float,
  .spinner,
  .dots-loader > div,
  .bars-loader > div {
    animation: none !important;
  }
  
  .scroll-fade-in,
  .scroll-slide-left,
  .scroll-slide-right,
  .scroll-scale-in {
    opacity: 1 !important;
    transform: none !important;
  }
}