﻿/* Overlay bao trùm toàn trang */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(198, 198, 198, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Segoe UI', sans-serif;
    z-index: 9999; /* luôn trên cùng */
    user-select: none;
    pointer-events: auto; /* chặn thao tác phía dưới */
}

.loader-container {
    position: relative;
    width: 180px;
    height: 240px;
    text-align: center;
    pointer-events: none;
}

/* 🌫️ Sương */
.mist {
    position: absolute;
    bottom: 70px;
    left: 50%;
    width: 90px;
    height: 130px;
    background: radial-gradient(circle, rgba(180,255,180,0.14) 0%, transparent 75%);
    transform: translateX(-50%);
    border-radius: 50%;
    filter: blur(6px);
    animation: mistRise 6s ease-in-out infinite;
    z-index: 0;
    opacity: 0.12;
}

    .mist:nth-child(1) {
        animation-delay: 0s;
        opacity: 0.15;
    }

    .mist:nth-child(2) {
        animation-delay: 3s;
        width: 70px;
        height: 110px;
        bottom: 65px;
        opacity: 0.1;
    }

@keyframes mistRise {
    0% {
        transform: translateX(-50%) translateY(0) scale(0.8);
        opacity: 0.15;
    }

    50% {
        transform: translateX(-50%) translateY(-35px) scale(1);
        opacity: 0.35;
    }

    100% {
        transform: translateX(-50%) translateY(0) scale(0.8);
        opacity: 0.15;
    }
}

/* ✨ Giọt tinh dầu */
.drop {
    width: 20px;
    height: 30px;
    background: radial-gradient(circle at 30% 30%, #a8d5a3, #4caf50);
    border-radius: 50% 50% 65% 65% / 65% 65% 35% 35%;
    position: absolute;
    top: 0;
    left: 80px;
    animation: dropFall 2.3s ease-in-out infinite;
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.6), inset 0 6px 6px rgba(255, 255, 255, 0.5);
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.1));
    z-index: 2;
    opacity: 0.9;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

    .drop:nth-child(3) {
        animation-delay: 1.1s;
        left: 60px;
        width: 18px;
        height: 28px;
        opacity: 0.8;
    }

@keyframes dropFall {
    0% {
        top: 0;
        opacity: 0;
        transform: scale(0.7);
    }

    35% {
        opacity: 1;
    }

    80% {
        top: 120px;
        transform: scale(1);
        opacity: 1;
    }

    100% {
        top: 120px;
        opacity: 0;
        transform: scale(0.5);
    }
}

/* 🌿 Lá */
.leaf {
    position: absolute;
    bottom: 70px;
    left: 50%;
    transform-origin: center bottom;
    width: 95px;
    height: 48px;
    background: linear-gradient(145deg, #70c170, #389e38);
    border-radius: 0 50% 50% 50%;
    box-shadow: 0 0 15px rgba(76, 175, 80, 0.35);
    animation: leafFloat 3.5s ease-in-out infinite;
    z-index: 10;
    filter: drop-shadow(0 2px 2px rgba(0,0,0,0.05));
    pointer-events: none;
}

@keyframes leafFloat {
    0%, 100% {
        transform: translateX(-50%) rotate(-10deg) translateY(0);
    }

    50% {
        transform: translateX(-50%) rotate(-6deg) translateY(6px);
    }
}

/* 🌊 Gợn nước */
.ripple {
    position: absolute;
    bottom: 47px;
    left: 50%;
    width: 12px;
    height: 12px;
    background: transparent;
    border: 2px solid #a5d6a7;
    border-radius: 50%;
    transform: translateX(-50%);
    animation: rippleExpand 2.8s ease-out infinite;
    z-index: 0;
    opacity: 0.4;
    pointer-events: none;
}

    .ripple:nth-child(5) {
        animation-delay: 0.9s;
        opacity: 0.25;
        border-color: #7fb77f;
    }

@keyframes rippleExpand {
    0% {
        width: 0px;
        height: 0px;
        opacity: 0.35;
    }

    60% {
        opacity: 0.18;
    }

    100% {
        width: 48px;
        height: 48px;
        opacity: 0;
    }
}

/* chữ loading */
.loading-text {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 18px;
    color: #fff;
    user-select: none;
    z-index: 11;
    text-shadow: 0 0 10px rgba(27, 94, 32, 0.9);
    font-weight: 700;
    white-space: nowrap;
    pointer-events: none;
}

@keyframes blink {
    0%, 100% {
        opacity: 1;
    }

    50% {
        opacity: 0.65;
    }
}

.loading-overlay.fm-hidden {
    display: none;
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}