/*
 * JJ Tata Wedding - Animation Styles
 * Scroll effects, keyframes, and interactive animations
 */

/* ========================================
   Keyframe Animations
======================================== */

/* Scroll Down Animation */
@keyframes scroll-down {
    0% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(15px);
    }
}

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

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

/* Fade In Up */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fade In Down */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fade In Left */
@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Fade In Right */
@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Zoom In */
@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Shine Effect */
@keyframes shine {
    0% {
        left: -100%;
    }
    100% {
        left: 200%;
    }
}

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

/* Sparkle */
@keyframes sparkle {
    0%, 100% {
        opacity: 0;
        transform: scale(0);
    }
    50% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Heartbeat */
@keyframes heartbeat {
    0%, 100% {
        transform: scale(1);
    }
    10%, 30% {
        transform: scale(0.9);
    }
    20%, 40% {
        transform: scale(1.1);
    }
}

/* Snowflake Fall */
@keyframes snowflakeFall {
    0% {
        transform: translateY(-10vh) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(110vh) rotate(360deg);
        opacity: 0.5;
    }
}

/* Swing */
@keyframes swing {
    0%, 100% {
        transform: rotate(-5deg);
    }
    50% {
        transform: rotate(5deg);
    }
}

/* Glow */
@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(212, 175, 55, 0.5);
    }
    50% {
        box-shadow: 0 0 40px rgba(212, 175, 55, 0.8);
    }
}

/* ========================================
   Scroll-triggered Animations (AOS-like)
======================================== */

/* Base state for elements with data-aos */
[data-aos] {
    opacity: 0;
    transition-property: transform, opacity;
    transition-duration: 0.8s;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Animated state */
[data-aos].aos-animate {
    opacity: 1;
}

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

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

/* Fade Down */
[data-aos="fade-down"] {
    transform: translateY(-40px);
}

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

/* Fade Left */
[data-aos="fade-left"] {
    transform: translateX(40px);
}

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

/* Fade Right */
[data-aos="fade-right"] {
    transform: translateX(-40px);
}

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

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

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

/* Zoom Out */
[data-aos="zoom-out"] {
    transform: scale(1.2);
}

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

/* Flip Left */
[data-aos="flip-left"] {
    transform: perspective(1000px) rotateY(-40deg);
}

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

/* Flip Right */
[data-aos="flip-right"] {
    transform: perspective(1000px) rotateY(40deg);
}

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

/* Delays */
[data-aos][data-aos-delay="100"] {
    transition-delay: 0.1s;
}

[data-aos][data-aos-delay="200"] {
    transition-delay: 0.2s;
}

[data-aos][data-aos-delay="300"] {
    transition-delay: 0.3s;
}

[data-aos][data-aos-delay="400"] {
    transition-delay: 0.4s;
}

[data-aos][data-aos-delay="500"] {
    transition-delay: 0.5s;
}

[data-aos][data-aos-delay="600"] {
    transition-delay: 0.6s;
}

/* ========================================
   Hero Section Animations
======================================== */

.hero-content {
    animation: fadeInUp 1.2s ease-out;
}

.invitation-text {
    animation: fadeInDown 1s ease-out 0.3s both;
}

.bride-name {
    animation: fadeInLeft 1s ease-out 0.6s both;
}

.groom-name {
    animation: fadeInRight 1s ease-out 0.9s both;
}

.name-divider {
    animation: zoomIn 0.8s ease-out 1.2s both;
}

.hero-date {
    animation: fadeInUp 1s ease-out 1.5s both;
}

.hero-location {
    animation: fadeInUp 1s ease-out 1.8s both;
}

.countdown-container {
    animation: fadeInUp 1s ease-out 2.1s both;
}

.hero-cta {
    animation: fadeInUp 1s ease-out 2.4s both;
}

.hero-scroll-indicator {
    animation: fadeInUp 1s ease-out 2.7s both;
}

.hero-decoration {
    animation: float 4s ease-in-out infinite;
}

.hero-decoration-left {
    animation-delay: 0s;
}

.hero-decoration-right {
    animation-delay: 2s;
}

/* ========================================
   Interactive Animations
======================================== */

/* Button Hover Effects */
.btn-primary {
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s;
}

.btn-primary:hover::before {
    left: 200%;
}

/* Icon Animations */
.section-ornament i {
    animation: rotate 20s linear infinite;
}

.date-ornament i {
    animation: pulse 3s ease-in-out infinite;
}

.name-divider i {
    animation: heartbeat 2s ease-in-out infinite;
}

/* Timeline Animation on Hover */
.timeline-ornament {
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.timeline-item:hover .timeline-ornament {
    transform: rotate(360deg) scale(1.1);
}

/* Gallery Item Hover */
.gallery-item {
    transition: all 0.3s ease;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* Detail Card Entrance */
.detail-card {
    animation-fill-mode: both;
}

/* Color Swatch Animation */
.color-swatch {
    animation: glow 3s ease-in-out infinite;
}

.color-swatch:nth-child(1) {
    animation-delay: 0s;
}

.color-swatch:nth-child(2) {
    animation-delay: 1s;
}

.color-swatch:nth-child(3) {
    animation-delay: 2s;
}

/* ========================================
   Page Load Animations
======================================== */

/* Navigation Slide Down */
.wedding-nav {
    animation: fadeInDown 0.8s ease-out;
}

.nav-link {
    position: relative;
}

.nav-link::before {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--color-gold-light);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-link:hover::before {
    width: 100%;
}

/* Scroll Indicator */
.hero-scroll-indicator {
    animation: float 3s ease-in-out infinite;
}

/* ========================================
   Parallax Effects
======================================== */

.hero-background {
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

/* ========================================
   Loading Animations
======================================== */

/* Shimmer Effect for Images */
.loading-shimmer {
    position: relative;
    overflow: hidden;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

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

/* ========================================
   Hover Effects
======================================== */

/* Image Zoom on Hover */
.timeline-image,
.gallery-item {
    overflow: hidden;
}

.timeline-image img,
.gallery-item img {
    will-change: transform;
}

/* Card Lift on Hover */
.detail-card,
.rsvp-info-box {
    will-change: transform, box-shadow;
}

/* ========================================
   Mobile Animations
======================================== */

@media (max-width: 768px) {
    /* Reduce motion for mobile */
    [data-aos] {
        transition-duration: 0.5s;
    }

    /* Simplify animations */
    .hero-decoration {
        animation: none;
    }

    .countdown-item {
        animation: none;
    }

    /* Mobile menu animation */
    .nav-menu {
        animation: slideInLeft 0.4s ease-out;
    }

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

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

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

/* ========================================
   Print Styles
======================================== */

@media print {
    /* Disable animations for print */
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }

    .wedding-nav,
    .mobile-sticky-bar,
    .scroll-to-top,
    .hero-scroll-indicator {
        display: none !important;
    }
}