/**
 * Coffee Shop V2 - Advanced Animations
 * Coffee beans, particles, parallax, and modern effects
 */

/* ============================================
   COFFEE BEANS FLOATING ANIMATION
   ============================================ */

.coffee-beans-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.coffee-bean {
    position: absolute;
    background: radial-gradient(ellipse at 30% 30%, #8B4513, #3E2723);
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    box-shadow:
        inset -3px -3px 6px rgba(0,0,0,0.4),
        3px 3px 8px rgba(0,0,0,0.3);
    animation: floatBean 20s infinite ease-in-out;
    opacity: 0.95 !important;
    z-index: 5;
}

.coffee-bean::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30%;
    height: 70%;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
}

@keyframes floatBean {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.7;
    }
    90% {
        opacity: 0.7;
    }
    100% {
        transform: translateY(-100vh) rotate(360deg);
        opacity: 0;
    }
}

/* Different sizes and positions for beans */
.coffee-bean:nth-child(1) {
    width: 20px;
    height: 30px;
    left: 10%;
    animation-duration: 18s;
    animation-delay: 0s;
}

.coffee-bean:nth-child(2) {
    width: 15px;
    height: 22px;
    left: 25%;
    animation-duration: 22s;
    animation-delay: 2s;
}

.coffee-bean:nth-child(3) {
    width: 25px;
    height: 35px;
    left: 40%;
    animation-duration: 20s;
    animation-delay: 4s;
}

.coffee-bean:nth-child(4) {
    width: 18px;
    height: 26px;
    left: 55%;
    animation-duration: 24s;
    animation-delay: 1s;
}

.coffee-bean:nth-child(5) {
    width: 22px;
    height: 32px;
    left: 70%;
    animation-duration: 19s;
    animation-delay: 3s;
}

.coffee-bean:nth-child(6) {
    width: 16px;
    height: 24px;
    left: 85%;
    animation-duration: 21s;
    animation-delay: 5s;
}

.coffee-bean:nth-child(7) {
    width: 20px;
    height: 28px;
    left: 15%;
    animation-duration: 23s;
    animation-delay: 6s;
}

.coffee-bean:nth-child(8) {
    width: 24px;
    height: 34px;
    left: 60%;
    animation-duration: 25s;
    animation-delay: 2.5s;
}

/* ============================================
   COFFEE CUP STEAM ANIMATION
   ============================================ */

.coffee-steam {
    position: relative;
    display: inline-block;
}

.steam {
    position: absolute;
    height: 50px;
    width: 3px;
    background: linear-gradient(to top, rgba(255,255,255,0.8), transparent);
    border-radius: 50%;
    opacity: 0;
    animation: steam-rise 3s infinite ease-in-out;
}

.steam:nth-child(1) {
    left: 30%;
    animation-delay: 0s;
}

.steam:nth-child(2) {
    left: 50%;
    animation-delay: 0.5s;
}

.steam:nth-child(3) {
    left: 70%;
    animation-delay: 1s;
}

@keyframes steam-rise {
    0% {
        bottom: 0;
        opacity: 0;
        transform: translateX(0) scaleX(1);
    }
    20% {
        opacity: 0.8;
    }
    100% {
        bottom: 50px;
        opacity: 0;
        transform: translateX(10px) scaleX(1.5);
    }
}

/* ============================================
   PARALLAX LAYERS
   ============================================ */

.parallax-container {
    position: relative;
    overflow: hidden;
}

.parallax-layer {
    position: absolute;
    width: 100%;
    height: 100%;
    transition: transform 0.1s ease-out;
}

.parallax-layer-bg {
    transform: translateZ(-1px) scale(2);
}

.parallax-layer-mid {
    transform: translateZ(-0.5px) scale(1.5);
}

.parallax-layer-front {
    transform: translateZ(0);
}

/* ============================================
   SPLIT SCREEN SLIDER
   ============================================ */

.split-slider {
    position: relative;
    width: 100%;
    height: 600px;
    overflow: hidden;
}

