/* ========================================
   ANIMATIONS & TRANSITIONS
   Elegant Wedding Biodata Animations
   ======================================== */

/* ========================================
   AOS (Animate On Scroll) - Custom Implementation
   ======================================== */
[data-aos] {
    opacity: 0;
    transition: transform 0.9s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.9s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform, opacity;
}

[data-aos].aos-animate {
    opacity: 1;
}

/* Fade Animations */
[data-aos="fade-up"] {
    transform: translateY(60px);
}

[data-aos="fade-up"].aos-animate {
    transform: translateY(0);
}

[data-aos="fade-down"] {
    transform: translateY(-60px);
}

[data-aos="fade-down"].aos-animate {
    transform: translateY(0);
}

[data-aos="fade-left"] {
    transform: translateX(60px);
}

[data-aos="fade-left"].aos-animate {
    transform: translateX(0);
}

[data-aos="fade-right"] {
    transform: translateX(-60px);
}

[data-aos="fade-right"].aos-animate {
    transform: translateX(0);
}

/* Fade + Scale */
[data-aos="fade-up-scale"] {
    transform: translateY(60px) scale(0.95);
}

[data-aos="fade-up-scale"].aos-animate {
    transform: translateY(0) scale(1);
}

/* Zoom Animations */
[data-aos="zoom-in"] {
    transform: scale(0.85);
}

[data-aos="zoom-in"].aos-animate {
    transform: scale(1);
}

[data-aos="zoom-in-up"] {
    transform: scale(0.85) translateY(30px);
}

[data-aos="zoom-in-up"].aos-animate {
    transform: scale(1) translateY(0);
}

[data-aos="zoom-out"] {
    transform: scale(1.15);
}

[data-aos="zoom-out"].aos-animate {
    transform: scale(1);
}

/* Flip Animations */
[data-aos="flip-left"] {
    transform: perspective(1200px) rotateY(-100deg);
    transform-origin: center;
}

[data-aos="flip-left"].aos-animate {
    transform: perspective(1200px) rotateY(0);
}

[data-aos="flip-right"] {
    transform: perspective(1200px) rotateY(100deg);
    transform-origin: center;
}

[data-aos="flip-right"].aos-animate {
    transform: perspective(1200px) rotateY(0);
}

[data-aos="flip-up"] {
    transform: perspective(1200px) rotateX(-100deg);
    transform-origin: center;
}

[data-aos="flip-up"].aos-animate {
    transform: perspective(1200px) rotateX(0);
}

/* Slide Animations */
[data-aos="slide-up"] {
    transform: translateY(100%);
}

[data-aos="slide-up"].aos-animate {
    transform: translateY(0);
}

[data-aos="slide-down"] {
    transform: translateY(-100%);
}

[data-aos="slide-down"].aos-animate {
    transform: translateY(0);
}

[data-aos="slide-left"] {
    transform: translateX(100%);
}

[data-aos="slide-left"].aos-animate {
    transform: translateX(0);
}

[data-aos="slide-right"] {
    transform: translateX(-100%);
}

[data-aos="slide-right"].aos-animate {
    transform: translateX(0);
}

/* Animation Delays */
[data-aos-delay="100"] { transition-delay: 0.1s; }
[data-aos-delay="200"] { transition-delay: 0.2s; }
[data-aos-delay="300"] { transition-delay: 0.3s; }
[data-aos-delay="400"] { transition-delay: 0.4s; }
[data-aos-delay="500"] { transition-delay: 0.5s; }
[data-aos-delay="600"] { transition-delay: 0.6s; }
[data-aos-delay="700"] { transition-delay: 0.7s; }
[data-aos-delay="800"] { transition-delay: 0.8s; }

/* Animation Durations */
[data-aos-duration="400"] { transition-duration: 0.4s; }
[data-aos-duration="600"] { transition-duration: 0.6s; }
[data-aos-duration="800"] { transition-duration: 0.8s; }
[data-aos-duration="1000"] { transition-duration: 1s; }
[data-aos-duration="1200"] { transition-duration: 1.2s; }

/* ========================================
   HERO ANIMATIONS
   ======================================== */
