/* Loader animado avanzado para NexusTemplates */

#nexus-loader {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity .7s cubic-bezier(.4, 0, .2, 1);
    overflow: hidden;
}

#nexus-loader::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    background: linear-gradient(120deg, #232526 0%, #0A1AFF 50%, #ffe600 100%);
    background-size: 200% 200%;
    animation: loaderBgMove 3.5s ease-in-out infinite alternate;
    filter: blur(8px) brightness(1.1);
}

@keyframes loaderBgMove {
    0% {
        background-position: 0% 50%;
    }
    100% {
        background-position: 100% 50%;
    }
}

#nexus-loader.hide {
    opacity: 0;
    pointer-events: none;
}

.loader-bg {
    text-align: center;
}

.loader-logo {
    font-family: 'Inter', sans-serif;
    font-size: 2.7rem;
    font-weight: 900;
    letter-spacing: 2px;
    margin-bottom: 36px;
    color: #fff;
    display: flex;
    justify-content: center;
    gap: 10px;
    animation: logoPop 1.2s cubic-bezier(.4, 0, .2, 1);
    text-shadow: 0 4px 24px #000a;
    perspective: 600px;
}

.loader-logo span {
    display: inline-block;
    will-change: transform;
}

.loader-logo .nexus {
    color: #ffe600;
    text-shadow: 0 2px 16px #fff70099, 0 4px 24px #000a;
    animation: colorPulse 1.5s infinite alternate, logo3d 2.2s cubic-bezier(.4, 0, .2, 1) infinite alternate;
}

.loader-logo .templates {
    color: #fff;
    text-shadow: 0 2px 16px #ffe60099, 0 4px 24px #000a;
    animation: logo3d 2.2s cubic-bezier(.4, 0, .2, 1) infinite alternate-reverse;
}

@keyframes logo3d {
    0% {
        transform: rotateY(-18deg) scale(1.05);
    }
    100% {
        transform: rotateY(18deg) scale(1.12);
    }
}

.loader-logo .nexus {
    color: #ffe600;
    text-shadow: 0 2px 16px #fff70099, 0 4px 24px #000a;
    animation: colorPulse 1.5s infinite alternate;
}

.loader-logo .templates {
    color: #fff;
    text-shadow: 0 2px 16px #ffe60099, 0 4px 24px #000a;
}

@keyframes logoPop {
    0% {
        transform: scale(0.7) translateY(40px);
        opacity: 0;
    }
    60% {
        transform: scale(1.1) translateY(-10px);
        opacity: 1;
    }
    100% {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

@keyframes colorPulse {
    0% {
        color: #ffe600;
    }
    100% {
        color: #fff700;
    }
}

.loader-bar {
    width: 260px;
    height: 14px;
    background: #fff2;
    border-radius: 8px;
    overflow: hidden;
    margin: 0 auto;
    box-shadow: 0 2px 12px #0003;
    position: relative;
}

.loader-bar .bar {
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, #ffe600 0%, #fff 60%, #ffe600 100%);
    border-radius: 8px;
    animation: barMove 2s cubic-bezier(.4, 0, .2, 1) forwards;
    box-shadow: 0 2px 12px #ffe60099;
    position: relative;
    z-index: 1;
}

.loader-bar::after {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    background: linear-gradient(120deg, transparent 0%, #fff8 50%, transparent 100%);
    opacity: 0.7;
    mix-blend-mode: lighten;
    animation: barLight 1.5s linear infinite;
}

@keyframes barLight {
    0% {
        background-position: -80px 0;
    }
    100% {
        background-position: 260px 0;
    }
}

.loader-bar .bar {
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, #ffe600 0%, #fff 60%, #ffe600 100%);
    border-radius: 8px;
    animation: barMove 2s cubic-bezier(.4, 0, .2, 1) forwards;
    box-shadow: 0 2px 12px #ffe60099;
}

@keyframes barMove {
    0% {
        width: 0;
    }
    60% {
        width: 80%;
    }
    100% {
        width: 100%;
    }
}

.loader-bar {
    width: 220px;
    height: 10px;
    background: #fff3;
    border-radius: 8px;
    overflow: hidden;
    margin: 0 auto;
    box-shadow: 0 2px 12px #0002;
}

.loader-bar .bar {
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, #ffe600 0%, #0A1AFF 100%);
    border-radius: 8px;
    animation: barMove 2s cubic-bezier(.4, 0, .2, 1) forwards;
}

@keyframes barMove {
    0% {
        width: 0;
    }
    60% {
        width: 80%;
    }
    100% {
        width: 100%;
    }
}