/* Parallax and Visual Effects for Wedding Invitation */

/* Smooth scrolling for the entire page */
html {
    scroll-behavior: smooth;
}

/* Parallax effect for hero section */
.hero {
    background-attachment: fixed;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, rgba(230, 201, 168, 0.9) 25%, rgba(212, 163, 115, 0.9) 25% 50%, transparent 50%);
    z-index: 1;
}

.hero-left {
    position: relative;
    z-index: 2;
    transition: all 0.5s ease;
}

.hero-img {
    transition: transform 0.8s ease, opacity 0.8s ease;
}

.hero-img img {
    transition: transform 0.5s ease, box-shadow 0.5s ease;
}

.hero-img:hover img {
    transform: scale(1.03);
    box-shadow: 0 15px 35px rgba(0,0,0,0.3);
}

/* Enhanced fade-in animations */
.fade-in {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 1.2s ease, transform 1.2s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered fade-in for multiple elements */
.stagger-fade-in:nth-child(1) { transition-delay: 0.1s; }
.stagger-fade-in:nth-child(2) { transition-delay: 0.3s; }
.stagger-fade-in:nth-child(3) { transition-delay: 0.5s; }
.stagger-fade-in:nth-child(4) { transition-delay: 0.7s; }

/* Parallax scrolling for sections */
.parallax-bg {
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

/* Floating animation for elements */
.float-animation {
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
    100% { transform: translateY(0px); }
}

/* Pulse animation for buttons */
.btn {
    position: relative;
    overflow: hidden;
}

.btn:after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%);
    transform-origin: 50% 50%;
}

.btn:hover:after {
    animation: ripple 1.5s ease-out;
}

@keyframes ripple {
    0% {
        transform: scale(0, 0);
        opacity: 0.5;
    }
    100% {
        transform: scale(20, 20);
        opacity: 0;
    }
}

/* Enhanced hover effects for gallery items */
.photo-item-img {
    overflow: hidden;
    transition: transform 0.5s ease, box-shadow 0.5s ease;
}

.photo-item-img img {
    transition: transform 0.8s ease;
}

.photo-item:hover .photo-item-img img {
    transform: scale(1.08);
}

/* Text reveal animation */
.text-reveal {
    overflow: hidden;
    position: relative;
}

.text-reveal span {
    display: inline-block;
    transform: translateY(100%);
    opacity: 0;
    transition: transform 0.8s ease, opacity 0.8s ease;
}

.text-reveal.visible span {
    transform: translateY(0);
    opacity: 1;
}

/* Ensure hero section text is visible immediately on page load */
.hero .text-reveal span {
    transform: translateY(0);
    opacity: 1;
}

/* Improved mobile responsiveness */
@media (max-width: 768px) {
    .hero::before {
        background: linear-gradient(to bottom, rgba(230, 201, 168, 0.9), rgba(212, 163, 115, 0.9));
    }

    .float-animation {
        animation: none; /* Disable floating animation on mobile */
    }

    .parallax-bg {
        background-attachment: scroll; /* Better performance on mobile */
    }
}

/* Enhanced touch interactions for mobile */
@media (max-width: 480px) {
    .btn {
        padding: 16px 30px; /* Larger touch target */
    }

    .photo-item-img:active img {
        transform: scale(1.05); /* Touch feedback */
    }

    /* Optimize animations for mobile */
    .fade-in {
        transform: translateY(20px); /* Smaller animation distance */
    }
}

/* Decorative elements */
.decorative-divider {
    height: 2px;
    width: 80px;
    margin: 20px auto;
    background: linear-gradient(to right, transparent, #d4a373, transparent);
}

/* Subtle background patterns */
.pattern-bg {
    position: relative;
}

.pattern-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.05;
    background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23d4a373' fill-opacity='0.4' fill-rule='evenodd'%3E%3Ccircle cx='3' cy='3' r='3'/%3E%3Ccircle cx='13' cy='13' r='3'/%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

/* Scroll indicator */
.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    opacity: 0.8;
    animation: bounce 2s infinite;
}

.scroll-indicator svg {
    width: 30px;
    height: 30px;
    fill: #e6c9a8;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0) translateX(-50%); }
    40% { transform: translateY(-20px) translateX(-50%); }
    60% { transform: translateY(-10px) translateX(-50%); }
}
