/* Journey Section - Floating Flowers with Carousels */

/* Modern Journey Cards - Scroll-Triggered Animation */
.journey-card-wrapper {
    position: relative;
}

.journey-card {
    opacity: 0;
    transform: translateY(50px);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.journey-card.animate-in {
    animation: journeyCardFadeIn 0.6s ease-out forwards;
}

.journey-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(212, 175, 55, 0.3) !important;
}

/* Card fade-in and slide-up animation - slower */
@keyframes journeyCardFadeIn {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Connecting Lines Between Cards - Progress Bar Style */
.connecting-line {
    position: absolute;
    width: 100px;
    height: 80px;
    pointer-events: none;
    opacity: 0;
    z-index: 50;
    filter: drop-shadow(0 2px 4px rgba(212, 175, 55, 0.3));
}

/* Line positioning - Card 1 to Card 2 */
.line-1-to-2 {
    bottom: -70px;
    left: 50%;
    transform: translateX(-50%);
}

/* Line positioning - Card 2 to Card 4 */
.line-2-to-4 {
    bottom: -70px;
    right: 5%;
}

/* Line positioning - Card 3 to Card 5 */
.line-3-to-5 {
    bottom: -70px;
    left: 5%;
}

/* Line positioning - Card 4 to Card 6 */
.line-4-to-6 {
    bottom: -70px;
    left: 50%;
    transform: translateX(-50%);
}

/* Line animation - Drawing effect with fade in */
@keyframes drawLineProgress {
    0% {
        opacity: 0;
        stroke-dashoffset: 1000;
    }
    10% {
        opacity: 0.8;
    }
    100% {
        opacity: 0.8;
        stroke-dashoffset: 0;
    }
}

.connecting-line.animate-line {
    animation: drawLineProgress 0.8s ease-out forwards;
}

.connecting-line.animate-line path {
    stroke-width: 3;
}

/* Hide lines on mobile */
@media (max-width: 768px) {
    .connecting-line {
        display: none;
    }
}

/* Background Slideshow Animation */
.background-slideshow-journey {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.background-image-journey {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    animation: backgroundFadeJourney 36s infinite;
}

/* Stagger animation delays for each image (6 images, 6 seconds each = 36 seconds total) */
.background-image-journey:nth-child(1) {
    animation-delay: 0s;
}

.background-image-journey:nth-child(2) {
    animation-delay: 6s;
}

.background-image-journey:nth-child(3) {
    animation-delay: 12s;
}

.background-image-journey:nth-child(4) {
    animation-delay: 18s;
}

.background-image-journey:nth-child(5) {
    animation-delay: 24s;
}

.background-image-journey:nth-child(6) {
    animation-delay: 30s;
}

@keyframes backgroundFadeJourney {
    0% {
        opacity: 1;
    }
    13.88% {
        opacity: 1;
    }
    16.66% {
        opacity: 0;
    }
    100% {
        opacity: 0;
    }
}

/* Base floating animation for flowers - asymmetric like bubbles */
@keyframes floatBubble1 {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }
    25% {
        transform: translate(15px, -20px) rotate(5deg);
    }
    50% {
        transform: translate(-10px, -35px) rotate(-3deg);
    }
    75% {
        transform: translate(20px, -15px) rotate(7deg);
    }
}

@keyframes floatBubble2 {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }
    25% {
        transform: translate(-20px, 15px) rotate(-5deg);
    }
    50% {
        transform: translate(10px, 30px) rotate(4deg);
    }
    75% {
        transform: translate(-15px, 20px) rotate(-6deg);
    }
}

@keyframes floatBubble3 {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg) scale(1);
    }
    33% {
        transform: translate(25px, -10px) rotate(8deg) scale(1.05);
    }
    66% {
        transform: translate(-18px, 25px) rotate(-4deg) scale(0.98);
    }
}

@keyframes floatBubble4 {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg) scale(1);
    }
    30% {
        transform: translate(-15px, -25px) rotate(-6deg) scale(1.03);
    }
    70% {
        transform: translate(22px, 18px) rotate(5deg) scale(0.97);
    }
}

