/* ============================================
   ARTISAN COFFEE HOUSE - ANIMATIONS
   ============================================
   
   TABLE OF CONTENTS:
   1. Coffee Text Effects
   2. Steam Animations
   3. Floating Coffee Beans
   4. Coffee Drip Effects
   5. Hover Effects
   6. Loading Animations
   7. Scroll Animations
   8. Special Effects
   
   ============================================ */

/* ============================================
   1. COFFEE TEXT EFFECTS
   ============================================ */

/* Steam text effect - steam rising from text */
.steam-text {
    position: relative;
    display: inline-block;
}

.steam-text::after {
    content: '';
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 30px;
    background: radial-gradient(ellipse at center, rgba(255,255,255,0.3), transparent);
    filter: blur(5px);
    animation: textSteam 3s ease-in-out infinite;
}

@keyframes textSteam {
    0%, 100% {
        transform: translateX(-50%) translateY(0) scale(0.5);
        opacity: 0;
    }
    50% {
        transform: translateX(-50%) translateY(-30px) scale(1.5);
        opacity: 0.6;
    }
}

/* Coffee gradient text animation */
.coffee-gradient-text {
    background: linear-gradient(
        90deg,
        var(--coffee-dark),
        var(--coffee-medium),
        var(--caramel),
        var(--coffee-medium),
        var(--coffee-dark)
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: coffeeGradient 5s linear infinite;
}

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

/* Drip text effect */
.drip-text {
    position: relative;
    display: inline-block;
}

.drip-text::before {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--caramel), transparent);
    animation: dripLine 2s ease-in-out infinite;
}

@keyframes dripLine {
    0%, 100% {
        transform: scaleX(0.5);
        opacity: 0.5;
    }
    50% {
        transform: scaleX(1);
        opacity: 1;
    }
}

/* ============================================
   2. STEAM ANIMATIONS
   ============================================ */

/* Realistic steam effect */
.steam-effect {
    position: relative;
}

.steam-effect::before,
.steam-effect::after {
    content: '';
    position: absolute;
    width: 8px;
    height: 80px;
    background: linear-gradient(to top, rgba(255,255,255,0.1), rgba(255,255,255,0.3), transparent);
    filter: blur(5px);
    animation: steamRise 4s ease-in-out infinite;
}

.steam-effect::before {
    left: 30%;
    animation-delay: 0s;
}

.steam-effect::after {
    right: 30%;
    animation-delay: 2s;
}

/* Multiple steam wisps */
.steam-wisp {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.steam-wisp .wisp {
    position: absolute;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    filter: blur(10px);
    animation: wispFloat 6s ease-in-out infinite;
}

.steam-wisp .wisp:nth-child(1) {
    width: 40px;
    height: 60px;
    left: 20%;
    animation-delay: 0s;
}

.steam-wisp .wisp:nth-child(2) {
    width: 30px;
    height: 50px;
    left: 50%;
    animation-delay: 1.5s;
}

.steam-wisp .wisp:nth-child(3) {
    width: 35px;
    height: 55px;
    left: 70%;
    animation-delay: 3s;
}

@keyframes wispFloat {
    0% {
        transform: translateY(0) scale(0.5);
        opacity: 0;
    }
    25% {
        opacity: 0.3;
    }
    75% {
        opacity: 0.1;
    }
    100% {
        transform: translateY(-150px) scale(1.5);
        opacity: 0;
    }
}

/* ============================================
   3. FLOATING COFFEE BEANS
   ============================================ */

/* Individual bean animations */
.bean-1 {
    top: 10%;
    left: 5%;
    animation: floatBean 25s ease-in-out infinite;
}

.bean-2 {
    top: 20%;
    left: 15%;
    width: 15px;
    height: 22px;
    animation: floatBean 30s ease-in-out infinite reverse;
    animation-delay: -5s;
}

.bean-3 {
    top: 60%;
    left: 8%;
    width: 25px;
    height: 37px;
    animation: floatBean 28s ease-in-out infinite;
    animation-delay: -10s;
}

.bean-4 {
    top: 40%;
    right: 10%;
    animation: floatBean 32s ease-in-out infinite reverse;
    animation-delay: -8s;
}

.bean-5 {
    top: 75%;
    right: 5%;
    width: 18px;
    height: 27px;
    animation: floatBean 26s ease-in-out infinite;
    animation-delay: -15s;
}

.bean-6 {
    top: 15%;
    right: 20%;
    width: 22px;
    height: 33px;
    animation: floatBean 35s ease-in-out infinite reverse;
    animation-delay: -12s;
}

.bean-7 {
    top: 85%;
    left: 25%;
    width: 16px;
    height: 24px;
    animation: floatBean 29s ease-in-out infinite;
    animation-delay: -20s;
}

.bean-8 {
    top: 30%;
    right: 30%;
    animation: floatBean 27s ease-in-out infinite reverse;
    animation-delay: -18s;
}

@keyframes floatBean {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
        opacity: 0.1;
    }
    25% {
        transform: translate(30px, -50px) rotate(90deg);
        opacity: 0.2;
    }
    50% {
        transform: translate(-20px, -100px) rotate(180deg);
        opacity: 0.15;
    }
    75% {
        transform: translate(40px, -50px) rotate(270deg);
        opacity: 0.2;
    }
}