.hero-name .name-line {
    opacity: 0;
    transform: translateY(50px);
    animation: heroNameReveal 1s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.hero-name .name-line:nth-child(1) {
    animation-delay: 0.2s;
}

.hero-name .name-line:nth-child(2) {
    animation-delay: 0.4s;
}

@keyframes heroNameReveal {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   STAGGER ANIMATIONS
   ======================================== */
.stagger-children > * {
    opacity: 0;
    transform: translateY(40px);
}

.stagger-children.animate > * {
    animation: staggerReveal 0.7s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.stagger-children.animate > *:nth-child(1) { animation-delay: 0.1s; }
.stagger-children.animate > *:nth-child(2) { animation-delay: 0.2s; }
.stagger-children.animate > *:nth-child(3) { animation-delay: 0.3s; }
.stagger-children.animate > *:nth-child(4) { animation-delay: 0.4s; }
.stagger-children.animate > *:nth-child(5) { animation-delay: 0.5s; }
.stagger-children.animate > *:nth-child(6) { animation-delay: 0.6s; }
.stagger-children.animate > *:nth-child(7) { animation-delay: 0.7s; }
.stagger-children.animate > *:nth-child(8) { animation-delay: 0.8s; }

@keyframes staggerReveal {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Grid Stagger */
.grid-stagger > * {
    opacity: 0;
    transform: translateY(40px) scale(0.96);
}

.grid-stagger.animate > *:nth-child(1) { animation: gridStagger 0.6s ease 0.1s forwards; }
.grid-stagger.animate > *:nth-child(2) { animation: gridStagger 0.6s ease 0.2s forwards; }
.grid-stagger.animate > *:nth-child(3) { animation: gridStagger 0.6s ease 0.3s forwards; }
.grid-stagger.animate > *:nth-child(4) { animation: gridStagger 0.6s ease 0.4s forwards; }
.grid-stagger.animate > *:nth-child(5) { animation: gridStagger 0.6s ease 0.5s forwards; }
.grid-stagger.animate > *:nth-child(6) { animation: gridStagger 0.6s ease 0.6s forwards; }

@keyframes gridStagger {
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ========================================
   FLOATING & AMBIENT ANIMATIONS
   ======================================== */
.float {
    animation: float 6s ease-in-out infinite;
}

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

.float-subtle {
    animation: floatSubtle 8s ease-in-out infinite;
}

@keyframes floatSubtle {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-8px) rotate(0.5deg); }
    75% { transform: translateY(8px) rotate(-0.5deg); }
}

/* ========================================
   PULSE & GLOW EFFECTS
   ======================================== */
.pulse {
    animation: pulse 2.5s ease-in-out infinite;
}

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

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

@keyframes glow {
    from {
        box-shadow: 0 0 15px rgba(212, 168, 83, 0.2),
                    0 0 30px rgba(212, 168, 83, 0.1);
    }
    to {
        box-shadow: 0 0 25px rgba(212, 168, 83, 0.4),
                    0 0 50px rgba(212, 168, 83, 0.2);
    }
}

/* ========================================
   SHIMMER EFFECT
   ======================================== */
.shimmer {
    position: relative;
    overflow: hidden;
}

.shimmer::after {
    content: '';
    position: absolute;
    top: 0;
    left: -150%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.08),
        transparent
    );
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    100% { left: 150%; }
}

/* ========================================
   SCROLL REVEAL
   ======================================== */
.reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.reveal-scale {
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-scale.active {
    opacity: 1;
    transform: scale(1);
}

/* ========================================
   DECORATIVE ANIMATIONS
   ======================================== */

/* Border Animation */
.border-animate {
    position: relative;
}

.border-animate::before,
.border-animate::after {
    content: '';
    position: absolute;
    width: 0;
    height: 1px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    transition: width 0.4s ease;
}

.border-animate::before {
    top: 0;
    left: 0;
}

.border-animate::after {
    bottom: 0;
    right: 0;
}

.border-animate:hover::before,
.border-animate:hover::after {
    width: 100%;
}

/* Underline Animation */
.underline-animate {
    position: relative;
}

.underline-animate::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--accent-gradient);
    transition: width 0.4s ease;
}

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

/* ========================================
   CARD HOVER EFFECTS
   ======================================== */
