/**
 * MegoVerse Site Loader - Frontend CSS
 */

/* Main Container */
#mego-site-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    /* Ensure it is on top of everything */
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}

#mego-site-loader.mego-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Video Background */
.mego-loader-video {
    position: absolute;
    top: 0;
    left: 0;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    object-fit: cover;
    z-index: -2;
}

/* Background Overlay */
.mego-loader-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

/* Content Container */
.mego-loader-content {
    position: relative;
    text-align: center;
    z-index: 10;
    max-width: 80%;
}

/* Logo */
.mego-loader-logo img {
    max-width: 200px;
    height: auto;
    margin-bottom: 20px;
}

/* Title & Spinner Layout Adjustments */
.mego-layout-title_loader .mego-loader-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.mego-layout-title_loader .mego-loader-animation {
    margin-top: 15px; /* Tighter spacing for title + spinner combo */
}

/* Text */
.mego-loader-title {
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 10px;
}

.mego-loader-tagline {
    font-size: 1.2rem;
    margin: 0 0 20px;
    opacity: 0.9;
}

/* Animations */
.mego-loader-animation {
    margin-top: 20px;
    display: flex;
    justify-content: center;
}

/* Spinner */
.mego-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    border-top-color: #fff;
    /* fallback */
    animation: mego-spin 1s ease-in-out infinite;
}

@keyframes mego-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Pulse */
.mego-pulse {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: #fff;
    /* fallback */
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7);
    animation: mego-pulse 1.5s infinite cubic-bezier(0.66, 0, 0, 1);
}

@keyframes mego-pulse {
    to {
        box-shadow: 0 0 0 30px rgba(255, 255, 255, 0);
    }
}

/* Bar Progress */
.mego-bar-container {
    width: 200px;
    height: 6px;
    background-color: rgba(255, 255, 255, 0.2);
    /* fallback */
    border-radius: 3px;
    overflow: hidden;
}

.mego-bar-progress {
    width: 0%;
    height: 100%;
    background-color: #fff;
    /* fallback */
    animation: mego-progress 2s ease-in-out forwards;
}

@keyframes mego-progress {
    0% {
        width: 0%;
    }

    50% {
        width: 50%;
    }

    100% {
        width: 100%;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .mego-loader-logo img {
        max-width: 150px;
    }

    .mego-loader-title {
        font-size: 1.5rem;
    }

    .mego-loader-tagline {
        font-size: 1rem;
    }
}