/* ============================================
   ANIMATIONS & MICRO-INTERACTIONS
   ============================================ */

/* CSS Custom Properties for Animation */
:root {
  --animation-duration: 0.3s;
  --animation-duration-slow: 0.6s;
  --animation-easing: cubic-bezier(0.4, 0, 0.2, 1);
  --animation-easing-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
  --animation-easing-elastic: cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Scroll-triggered animations */
@keyframes fadeInUp {
  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);
  }
}

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

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

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

/* Hover animations */
@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}

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

@keyframes bounce {
  0%, 20%, 53%, 80%, 100% {
    transform: translate3d(0, 0, 0);
  }
  40%, 43% {
    transform: translate3d(0, -8px, 0);
  }
  70% {
    transform: translate3d(0, -4px, 0);
  }
  90% {
    transform: translate3d(0, -2px, 0);
  }
}

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

@keyframes glow {
  0%, 100% {
    box-shadow: 0 0 5px rgba(203, 163, 77, 0.5);
  }
  50% {
    box-shadow: 0 0 20px rgba(203, 163, 77, 0.8), 0 0 30px rgba(203, 163, 77, 0.6);
  }
}

/* Number counter animation */
@keyframes countUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Button animations */
@keyframes ripple {
  0% {
    transform: scale(0);
    opacity: 1;
  }
  100% {
    transform: scale(4);
    opacity: 0;
  }
}

@keyframes buttonPress {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(0.95);
  }
  100% {
    transform: scale(1);
  }
}

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

@keyframes skeleton {
  0% {
    background-position: -200px 0;
  }
  100% {
    background-position: calc(200px + 100%) 0;
  }
}

/* Parallax effect */
@keyframes parallax {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(-50px);
  }
}

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

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

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

/* Card flip animation */
@keyframes flip {
  0% {
    transform: perspective(400px) rotateY(0);
  }
  40% {
    transform: perspective(400px) rotateY(-90deg);
  }
  60% {
    transform: perspective(400px) rotateY(-90deg);
  }
  100% {
    transform: perspective(400px) rotateY(0);
  }
}

/* Animation Classes */
.animate-fade-in-up {
  animation: fadeInUp 0.6s var(--animation-easing) forwards;
}

.animate-fade-in-left {
  animation: fadeInLeft 0.6s var(--animation-easing) forwards;
}

.animate-fade-in-right {
  animation: fadeInRight 0.6s var(--animation-easing) forwards;
}

.animate-fade-in-scale {
  animation: fadeInScale 0.6s var(--animation-easing) forwards;
}

.animate-slide-in-bottom {
  animation: slideInFromBottom 0.6s var(--animation-easing) forwards;
}

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

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

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

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

.animate-shake {
  animation: shake 0.5s ease-in-out;
}

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

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

/* Staggered animation delays */
.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }
.stagger-5 { animation-delay: 0.5s; }
.stagger-6 { animation-delay: 0.6s; }

/* Hover effects */
.hover-lift {
  transition: transform var(--animation-duration) var(--animation-easing);
}

.hover-lift:hover {
  transform: translateY(-5px);
}

.hover-scale {
  transition: transform var(--animation-duration) var(--animation-easing);
}

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

.hover-glow {
  transition: box-shadow var(--animation-duration) var(--animation-easing);
}

.hover-glow:hover {
  box-shadow: 0 10px 25px rgba(203, 163, 77, 0.3);
}

.hover-rotate {
  transition: transform var(--animation-duration) var(--animation-easing);
}

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

/* Button ripple effect */
.ripple {
  position: relative;
  overflow: hidden;
}

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

.ripple:active::before {
  width: 300px;
  height: 300px;
}

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

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

/* Animation triggers */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s var(--animation-easing), transform 0.6s var(--animation-easing);
}

.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Counter animation */
.counter {
  display: inline-block;
  font-weight: bold;
  color: #CBA34D;
}

.counter.animate {
  animation: countUp 0.8s var(--animation-easing) forwards;
}

/* Progress bar animation */
.progress-bar {
  width: 0%;
  height: 4px;
  background: linear-gradient(90deg, #CBA34D, #e0bb64);
  border-radius: 2px;
  transition: width 1.5s var(--animation-easing);
}

.progress-bar.animate {
  width: 100%;
}

/* Magnetic cursor effect */
.magnetic {
  transition: transform 0.3s var(--animation-easing);
}

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

/* 3D card effects */
.card-3d {
  transform-style: preserve-3d;
  transition: transform 0.3s var(--animation-easing);
}

.card-3d:hover {
  transform: rotateY(5deg) rotateX(5deg);
}

/* Text reveal animation */
.text-reveal {
  overflow: hidden;
}

.text-reveal span {
  display: inline-block;
  transform: translateY(100%);
  animation: slideInFromBottom 0.6s var(--animation-easing) forwards;
}

/* Icon animations */
.icon-bounce:hover {
  animation: bounce 0.6s var(--animation-easing-bounce);
}

.icon-rotate:hover {
  animation: spin 0.5s var(--animation-easing);
}

.icon-pulse:hover {
  animation: pulse 1s var(--animation-easing) infinite;
}

/* Parallax container */
.parallax-container {
  overflow: hidden;
  position: relative;
}

.parallax-element {
  will-change: transform;
  transition: transform 0.1s ease-out;
}

/* Gradient text animation */
.gradient-text {
  background: linear-gradient(45deg, #CBA34D, #e0bb64, #CBA34D);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 3s ease infinite;
}

/* Floating elements */
.floating {
  animation: float 3s ease-in-out infinite;
}

.floating:nth-child(2) {
  animation-delay: 0.5s;
}

.floating:nth-child(3) {
  animation-delay: 1s;
}

/* Loading states */
.loading {
  position: relative;
  pointer-events: none;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid #CBA34D;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
