/* ============================================================
   ROYAL MUGHAL WEDDING INVITATION — ANIMATIONS
   Palace of Usama & Maryam
   
   Color Palette:
   • Emerald Green:     #004D40
   • Deep Forest Green: #002D25
   • Royal Gold:        #D4AF37
   • Champagne Gold:    #E8C987
   • Rich Black:        #090807
   • Ivory:             #FFF8E7
   ============================================================ */

/* ============================================================
   1. ENTRANCE ANIMATIONS (Triggered via .animated class)
   ============================================================ */

/* Fade In (Default 30px translation) */
.animate-fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
  will-change: opacity, transform;
}

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

/* Fade In Up (50px translation) */
.animate-fade-in-up {
  opacity: 0;
  transform: translateY(50px);
  transition: opacity 1s ease-out, transform 1s ease-out;
  will-change: opacity, transform;
}

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

/* Fade In Down (-50px translation) */
.animate-fade-in-down {
  opacity: 0;
  transform: translateY(-50px);
  transition: opacity 1s ease-out, transform 1s ease-out;
  will-change: opacity, transform;
}

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

/* Fade In Left (-50px horizontal translation) */
.animate-fade-in-left {
  opacity: 0;
  transform: translateX(-50px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
  will-change: opacity, transform;
}

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

/* Fade In Right (50px horizontal translation) */
.animate-fade-in-right {
  opacity: 0;
  transform: translateX(50px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
  will-change: opacity, transform;
}

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

/* Scale In (0.8 -> 1.0) */
.animate-scale-in {
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
  will-change: opacity, transform;
}

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

/* Zoom In (0.5 -> 1.0) */
.animate-zoom-in {
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 1s ease-out, transform 1s ease-out;
  will-change: opacity, transform;
}

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

/* --- Animation Delay Utilities --- */
.delay-1 {
  transition-delay: 0.1s;
  animation-delay: 0.1s;
}

.delay-2 {
  transition-delay: 0.2s;
  animation-delay: 0.2s;
}

.delay-3 {
  transition-delay: 0.3s;
  animation-delay: 0.3s;
}

.delay-4 {
  transition-delay: 0.4s;
  animation-delay: 0.4s;
}

.delay-5 {
  transition-delay: 0.5s;
  animation-delay: 0.5s;
}

.delay-6 {
  transition-delay: 0.6s;
  animation-delay: 0.6s;
}

.delay-7 {
  transition-delay: 0.7s;
  animation-delay: 0.7s;
}

.delay-8 {
  transition-delay: 0.8s;
  animation-delay: 0.8s;
}


/* ============================================================
   2. ROYAL DOOR / ARCHWAY OPENING ANIMATION
   ============================================================ */

/* Closed State */
.door-left,
.door-right {
  transform: perspective(1200px) rotateY(0);
  transition: transform 2s cubic-bezier(0.645, 0.045, 0.355, 1);
  will-change: transform;
}

.door-left {
  transform-origin: left center;
}

.door-right {
  transform-origin: right center;
}

/* Opening State */
.doors-opening .door-left {
  transform: perspective(1200px) rotateY(-105deg);
  transition: transform 2s cubic-bezier(0.645, 0.045, 0.355, 1);
  transform-origin: left center;
}

.doors-opening .door-right {
  transform: perspective(1200px) rotateY(105deg);
  transition: transform 2s cubic-bezier(0.645, 0.045, 0.355, 1);
  transform-origin: right center;
}


/* ============================================================
   3. ROYAL MEDALLION / SEAL ANIMATIONS
   ============================================================ */

.medallion {
  animation: pulse-glow 2.5s ease-in-out infinite;
  will-change: box-shadow;
}

@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 30px rgba(212, 175, 55, 0.3), 0 0 60px rgba(212, 175, 55, 0.1);
  }
  50% {
    box-shadow: 0 0 50px rgba(212, 175, 55, 0.5), 0 0 100px rgba(212, 175, 55, 0.2);
  }
}

.medallion-tap {
  animation: medallion-burst 0.6s ease-out forwards;
}

@keyframes medallion-burst {
  0% {
    transform: scale(1);
  }
  30% {
    transform: scale(1.2);
  }
  60% {
    transform: scale(0.95);
  }
  100% {
    transform: scale(1);
    opacity: 0;
  }
}


/* ============================================================
   4. GOLD SHIMMER TEXT
   ============================================================ */