.split-slider-container {
    display: flex;
    height: 100%;
    transition: transform 0.8s cubic-bezier(0.77, 0, 0.175, 1);
}

.split-slide {
    position: relative;
    min-width: 100%;
    height: 100%;
    display: flex;
}

.split-slide-left {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: var(--primary-dark);
}

.split-slide-right {
    flex: 1;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--light);
    padding: 4rem;
}

.split-slide-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 1.2s cubic-bezier(0.77, 0, 0.175, 1);
}

.split-slide:hover .split-slide-image {
    transform: scale(1.05);
}

.split-slide-content {
    max-width: 500px;
    animation: fadeInRight 0.8s ease;
}

.split-slider-nav {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 1rem;
    z-index: 10;
}

.split-slider-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: all 0.3s ease;
}

.split-slider-dot.active {
    background: var(--accent);
    transform: scale(1.3);
}

/* ============================================
   TIMELINE ANIMATION
   ============================================ */

.timeline {
    position: relative;
    padding: 4rem 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(to bottom,
        var(--primary-light),
        var(--accent),
        var(--primary-light)
    );
    transform: translateX(-50%);
}

.timeline-item {
    position: relative;
    margin-bottom: 4rem;
    transition: all 0.6s cubic-bezier(0.77, 0, 0.175, 1);
}

.timeline-item:nth-child(odd) .timeline-content {
    margin-right: 55%;
    text-align: right;
}

.timeline-item:nth-child(even) .timeline-content {
    margin-left: 55%;
    text-align: left;
}

.timeline-marker {
    position: absolute;
    left: 50%;
    top: 0;
    width: 30px;
    height: 30px;
    background: var(--accent);
    border: 5px solid var(--white);
    border-radius: 50%;
    transform: translateX(-50%);
    box-shadow: 0 0 0 10px rgba(212, 175, 55, 0.2);
    animation: pulse-ring 2s infinite;
}

@keyframes pulse-ring {
    0%, 100% {
        box-shadow: 0 0 0 10px rgba(212, 175, 55, 0.2);
    }
    50% {
        box-shadow: 0 0 0 20px rgba(212, 175, 55, 0);
    }
}

.timeline-content {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    position: relative;
}

.timeline-content::before {
    content: '';
    position: absolute;
    top: 10px;
    width: 0;
    height: 0;
    border-style: solid;
}

.timeline-item:nth-child(odd) .timeline-content::before {
    right: -15px;
    border-width: 15px 0 15px 15px;
    border-color: transparent transparent transparent var(--white);
}

.timeline-item:nth-child(even) .timeline-content::before {
    left: -15px;
    border-width: 15px 15px 15px 0;
    border-color: transparent var(--white) transparent transparent;
}

/* ============================================
   COFFEE RIPPLE EFFECT
   ============================================ */

.coffee-ripple {
    position: relative;
    display: inline-block;
    cursor: pointer;
}

.coffee-ripple::before,
.coffee-ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    border: 2px solid var(--accent);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
}

.coffee-ripple:hover::before {
    animation: ripple 1.5s ease-out;
}

.coffee-ripple:hover::after {
    animation: ripple 1.5s ease-out 0.3s;
}

@keyframes ripple {
    0% {
        width: 100%;
        height: 100%;
        opacity: 0.8;
    }
    100% {
        width: 200%;
        height: 200%;
        opacity: 0;
    }
}

/* ============================================
   3D FLIP CARDS
   ============================================ */

