#global-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #486fa8; /* Dark background for contrast */
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
    visibility: visible;
}

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

/* 1. The Container keeping everything aligned */
.logo-loader {
    position: relative;
    width: 150px; /* Adjust to your logo size */
    height: 150px;
}

/* 2. Common styles for both logo layers */
.logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Keeps logo proportions */
    position: absolute;
    top: 0;
    left: 0;
}

/* 3. The "Empty" background logo */
.logo-base {
    filter: grayscale(100%) brightness(50%); /* Makes it gray/dim */
    opacity: 0.3;
}

/* 4. The "Liquid" wrapper - This clips the colored logo */
.logo-fill-wrapper {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0%; /* Starts empty */
    overflow: hidden; /* This cuts off the top of the image */
    animation: fillUp 2.5s ease-in-out forwards;
}

/* 5. The Colored Logo inside the wrapper */
/* IMPORTANT: It must be the full height of the parent, 
   even when the wrapper is small. */
.logo-fill-wrapper .logo-img {
    height: 150px; /* Must match the .logo-loader height */
    bottom: 0;
    top: auto;
}

/* 6. The Heartbeat Animation Class (Added via JS later) */
.heartbeat {
    animation: pulse 1.5s infinite;
}

/* --- Animations --- */

/* Liquid Fill Animation */
@keyframes fillUp {
    0% { height: 0%; }
    100% { height: 100%; }
}

/* Heartbeat Animation */
@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}

/* Splash Text */
.splash-text {
    margin-top: 24px;
    color: white;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 1px;
    opacity: 0;
    text-align: center;
    animation: fadeInUp 0.8s ease-out forwards 0.5s;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Progress Bar Styles */
.progress-container {
    width: 280px;
    height: 6px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    margin-top: 16px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
}

.progress-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #ffffff 0%, #a1c4fd 100%);
    border-radius: 10px;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
    position: relative;
}

/* Shimmer effect */
.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(
        90deg,
        rgba(255,255,255,0) 0%,
        rgba(255,255,255,0.4) 50%,
        rgba(255,255,255,0) 100%
    );
    transform: translateX(-100%);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    100% {
        transform: translateX(100%);
    }
}

.progress-animate {
    animation: progressFill 15s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

@keyframes progressFill {
    0% { width: 0%; }
    10% { width: 20%; } /* Fast start */
    50% { width: 60%; }
    80% { width: 85%; }
    100% { width: 98%; } /* Almost done, waits for redirect */
}