.shimmer-text {
  background: linear-gradient(90deg, #D4AF37, #E8C987, #ffffff, #E8C987, #D4AF37);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer 3s linear infinite;
  display: inline-block;
}

@keyframes shimmer {
  0% {
    background-position: -200% center;
  }
  100% {
    background-position: 200% center;
  }
}


/* ============================================================
   5. FLOATING PARTICLES & GOLD DUST
   ============================================================ */

@keyframes particle-drift {
  0% {
    transform: translateY(0) translateX(0) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateY(-100vh) translateX(50px) rotate(360deg);
    opacity: 0;
  }
}

.particle {
  animation: particle-drift var(--duration, 8s) var(--delay, 0s) infinite linear;
  will-change: transform, opacity;
}


/* ============================================================
   6. SCROLL INDICATOR ANIMATIONS
   ============================================================ */

@keyframes bounce-scroll {
  0%, 20%, 50%, 80%, 100% {
    transform: translateX(-50%) translateY(0);
  }
  40% {
    transform: translateX(-50%) translateY(-12px);
  }
  60% {
    transform: translateX(-50%) translateY(-6px);
  }
}

@keyframes fade-pulse {
  0%, 100% {
    opacity: 0.4;
  }
  50% {
    opacity: 1;
  }
}

.scroll-indicator,
.bounce-scroll {
  animation: bounce-scroll 2s ease-in-out infinite;
}

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


/* ============================================================
   7. SECTION TRANSITIONS
   ============================================================ */

.section-transition-enter {
  opacity: 0;
  transform: translateY(40px) scale(0.98);
}

.section-transition-active {
  opacity: 1;
  transform: translateY(0) scale(1);
  transition: opacity 0.8s ease, transform 0.8s ease;
  will-change: opacity, transform;
}


/* ============================================================
   8. EVENT CARD ANIMATIONS
   ============================================================ */

.event-card-enter {
  opacity: 0;
  transform: translateY(40px) rotateX(5deg);
}

.event-card-active {
  opacity: 1;
  transform: translateY(0) rotateX(0);
  transition: 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}


/* ============================================================
   9. COUNTDOWN ANIMATIONS
   ============================================================ */

.countdown-flip {
  animation: count-change 0.5s ease-out;
}

@keyframes count-change {
  0% {
    transform: translateY(-10px);
    opacity: 0;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}


/* ============================================================
   10. ORNAMENT & SVG BORDER ANIMATIONS
   ============================================================ */

@keyframes ornament-grow {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.ornament-animated {
  animation: ornament-grow 1s ease-out forwards;
}

@keyframes border-draw {
  0% {
    stroke-dashoffset: var(--dash-length, 1000);
  }
  100% {
    stroke-dashoffset: 0;
  }
}

.border-animated {
  animation: border-draw 2s ease-in-out forwards;
}


/* ============================================================
   11. ROYAL LETTER / FARMAN REVEAL
   ============================================================ */

.letter-reveal {
  clip-path: inset(100% 0 0 0);
  transition: clip-path 1.2s cubic-bezier(0.77, 0, 0.175, 1);
  will-change: clip-path;
}

.letter-reveal.revealed {
  clip-path: inset(0 0 0 0);
}


/* ============================================================
   12. CLOSING & CELEBRATION ANIMATIONS
   ============================================================ */

@keyframes golden-rain {
  0% {
    transform: translateY(-20px) rotate(0deg);
    opacity: 0;
  }
  20% {
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0;
  }
}

.golden-rain,
.golden-rain-particle {
  animation: golden-rain var(--rain-duration, 5s) linear infinite;
}

@keyframes arch-glow {
  0%, 100% {
    filter: drop-shadow(0 0 10px rgba(212, 175, 55, 0.3));
  }
  50% {
    filter: drop-shadow(0 0 25px rgba(212, 175, 55, 0.5));
  }
}

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


/* ============================================================
   13. MUSIC TOGGLE EQUALIZER WAVE
   ============================================================ */

.music-playing .music-wave {
  animation: music-wave 0.8s ease-in-out infinite alternate;
}

@keyframes music-wave {
  0% {
    height: 3px;
  }
  100% {
    height: 14px;
  }
}

.music-wave:nth-child(2) {
  animation-delay: 0.15s;
}

.music-wave:nth-child(3) {
  animation-delay: 0.3s;
}

.music-wave:nth-child(4) {
  animation-delay: 0.45s;
}


/* ============================================================
   14. RSVP MODAL ANIMATIONS
   ============================================================ */

#rsvp-modal.active {
  display: flex;
  animation: modal-in 0.4s ease;
}

@keyframes modal-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

#rsvp-modal .modal-content {
  animation: modal-slide-in 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes modal-slide-in {
  from {
    transform: translateY(30px) scale(0.95);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}


/* ============================================================
   15. ACCESSIBILITY — PREFERS-REDUCED-MOTION
   ============================================================ */

@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;
  }

  .shimmer-text {
    animation: none;
    background-size: 100%;
  }

  .medallion {
    animation: none;
  }

  .doors-opening .door-left,
  .doors-opening .door-right,
  .door-left,
  .door-right {
    transition: none !important;
  }
}