.flip-card {
    perspective: 1000px;
    height: 400px;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.8s;
    transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.flip-card-front {
    background: var(--white);
}

.flip-card-back {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    color: var(--white);
    transform: rotateY(180deg);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

/* ============================================
   WAVE SEPARATOR - Seamless & Clean
   ============================================ */

.wave-separator {
    position: relative;
    width: 100%;
    overflow: hidden;
    line-height: 0;
    margin-top: -2px;
    z-index: 5;
}

.wave-separator svg {
    position: relative;
    display: block;
    width: calc(100% + 1.3px);
    height: 150px;
}

.wave-separator svg path {
    fill: #ffffff;
}

/* Subtle shadow for depth - only one layer */
.wave-separator::before {
    content: '';
    position: absolute;
    top: -60px;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(
        to bottom,
        rgba(15, 31, 61, 0.15) 0%,
        rgba(30, 58, 95, 0.08) 50%,
        transparent 100%
    );
    filter: blur(25px);
    pointer-events: none;
    z-index: -1;
}

.wave-separator.wave-top {
    transform: rotate(180deg);
}

/* ============================================
   FLOATING ELEMENTS
   ============================================ */

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

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

.floating-delayed {
    animation: floating 3s ease-in-out infinite 0.5s;
}

/* ============================================
   TEXT REVEAL ANIMATION
   ============================================ */

.text-reveal {
    position: relative;
    overflow: hidden;
}

.text-reveal span {
    display: inline-block;
    opacity: 0;
    transform: translateY(100%);
    animation: revealText 0.8s cubic-bezier(0.77, 0, 0.175, 1) forwards;
}

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

/* Stagger text reveal */
.text-reveal span:nth-child(1) { animation-delay: 0.1s; }
.text-reveal span:nth-child(2) { animation-delay: 0.2s; }
.text-reveal span:nth-child(3) { animation-delay: 0.3s; }
.text-reveal span:nth-child(4) { animation-delay: 0.4s; }
.text-reveal span:nth-child(5) { animation-delay: 0.5s; }

/* ============================================
   NUMBER COUNTER ANIMATION
   ============================================ */

.counter {
    font-size: 3rem;
    font-weight: 700;
    color: var(--accent);
    font-family: 'Playfair Display', serif;
}

/* ============================================
   MORPHING BACKGROUND
   ============================================ */

.morphing-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1;
}

.morphing-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.3;
    animation: morphBlob 20s ease-in-out infinite;
}

.morphing-blob:nth-child(1) {
    width: 300px;
    height: 300px;
    top: 10%;
    left: 10%;
    background: var(--accent);
    animation-delay: 0s;
}

.morphing-blob:nth-child(2) {
    width: 400px;
    height: 400px;
    top: 50%;
    right: 10%;
    background: var(--primary);
    animation-delay: 5s;
}

.morphing-blob:nth-child(3) {
    width: 350px;
    height: 350px;
    bottom: 10%;
    left: 30%;
    background: var(--primary-light);
    animation-delay: 10s;
}

@keyframes morphBlob {
    0%, 100% {
        transform: translate(0, 0) scale(1);
        border-radius: 50% 50% 50% 50% / 50% 50% 50% 50%;
    }
    25% {
        transform: translate(50px, -50px) scale(1.1);
        border-radius: 40% 60% 60% 40% / 60% 40% 60% 40%;
    }
    50% {
        transform: translate(-30px, 30px) scale(0.9);
        border-radius: 60% 40% 40% 60% / 40% 60% 40% 60%;
    }
    75% {
        transform: translate(30px, 50px) scale(1.05);
        border-radius: 50% 50% 40% 60% / 50% 60% 40% 50%;
    }
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .split-slider {
        height: auto;
    }

    .split-slide {
        flex-direction: column;
    }

    .split-slide-left,
    .split-slide-right {
        min-height: 300px;
    }

    .timeline::before {
        left: 20px;
    }

    .timeline-item:nth-child(odd) .timeline-content,
    .timeline-item:nth-child(even) .timeline-content {
        margin-left: 60px;
        margin-right: 0;
        text-align: left;
    }

    .timeline-marker {
        left: 20px;
    }

    .timeline-item:nth-child(odd) .timeline-content::before {
        left: -15px;
        right: auto;
        border-width: 15px 15px 15px 0;
        border-color: transparent var(--white) transparent transparent;
    }

    .coffee-bean {
        display: none;
    }
}