/* Bean rotation on scroll */
.bean-rotating {
    animation: rotateBean 20s linear infinite;
}

@keyframes rotateBean {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ============================================
   4. COFFEE DRIP EFFECTS
   ============================================ */

/* Dripping coffee animation */
.coffee-drip {
    position: relative;
    overflow: hidden;
}

.coffee-drip::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 10px;
    height: 10px;
    background: var(--coffee-medium);
    border-radius: 50% 50% 50% 50% / 0% 0% 100% 100%;
    animation: dripFall 3s ease-in infinite;
}

@keyframes dripFall {
    0% {
        height: 0;
        opacity: 0;
    }
    20% {
        height: 20px;
        opacity: 1;
    }
    100% {
        transform: translateX(-50%) translateY(100px);
        height: 15px;
        opacity: 0;
    }
}

/* Pour effect */
.coffee-pour {
    position: relative;
}

.coffee-pour::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    width: 4px;
    height: 0;
    background: linear-gradient(to bottom, var(--coffee-dark), var(--coffee-medium), transparent);
    animation: pourCoffee 4s ease-in-out infinite;
    transform-origin: top center;
}

@keyframes pourCoffee {
    0%, 100% {
        height: 0;
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    50% {
        height: 150px;
        opacity: 1;
    }
    90% {
        opacity: 0;
    }
}

/* ============================================
   5. HOVER EFFECTS
   ============================================ */

/* Coffee swirl on hover */
.swirl-hover {
    position: relative;
    overflow: hidden;
}

.swirl-hover::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, var(--caramel), transparent);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: var(--transition-slow);
    opacity: 0;
}

.swirl-hover:hover::before {
    width: 300%;
    height: 300%;
    opacity: 0.1;
}

/* Ripple effect */
.ripple-effect {
    position: relative;
    overflow: hidden;
}

.ripple-effect::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(201, 158, 107, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.ripple-effect:hover::after {
    width: 400px;
    height: 400px;
}

/* Steam rise on hover */
.steam-hover {
    position: relative;
}

.steam-hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 0;
    background: linear-gradient(to top, rgba(255,255,255,0.2), transparent);
    filter: blur(5px);
    transition: var(--transition-slow);
    opacity: 0;
}

.steam-hover:hover::before {
    height: 80px;
    opacity: 1;
    animation: steamRise 2s ease-in-out infinite;
}

/* ============================================
   6. LOADING ANIMATIONS
   ============================================ */

/* Coffee cup filling */
.cup-fill-animation {
    position: relative;
    width: 100px;
    height: 120px;
    border: 4px solid var(--coffee-dark);
    border-radius: 0 0 40px 40px;
    overflow: hidden;
}

.cup-fill-animation::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0;
    background: linear-gradient(to top, var(--coffee-dark), var(--coffee-medium));
    animation: cupFill 3s ease-in-out infinite;
}

@keyframes cupFill {
    0%, 100% { height: 0; }
    50% { height: 80%; }
}

/* Spinning coffee bean loader */
.bean-loader {
    width: 50px;
    height: 50px;
    position: relative;
}

.bean-loader::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 30px;
    background: var(--coffee-medium);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: spinBean 1s linear infinite;
}