.card-hover {
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

.card-hover:hover {
    transform: translateY(-12px);
}

.card-lift {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-lift:hover {
    transform: translateY(-8px) scale(1.01);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.15);
}

/* ========================================
   TYPEWRITER CURSOR
   ======================================== */
.typewriter-cursor {
    animation: blink 0.8s infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* ========================================
   SCROLL DOWN INDICATOR
   ======================================== */
.scroll-down-indicator {
    animation: scrollDown 2.5s ease-in-out infinite;
}

@keyframes scrollDown {
    0%, 100% { opacity: 1; transform: translateY(0); }
    50% { opacity: 0.5; transform: translateY(10px); }
}

/* ========================================
   PARTICLE ANIMATION
   ======================================== */
.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--accent-primary);
    border-radius: 50%;
    opacity: 0;
    animation: particleFloat 5s ease-in-out infinite;
}

@keyframes particleFloat {
    0% {
        opacity: 0;
        transform: translateY(0) scale(0);
    }
    10% {
        opacity: 0.8;
        transform: translateY(-20px) scale(1);
    }
    90% {
        opacity: 0.8;
        transform: translateY(-100px) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-120px) scale(0);
    }
}

/* ========================================
   TEXT REVEAL ANIMATION
   ======================================== */
.text-reveal {
    overflow: hidden;
}

.text-reveal span {
    display: inline-block;
    transform: translateY(100%);
    animation: textReveal 0.9s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes textReveal {
    to {
        transform: translateY(0);
    }
}

/* ========================================
   GRADIENT TEXT ANIMATION
   ======================================== */
.gradient-text-animate {
    background: linear-gradient(
        90deg,
        var(--accent-primary),
        var(--accent-secondary),
        var(--accent-primary)
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientMove 4s linear infinite;
}

@keyframes gradientMove {
    to { background-position: 200% center; }
}

/* ========================================
   RIPPLE EFFECT
   ======================================== */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background: radial-gradient(circle, rgba(212, 168, 83, 0.2) 0%, transparent 70%);
    transform: scale(0);
    opacity: 0;
    transition: transform 0.6s, opacity 0.6s;
}

.ripple:active::after {
    transform: scale(2);
    opacity: 1;
    transition: 0s;
}

/* ========================================
   SPIN ANIMATION
   ======================================== */
.spin {
    animation: spin 1.2s linear infinite;
}

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

.spin-slow {
    animation: spin 3s linear infinite;
}

/* ========================================
   BOUNCE ANIMATION
   ======================================== */
.bounce {
    animation: bounce 2s infinite;
}

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

/* ========================================
   WAVE ANIMATION
   ======================================== */
.wave {
    animation: wave 2.5s ease-in-out infinite;
}

@keyframes wave {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(20deg); }
    75% { transform: rotate(-15deg); }
}

/* ========================================
   LOADING DOTS
   ======================================== */
.loading-dots span {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--accent-primary);
    border-radius: 50%;
    margin: 0 4px;
    animation: loadingDots 1.4s ease-in-out infinite both;
}

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

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

/* ========================================
   SMOOTH PAGE TRANSITIONS
   ======================================== */
.page-transition {
    animation: pageTransition 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* ========================================
   TILT EFFECT
   ======================================== */
.tilt {
    transform-style: preserve-3d;
    transition: transform 0.4s ease;
}

.tilt:hover {
    transform: perspective(1000px) rotateX(4deg) rotateY(4deg);
}

/* ========================================
   MORPHING BACKGROUND
   ======================================== */
.morph-bg {
    background: radial-gradient(
        ellipse at 50% 50%,
        rgba(212, 168, 83, 0.12) 0%,
        transparent 70%
    );
    animation: morphBg 10s ease-in-out infinite;
}

@keyframes morphBg {
    0%, 100% {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    }
    50% {
        border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
    }
}

/* ========================================
   SVG LINE DRAW
   ======================================== */
.draw-line {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    animation: drawLine 2.5s ease forwards;
}

@keyframes drawLine {
    to { stroke-dashoffset: 0; }
}

/* ========================================
   FAMILY & TIMELINE - CONTINUOUS MOTION
   All animations run immediately, no opacity:0
   ======================================== */

/* Animations are defined in style.css to avoid conflicts */

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

    [data-aos] {
        opacity: 1 !important;
        transform: none !important;
    }
}
