.loader-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 9999;
    will-change: opacity;
}

.loader-container > h1{
    font-size: 24px;
    color: #4b2810;
    font-weight: 700;
}

.coffee-loader {
    position: relative;
    width: 250px;
    height: 100px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 160px; /* Add space below the image */
}

.coffee-cup {
    position: absolute;
    top: -30px;
    left: 30px;
    width: 40px;
    height: 40px;
    border: 4px solid #333;
    border-radius: 0 0 10px 10px;
    background: transparent;
    overflow: visible;
    transform-origin: center;
    animation: tiltCup 3.5s ease-in-out forwards;
    will-change: transform;
}

.coffee-cup::before {
    content: '';
    position: absolute;
    left: -22px;
    top: 5px;
    width: 16px;
    height: 20px;
    border: 4px solid #333;
    border-right: none;
    border-radius: 20px 0 0 20px;
    background: transparent;
    z-index: 1;
}

.coffee-steam {
    position: absolute;
    width: 12px;
    height: 25px;
    background: rgba(238, 238, 238, 0.8);
    border-radius: 50%;
    filter: blur(8px);
    animation: steam 2s infinite, hideAfterPour 3.5s forwards;
    opacity: 0;
    z-index: 2;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.coffee-steam:nth-child(1) { left: 5px; top: -30px; animation-delay: 0.1s; animation-duration: 2.5s; }
.coffee-steam:nth-child(2) { left: 15px; top: -40px; animation-delay: 0.3s; width: 15px; animation-duration: 2.8s; }
.coffee-steam:nth-child(3) { left: 28px; top: -35px; animation-delay: 0.2s; width: 10px; animation-duration: 2.2s; }
.coffee-steam:nth-child(4) { left: 35px; top: -45px; animation-delay: 0.4s; width: 14px; animation-duration: 2.6s; }
.coffee-steam:nth-child(5) { left: 20px; top: -50px; animation-delay: 0.5s; width: 12px; animation-duration: 2.4s; }

.coffee-liquid {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0;
    background: #4b2810;
    animation: drainCoffee 3.5s ease-in-out forwards;
}

.coffee-stream {
    position: absolute;
    left: 70px; 
    top: -10px;
    width: 10px;
    height: 0;
    background: linear-gradient(90deg, 
        rgba(75, 40, 16, 0.3) 0%,
        rgba(75, 40, 16, 0.8) 50%,
        rgba(75, 40, 16, 0.3) 100%
    );
    filter: blur(2px);
    transform-origin: top;
    clip-path: polygon(
        30% 0%,
        70% 0%,
        100% 100%,
        0% 100%
    );
    animation: pourCoffee 3.5s ease-in-out forwards;
}

.coffee-stream::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: inherit;
    filter: blur(4px);
    opacity: 0.5;
}

.coffee-drops {
    position: absolute;
    left: 85px;
    top: 40px;
    pointer-events: none;
}

.drop {
    opacity: 0;
}

.loading-bar {
    position: absolute;
    width: 200px;
    height: 20px;
    background: #f0f0f0;
    border-radius: 10px;
    overflow: hidden;
}

.liquid {
    position: absolute;
    top: 0;
    left: 0;
    width: 0%;
    height: 100%;
    background: #4b2810;
    border-radius: 10px;
    animation: fill 3s ease-in-out forwards;
}

.static-logo {
    width: 150px;
    height: auto;
    position: absolute;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
}

.hide-loader {
    opacity: 0;
    transition: opacity 0.5s ease-out;
}

@keyframes fill {
    0% {
        width: 0%;
    }
    100% {
        width: 100%;
    }
}

@keyframes fillCup {
    0% {
        height: 0;
    }
    100% {
        height: 90%;
    }
}

@keyframes pourCoffee {
    0% {
        height: 0;
        opacity: 0;
    }
    10% {
        height: 65px;
        opacity: 1;
    }
    80% {
        height: 65px; 
        opacity: 1;
    }
    100% {
        height: 0;
        opacity: 0;
    }
}

@keyframes tiltCup {
    0% { transform: rotate(0deg); }
    10% { transform: rotate(45deg); }
    80% { transform: rotate(45deg); }
    100% { transform: rotate(0deg); }
}

@keyframes drainCoffee {
    0% { 
        height: 90%;
        background: #4b2810;
    }
    10% {
        height: 90%;
        background: #4b2810;
    }
    80% { 
        height: 10%;
        background: #4b2810;
    }
    100% { 
        height: 10%;
        background: #4b2810;
    }
}

@keyframes steam {
    0% {
        transform: translateY(0) scaleX(1) rotate(0deg);
        opacity: 0;
    }
    15% {
        opacity: 0.8;
    }
    40% {
        transform: translateY(-30px) scaleX(1.5) rotate(8deg);
        opacity: 0.9;
    }
    60% {
        transform: translateY(-50px) scaleX(2) rotate(-5deg);
        opacity: 0.6;
    }
    80% {
        transform: translateY(-70px) scaleX(1.5) rotate(5deg);
        opacity: 0.2;
    }
    100% {
        transform: translateY(-80px) scaleX(1) rotate(0deg);
        opacity: 0;
    }
}

@keyframes hideAfterPour {
    0%, 60% {
        visibility: visible;
        opacity: 1;
    }
    80%, 100% {
        visibility: hidden;
        opacity: 0;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
        visibility: hidden;
    }
}