@keyframes floatBubble5 {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }
    20% {
        transform: translate(18px, 20px) rotate(7deg);
    }
    60% {
        transform: translate(-12px, -15px) rotate(-5deg);
    }
    80% {
        transform: translate(10px, 25px) rotate(3deg);
    }
}

@keyframes floatBubble6 {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg) scale(1);
    }
    40% {
        transform: translate(-20px, 20px) rotate(-7deg) scale(1.04);
    }
    80% {
        transform: translate(15px, -18px) rotate(6deg) scale(0.96);
    }
}

/* Apply different animations to each flower */
.floating-flower.flower-1 {
    animation: floatBubble1 12s ease-in-out infinite;
}

.floating-flower.flower-2 {
    animation: floatBubble2 10s ease-in-out infinite;
    animation-delay: 1s;
}

.floating-flower.flower-3 {
    animation: floatBubble3 14s ease-in-out infinite;
    animation-delay: 2s;
}

.floating-flower.flower-4 {
    animation: floatBubble4 11s ease-in-out infinite;
    animation-delay: 0.5s;
}

.floating-flower.flower-5 {
    animation: floatBubble5 13s ease-in-out infinite;
    animation-delay: 1.5s;
}

.floating-flower.flower-6 {
    animation: floatBubble6 15s ease-in-out infinite;
    animation-delay: 2.5s;
}

/* Flower masked container - wrapper for masked images */
.flower-masked-container {
    overflow: hidden;
    position: relative;
}

/* Carousel image with flower mask applied directly */
.carousel-image {
    transition: opacity 0.8s ease-in-out;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    -webkit-mask-image: url('/assets/flower-frame.svg');
    mask-image: url('/assets/flower-frame.svg');
    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    filter: drop-shadow(0 0 15px rgba(212, 175, 55, 0.4));
}

.floating-flower:hover .carousel-image {
    filter: drop-shadow(0 0 25px rgba(212, 175, 55, 0.6));
}

.carousel-image.fade-out {
    opacity: 0;
}

.carousel-image.fade-in {
    opacity: 1;
}

/* Content cards entrance animation */
@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

#journey .space-y-12 > div {
    animation: slideInFromRight 0.8s ease-out forwards;
    opacity: 0;
}

#journey .space-y-12 > div:nth-child(1) {
    animation-delay: 0.1s;
}

#journey .space-y-12 > div:nth-child(2) {
    animation-delay: 0.2s;
}

#journey .space-y-12 > div:nth-child(3) {
    animation-delay: 0.3s;
}

#journey .space-y-12 > div:nth-child(4) {
    animation-delay: 0.4s;
}

#journey .space-y-12 > div:nth-child(5) {
    animation-delay: 0.5s;
}

#journey .space-y-12 > div:nth-child(6) {
    animation-delay: 0.6s;
}

#journey .space-y-12 > div:nth-child(7) {
    animation-delay: 0.7s;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .floating-flower {
        width: 80px !important;
        height: 80px !important;
    }

    .floating-flower .carousel-container {
        width: 40px !important;
        height: 40px !important;
    }

    /* Adjust content cards for mobile */
    #journey .bg-white\/60 {
        padding: 1.5rem !important;
    }

    /* Adjust final CTA section - padding only, font sizes handled globally */
    #journey button {
        padding: 0.75rem 2rem !important;
    }
}

@media (max-width: 480px) {
    /* Extra small screens */
    .floating-flower {
        width: 60px !important;
        height: 60px !important;
    }

    #journey {
        padding-top: 3rem !important;
        padding-bottom: 3rem !important;
    }

    #journey .bg-white\/60 {
        padding: 1rem !important;
    }

    #journey button {
        padding: 0.625rem 1.5rem !important;
    }
}

/* Gentle pulse effect on flower masked containers */
@keyframes flowerPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.95;
    }
    50% {
        transform: scale(1.03);
        opacity: 1;
    }
}

.floating-flower .flower-masked-container {
    animation: flowerPulse 4s ease-in-out infinite;
}

