/* ==========================================
   WEDDING WEBSITE - ANIMATIONS
   ========================================== */

/* ==========================================
   KEYFRAME ANIMATIONS
   ========================================== */

/* Fade In Up */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fade In Down */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fade In Left */
@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Fade In Right */
@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Scale In */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Rotate In */
@keyframes rotateIn {
    from {
        opacity: 0;
        transform: rotate(-10deg) scale(0.9);
    }
    to {
        opacity: 1;
        transform: rotate(0) scale(1);
    }
}

/* Float Animation */
@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

/* Shimmer Effect */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Sparkle */
@keyframes sparkle {
    0%, 100% {
        opacity: 0;
        transform: scale(0);
    }
    50% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Swing */
@keyframes swing {
    0%, 100% {
        transform: rotate(-3deg);
    }
    50% {
        transform: rotate(3deg);
    }
}

/* Glow */
@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(183, 110, 121, 0.5);
    }
    50% {
        box-shadow: 0 0 30px rgba(183, 110, 121, 0.8);
    }
}

/* Heart Beat */
@keyframes heartBeat {
    0%, 100% {
        transform: scale(1);
    }
    14% {
        transform: scale(1.3);
    }
    28% {
        transform: scale(1);
    }
    42% {
        transform: scale(1.3);
    }
    70% {
        transform: scale(1);
    }
}

/* Ripple */
@keyframes ripple {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

/* Typewriter */
@keyframes typewriter {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

/* Blink */
@keyframes blink {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0;
    }
}

/* Confetti Fall */
@keyframes confettiFall {
    0% {
        transform: translateY(-100vh) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* Petal Fall */
@keyframes petalFall {
    0% {
        transform: translateY(-100px) translateX(0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) translateX(100px) rotate(720deg);
        opacity: 0;
    }
}

/* ==========================================
   SCROLL ANIMATIONS
   ========================================== */

.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.animate-on-scroll.animated {
    opacity: 1;
    transform: translateY(0);
}

/* Different animation variants */
.animate-on-scroll[data-animation="fade-left"] {
    transform: translateX(-50px);
}

.animate-on-scroll[data-animation="fade-left"].animated {
    transform: translateX(0);
}

.animate-on-scroll[data-animation="fade-right"] {
    transform: translateX(50px);
}

.animate-on-scroll[data-animation="fade-right"].animated {
    transform: translateX(0);
}

.animate-on-scroll[data-animation="scale"] {
    transform: scale(0.8);
}

.animate-on-scroll[data-animation="scale"].animated {
    transform: scale(1);
}

.animate-on-scroll[data-animation="rotate"] {
    transform: rotate(-5deg) scale(0.9);
}

.animate-on-scroll[data-animation="rotate"].animated {
    transform: rotate(0) scale(1);
}

/* Animation delays for staggered effects */
.animate-on-scroll:nth-child(1) { transition-delay: 0s; }
.animate-on-scroll:nth-child(2) { transition-delay: 0.1s; }
.animate-on-scroll:nth-child(3) { transition-delay: 0.2s; }
.animate-on-scroll:nth-child(4) { transition-delay: 0.3s; }
.animate-on-scroll:nth-child(5) { transition-delay: 0.4s; }
.animate-on-scroll:nth-child(6) { transition-delay: 0.5s; }
.animate-on-scroll:nth-child(7) { transition-delay: 0.6s; }
.animate-on-scroll:nth-child(8) { transition-delay: 0.7s; }

/* ==========================================
   HOVER ANIMATIONS
   ========================================== */

/* Lift effect */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* Grow effect */
.hover-grow {
    transition: transform 0.3s ease;
}

.hover-grow:hover {
    transform: scale(1.05);
}

/* Glow effect */
.hover-glow {
    transition: box-shadow 0.3s ease;
}

.hover-glow:hover {
    box-shadow: 0 0 30px rgba(183, 110, 121, 0.5);
}

/* Shine effect */
.hover-shine {
    position: relative;
    overflow: hidden;
}

.hover-shine::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    transition: left 0.5s ease;
}

.hover-shine:hover::before {
    left: 100%;
}

/* Underline grow */
.hover-underline {
    position: relative;
}

.hover-underline::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width 0.3s ease, left 0.3s ease;
}

.hover-underline:hover::after {
    width: 100%;
    left: 0;
}

/* Icon rotate */
.hover-rotate-icon i {
    transition: transform 0.3s ease;
}

.hover-rotate-icon:hover i {
    transform: rotate(360deg);
}

/* ==========================================
   SPECIAL EFFECTS
   ========================================== */

/* Parallax layers */
.parallax-layer {
    will-change: transform;
}

/* Gradient text animation */
.gradient-text {
    background: linear-gradient(
        90deg,
        var(--primary-color),
        var(--gold),
        var(--primary-dark),
        var(--primary-color)
    );
    background-size: 300% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 3s linear infinite;
}

/* Glowing border */
.glow-border {
    position: relative;
}

.glow-border::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(
        45deg,
        var(--primary-color),
        var(--gold),
        var(--primary-light),
        var(--primary-dark)
    );
    background-size: 400% 400%;
    border-radius: inherit;
    z-index: -1;
    animation: shimmer 3s ease infinite;
    filter: blur(5px);
    opacity: 0.7;
}

