/* ===== KEYFRAMES ===== */

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

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

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

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

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

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

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

@keyframes floatDrift {
  0%, 100% {
    transform: translate(0, 0) rotate(0deg);
  }
  33% {
    transform: translate(30px, -20px) rotate(120deg);
  }
  66% {
    transform: translate(-20px, -30px) rotate(240deg);
  }
}

@keyframes breatheGlow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(201, 151, 58, 0.3),
                inset 0 0 20px rgba(201, 151, 58, 0.1);
  }
  50% {
    box-shadow: 0 0 40px rgba(201, 151, 58, 0.5),
                inset 0 0 30px rgba(201, 151, 58, 0.2);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

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

@keyframes countUp {
  from {
    content: '0';
  }
}

/* ===== SCROLL REVEAL ===== */

.scroll-reveal {
  opacity: 0;
  transform: translateY(50px);
  animation: fadeUp 0.8s var(--transition-normal) forwards;
}

.scroll-reveal.in-view {
  animation: fadeUp 0.8s ease-out forwards;
}

.scroll-reveal.stagger-1 {
  animation-delay: 0.1s;
}

.scroll-reveal.stagger-2 {
  animation-delay: 0.2s;
}

.scroll-reveal.stagger-3 {
  animation-delay: 0.3s;
}

.scroll-reveal.stagger-4 {
  animation-delay: 0.4s;
}

/* ===== HEADING ANIMATIONS ===== */

.h1-animate {
  opacity: 0;
}

.h1-animate.loaded {
  animation: fadeUp 0.6s ease-out forwards;
}

.h1-animate.loaded + .subheading-animate {
  animation: slideInUp 0.6s ease-out 0.3s forwards;
}

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

/* Stagger words animation */
.word {
  display: inline-block;
  opacity: 0;
  animation: fadeIn 0.6s ease-out forwards;
}

.word:nth-child(1) { animation-delay: 0.0s; }
.word:nth-child(2) { animation-delay: 0.1s; }
.word:nth-child(3) { animation-delay: 0.2s; }
.word:nth-child(4) { animation-delay: 0.3s; }
.word:nth-child(5) { animation-delay: 0.4s; }
.word:nth-child(6) { animation-delay: 0.5s; }

/* ===== PARALLAX ===== */

.parallax-bg {
  background-attachment: fixed;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

/* ===== CARD ANIMATIONS ===== */

.card-animate {
  opacity: 0;
  transform: translateY(30px);
}

.card-animate.in-view {
  animation: fadeUp 0.6s ease-out forwards;
}

.card:hover {
  animation: none;
}

.card-icon {
  display: inline-block;
  font-size: 3rem;
  animation: float 3s ease-in-out infinite;
}

.card:hover .card-icon {
  animation: float 2s ease-in-out infinite;
}

/* ===== STAT COUNTER ===== */

.stat-counter {
  font-size: 3.5rem;
  font-weight: 700;
  color: var(--accent-gold);
  font-family: var(--font-display);
}

.stat-label {
  font-size: var(--fs-lg);
  color: var(--text-white);
  margin-top: var(--spacing-md);
}

/* ===== CTA ANIMATIONS ===== */

.btn:hover::before {
  animation: ripple 0.6s ease-out;
}

@keyframes ripple {
  0% {
    width: 0;
    height: 0;
    opacity: 0.6;
  }
  100% {
    width: 300px;
    height: 300px;
    opacity: 0;
  }
}

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

/* ===== CAROUSEL ANIMATIONS ===== */

.carousel-item {
  opacity: 0;
  animation: fadeIn 0.5s ease-in-out forwards;
}

.carousel-item.active {
  animation: fadeIn 0.5s ease-in-out;
}

/* ===== TESTIMONIAL CROSSFADE ===== */

.testimonial-fade-enter {
  animation: fadeIn 0.5s ease-in;
}

.testimonial-fade-exit {
  animation: fadeOut 0.5s ease-out;
}

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

/* ===== 3D TILT EFFECT ===== */

.tilt-card {
  perspective: 1200px;
  transform-style: preserve-3d;
  transition: transform 0.3s ease-out;
}

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

/* Enhanced 3D Card Effects */
.card-3d {
  will-change: transform;
  transition: all 0.4s cubic-bezier(0.23, 1, 0.320, 1);
}

.card-3d:hover {
  will-change: transform, box-shadow;
}

/* Scroll Reveal Enhancements */
.scroll-reveal {
  will-change: opacity, transform;
}

.scroll-reveal.visible {
  will-change: auto;
}

/* Parallax Effect Enhancement */
.hero__parallax-bg {
  will-change: transform;
}

/* ===== LOADER ANIMATIONS ===== */

.skeleton {
  background: linear-gradient(
    90deg,
    var(--surface-light) 0%,
    var(--surface-light) 40%,
    var(--surface-light) 50%,
    var(--surface-light) 60%,
    var(--surface-light) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
}

/* ===== UNDERLINE ANIMATIONS ===== */

.underline-animate {
  position: relative;
  display: inline-block;
}

.underline-animate::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--accent-gold);
  transition: width var(--transition-normal);
}

.underline-animate:hover::after {
  width: 100%;
}

/* ===== FLOATING SHAPES ===== */

.float-shape {
  position: absolute;
  opacity: 0.1;
  animation: floatDrift 20s ease-in-out infinite;
}

.float-shape:nth-child(1) {
  animation-delay: 0s;
}

.float-shape:nth-child(2) {
  animation-delay: 5s;
}

.float-shape:nth-child(3) {
  animation-delay: 10s;
}

.float-shape:nth-child(4) {
  animation-delay: 15s;
}

.circle-shape {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--accent-gold), var(--primary-navy));
}

.square-shape {
  width: 150px;
  height: 150px;
  background: linear-gradient(135deg, var(--primary-navy), var(--accent-gold));
}

.hex-shape {
  width: 180px;
  height: 180px;
  background: var(--accent-gold);
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
}

/* ===== UTILITY ANIMATIONS ===== */

.animate-none {
  animation: none !important;
}

.transition-smooth {
  transition: all var(--transition-normal) ease-in-out;
}

.transition-fast {
  transition: all var(--transition-fast) ease-in-out;
}

.transition-slow {
  transition: all var(--transition-slow) ease-in-out;
}

/* ===== MEDIA QUERIES ===== */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 768px) {
  .float-shape {
    display: none;
  }

  h1 {
    animation-duration: 0.4s !important;
  }

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