/* Stagger the pulse effect */
.floating-flower.flower-1 .flower-masked-container {
    animation-delay: 0s;
}

.floating-flower.flower-2 .flower-masked-container {
    animation-delay: 0.7s;
}

.floating-flower.flower-3 .flower-masked-container {
    animation-delay: 1.4s;
}

.floating-flower.flower-4 .flower-masked-container {
    animation-delay: 2.1s;
}

.floating-flower.flower-5 .flower-masked-container {
    animation-delay: 2.8s;
}

.floating-flower.flower-6 .flower-masked-container {
    animation-delay: 3.5s;
}

/* SVG Flower Animations - Smaller and more subtle */
.floating-svg-flower {
    transition: all 0.3s ease;
}

.floating-svg-flower:hover {
    transform: scale(1.1);
    opacity: 0.7 !important;
}

/* Individual SVG flower animations with different patterns */
@keyframes floatSvgFlower1 {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }
    25% {
        transform: translate(10px, -15px) rotate(8deg);
    }
    50% {
        transform: translate(-8px, -25px) rotate(-5deg);
    }
    75% {
        transform: translate(12px, -10px) rotate(10deg);
    }
}

@keyframes floatSvgFlower2 {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }
    30% {
        transform: translate(-12px, 20px) rotate(-7deg);
    }
    60% {
        transform: translate(15px, -18px) rotate(6deg);
    }
}

@keyframes floatSvgFlower3 {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg) scale(1);
    }
    40% {
        transform: translate(18px, -12px) rotate(12deg) scale(1.05);
    }
    80% {
        transform: translate(-10px, 15px) rotate(-8deg) scale(0.98);
    }
}

@keyframes floatSvgFlower4 {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }
    35% {
        transform: translate(-15px, -20px) rotate(-10deg);
    }
    70% {
        transform: translate(20px, 12px) rotate(8deg);
    }
}

@keyframes floatSvgFlower5 {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }
    25% {
        transform: translate(14px, 18px) rotate(9deg);
    }
    60% {
        transform: translate(-16px, -12px) rotate(-6deg);
    }
    85% {
        transform: translate(8px, 20px) rotate(4deg);
    }
}

@keyframes floatSvgFlower6 {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg) scale(1);
    }
    45% {
        transform: translate(-18px, 16px) rotate(-11deg) scale(1.03);
    }
    85% {
        transform: translate(12px, -14px) rotate(7deg) scale(0.97);
    }
}

@keyframes floatSvgFlower7 {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }
    33% {
        transform: translate(10px, -18px) rotate(6deg);
    }
    66% {
        transform: translate(-14px, 10px) rotate(-9deg);
    }
}

@keyframes floatSvgFlower8 {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg) scale(1);
    }
    50% {
        transform: translate(16px, -16px) rotate(10deg) scale(1.04);
    }
}

/* Apply animations to SVG flowers */
.floating-svg-flower.svg-flower-1 {
    animation: floatSvgFlower1 16s ease-in-out infinite;
}

.floating-svg-flower.svg-flower-2 {
    animation: floatSvgFlower2 14s ease-in-out infinite;
    animation-delay: 2s;
}

.floating-svg-flower.svg-flower-3 {
    animation: floatSvgFlower3 18s ease-in-out infinite;
    animation-delay: 1s;
}

.floating-svg-flower.svg-flower-4 {
    animation: floatSvgFlower4 15s ease-in-out infinite;
    animation-delay: 3s;
}

.floating-svg-flower.svg-flower-5 {
    animation: floatSvgFlower5 17s ease-in-out infinite;
    animation-delay: 0.5s;
}

.floating-svg-flower.svg-flower-6 {
    animation: floatSvgFlower6 19s ease-in-out infinite;
    animation-delay: 2.5s;
}

.floating-svg-flower.svg-flower-7 {
    animation: floatSvgFlower7 13s ease-in-out infinite;
    animation-delay: 1.5s;
}

.floating-svg-flower.svg-flower-8 {
    animation: floatSvgFlower8 16s ease-in-out infinite;
    animation-delay: 3.5s;
}