/* Floating animation class */
.floating {
    animation: float 3s ease-in-out infinite;
}

/* Pulsing animation class */
.pulsing {
    animation: pulse 2s ease-in-out infinite;
}

/* ==========================================
   CONFETTI EFFECT (For RSVP success)
   ========================================== */

.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    opacity: 0;
}

.confetti.active {
    animation: confettiFall 3s linear forwards;
}

/* ==========================================
   PETAL EFFECT
   ========================================== */

.petal-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.petal {
    position: absolute;
    font-size: 20px;
    opacity: 0;
    animation: petalFall 10s linear infinite;
}

.petal:nth-child(1) { left: 5%; animation-delay: 0s; }
.petal:nth-child(2) { left: 15%; animation-delay: 1.5s; }
.petal:nth-child(3) { left: 25%; animation-delay: 3s; }
.petal:nth-child(4) { left: 35%; animation-delay: 4.5s; }
.petal:nth-child(5) { left: 45%; animation-delay: 6s; }
.petal:nth-child(6) { left: 55%; animation-delay: 7.5s; }
.petal:nth-child(7) { left: 65%; animation-delay: 9s; }
.petal:nth-child(8) { left: 75%; animation-delay: 2s; }
.petal:nth-child(9) { left: 85%; animation-delay: 5s; }
.petal:nth-child(10) { left: 95%; animation-delay: 8s; }

/* ==========================================
   PAGE TRANSITIONS
   ========================================== */

.page-transition {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--primary-color);
    z-index: 10000;
    transform: translateY(100%);
    transition: transform 0.5s ease;
}

.page-transition.active {
    transform: translateY(0);
}

/* ==========================================
   LOADING ANIMATIONS
   ========================================== */

/* Skeleton loading */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--gray-lighter) 25%,
        #f0f0f0 50%,
        var(--gray-lighter) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}

.skeleton-text {
    height: 16px;
    margin-bottom: 10px;
}

.skeleton-title {
    height: 24px;
    width: 60%;
    margin-bottom: 15px;
}

.skeleton-image {
    height: 200px;
    border-radius: 10px;
}

/* ==========================================
   BUTTON ANIMATIONS
   ========================================== */

.btn-animated {
    position: relative;
    overflow: hidden;
}

.btn-animated::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.btn-animated:hover::before {
    width: 300px;
    height: 300px;
}

/* Ripple effect on click */
.btn-ripple {
    position: relative;
    overflow: hidden;
}

.btn-ripple .ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transform: scale(0);
    animation: ripple 0.6s linear;
    pointer-events: none;
}

/* ==========================================
   TEXT ANIMATIONS
   ========================================== */

/* Letter spacing animation */
.text-spread {
    letter-spacing: 0;
    transition: letter-spacing 0.3s ease;
}

.text-spread:hover {
    letter-spacing: 5px;
}

/* Text reveal */
.text-reveal {
    position: relative;
    overflow: hidden;
}

.text-reveal span {
    display: inline-block;
    transform: translateY(100%);
    animation: fadeInUp 0.5s ease forwards;
}

/* Staggered text reveal */
.text-stagger span {
    display: inline-block;
    opacity: 0;
    transform: translateY(20px);
}

.text-stagger.animate span {
    animation: fadeInUp 0.5s ease forwards;
}

.text-stagger span:nth-child(1) { animation-delay: 0s; }
.text-stagger span:nth-child(2) { animation-delay: 0.05s; }
.text-stagger span:nth-child(3) { animation-delay: 0.1s; }
.text-stagger span:nth-child(4) { animation-delay: 0.15s; }
.text-stagger span:nth-child(5) { animation-delay: 0.2s; }
.text-stagger span:nth-child(6) { animation-delay: 0.25s; }
.text-stagger span:nth-child(7) { animation-delay: 0.3s; }
.text-stagger span:nth-child(8) { animation-delay: 0.35s; }
.text-stagger span:nth-child(9) { animation-delay: 0.4s; }
.text-stagger span:nth-child(10) { animation-delay: 0.45s; }

/* ==========================================
   CURSOR ANIMATIONS
   ========================================== */

.custom-cursor {
    position: fixed;
    width: 20px;
    height: 20px;
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    pointer-events: none;
    z-index: 10000;
    transition: transform 0.15s ease, opacity 0.15s ease;
    mix-blend-mode: difference;
}

.custom-cursor.hover {
    transform: scale(1.5);
    background: rgba(183, 110, 121, 0.3);
}

/* ==========================================
   REDUCED MOTION
   ========================================== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .animate-on-scroll {
        opacity: 1;
        transform: none;
    }
    
    .floating,
    .pulsing {
        animation: none;
    }
}
