/* ===== Loader / Splash Screen ===== */

.loader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

.loader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

/* ===== Coffee Cup Loader ===== */
.coffee-cup-loader {
    position: relative;
    width: 80px;
    height: 100px;
}

.cup-body {
    position: relative;
    width: 60px;
    height: 65px;
    background: linear-gradient(180deg, rgba(200,149,108,0.2), rgba(200,149,108,0.05));
    border: 2px solid var(--color-caramel);
    border-radius: 0 0 18px 18px;
    overflow: hidden;
    margin: 0 auto;
}

.coffee-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0%;
    background: linear-gradient(180deg, var(--color-caramel), var(--color-mocha));
    border-radius: 0 0 15px 15px;
    animation: fillCoffee 2.5s ease-in-out infinite;
}

@keyframes fillCoffee {
    0% { height: 0%; }
    50% { height: 85%; }
    80% { height: 85%; }
    100% { height: 0%; }
}

.cup-handle {
    position: absolute;
    right: 2px;
    top: 18px;
    width: 18px;
    height: 28px;
    border: 2px solid var(--color-caramel);
    border-left: none;
    border-radius: 0 12px 12px 0;
}

.cup-saucer {
    width: 80px;
    height: 8px;
    background: linear-gradient(90deg, transparent, var(--color-caramel), transparent);
    border-radius: 50%;
    margin: 3px auto 0;
    opacity: 0.5;
}

/* ===== Steam Animation ===== */
.steam-container {
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
}

.steam {
    width: 3px;
    height: 20px;
    background: linear-gradient(to top, rgba(200,149,108,0.4), transparent);
    border-radius: 3px;
    animation: steamRise 2s ease-in-out infinite;
}

.steam-1 { animation-delay: 0s; }
.steam-2 { animation-delay: 0.4s; }
.steam-3 { animation-delay: 0.8s; }

@keyframes steamRise {
    0% {
        opacity: 0;
        transform: translateY(5px) scaleY(0.5);
    }
    30% {
        opacity: 0.8;
    }
    100% {
        opacity: 0;
        transform: translateY(-15px) scaleY(1.2) translateX(3px);
    }
}

/* ===== Loader Text & Progress ===== */
.loader-text {
    font-family: var(--font-accent);
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.loader-progress {
    width: 180px;
    height: 3px;
    background: var(--bg-surface);
    border-radius: 3px;
    overflow: hidden;
}

.loader-progress-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--color-accent), var(--color-accent-light));
    border-radius: 3px;
    transition: width 0.3s ease;
}