@keyframes spinBean {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ============================================
   7. SCROLL ANIMATIONS
   ============================================ */

/* Fade in up animation */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Fade in from left */
.fade-in-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in-left.visible {
    opacity: 1;
    transform: translateX(0);
}

/* Fade in from right */
.fade-in-right {
    opacity: 0;
    transform: translateX(50px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in-right.visible {
    opacity: 1;
    transform: translateX(0);
}

/* Scale in animation */
.scale-in {
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.scale-in.visible {
    opacity: 1;
    transform: scale(1);
}

/* Stagger animation delays */
.stagger-1 { transition-delay: 0.1s; }
.stagger-2 { transition-delay: 0.2s; }
.stagger-3 { transition-delay: 0.3s; }
.stagger-4 { transition-delay: 0.4s; }
.stagger-5 { transition-delay: 0.5s; }
.stagger-6 { transition-delay: 0.6s; }

/* ============================================
   8. SPECIAL EFFECTS
   ============================================ */

/* Coffee ring stain effect */
.coffee-ring {
    position: relative;
}

.coffee-ring::after {
    content: '';
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 20px;
    background: radial-gradient(ellipse at center, rgba(93, 64, 55, 0.2), transparent);
    border-radius: 50%;
    filter: blur(3px);
}

/* Bubbling coffee effect */
.bubbling {
    position: relative;
    overflow: hidden;
}

.bubbling::before,
.bubbling::after {
    content: '';
    position: absolute;
    width: 10px;
    height: 10px;
    background: rgba(201, 158, 107, 0.3);
    border-radius: 50%;
    animation: bubble 4s ease-in-out infinite;
}

.bubbling::before {
    left: 20%;
    bottom: 0;
    animation-delay: 0s;
}

.bubbling::after {
    left: 60%;
    bottom: 0;
    animation-delay: 2s;
}

@keyframes bubble {
    0%, 100% {
        transform: translateY(0) scale(0.5);
        opacity: 0;
    }
    50% {
        transform: translateY(-100px) scale(1);
        opacity: 0.5;
    }
}

/* Latte art swirl */
.latte-swirl {
    position: relative;
}

.latte-swirl::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100px;
    height: 100px;
    border: 3px solid rgba(201, 158, 107, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    animation: latteSwirl 3s ease-in-out infinite;
}

@keyframes latteSwirl {
    0% {
        transform: translate(-50%, -50%) scale(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(2) rotate(180deg);
        opacity: 0;
    }
}

/* Glowing coffee effect */
.glow-coffee {
    position: relative;
}

.glow-coffee::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, var(--caramel), transparent 70%);
    opacity: 0;
    transition: var(--transition-normal);
    pointer-events: none;
}

.glow-coffee:hover::after {
    opacity: 0.2;
    animation: glowPulse 2s ease-in-out infinite;
}

@keyframes glowPulse {
    0%, 100% { transform: scale(1); opacity: 0.2; }
    50% { transform: scale(1.1); opacity: 0.3; }
}

/* Coffee steam letters */
@keyframes steamLetter {
    0% {
        transform: translateY(0) translateX(-50%) scale(1);
        opacity: 0.4;
    }
    100% {
        transform: translateY(-100px) translateX(-50%) scale(2);
        opacity: 0;
    }
}

/* Parallax floating elements */
.parallax-float {
    transition: transform 0.3s ease-out;
}

/* Typewriter effect for text */
.typewriter {
    overflow: hidden;
    border-right: 2px solid var(--caramel);
    white-space: nowrap;
    animation: typing 3.5s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink-caret {
    from, to { border-color: transparent; }
    50% { border-color: var(--caramel); }
}

/* ============================================
   ADDITIONAL COFFEE ANIMATIONS
   ============================================ */

/* Coffee bean bouncing */
@keyframes beanBounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

/* Shimmer effect for coffee */
.coffee-shimmer {
    position: relative;
    overflow: hidden;
}

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

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

/* Mug heat waves */
.heat-waves {
    position: relative;
}

.heat-waves::before {
    content: '';
    position: absolute;
    top: -30px;
    left: 50%;
    width: 60px;
    height: 30px;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 5px,
        rgba(255, 255, 255, 0.1) 5px,
        rgba(255, 255, 255, 0.1) 10px
    );
    animation: heatWave 1s ease-in-out infinite;
    transform-origin: bottom center;
}

@keyframes heatWave {
    0%, 100% {
        transform: scaleX(1) scaleY(1);
    }
    50% {
        transform: scaleX(1.2) scaleY(1.1);
    }
}

/* Coffee swirl animation */
@keyframes swirlEffect {
    0% {
        transform: rotate(0deg);
        border-radius: 50%;
    }
    25% {
        border-radius: 40% 60% 60% 40% / 60% 40% 60% 40%;
    }
    50% {
        transform: rotate(180deg);
        border-radius: 50%;
    }
    75% {
        border-radius: 40% 60% 60% 40% / 40% 60% 40% 60%;
    }
    100% {
        transform: rotate(360deg);
        border-radius: 50%;
    }
}

/* Cream pouring effect */
@keyframes creamPour {
    0% {
        clip-path: polygon(0 0, 100% 0, 100% 0, 0 0);
    }
    100% {
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    }
}

/* Espresso extraction animation */
@keyframes espressoExtract {
    0% {
        background-position: 0 100%;
    }
    100% {
        background-position: 0 -100%;
    }
}
