/* ================================================
   PROFESSIONAL LOADING SCREEN - Elite Edition
   ================================================ */

/* Loader Container con efecto glassmorphism */
#page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(ellipse at center, #1a1a1a 0%, #0a0a0a 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), 
                visibility 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

/* Partículas de fondo animadas */
#page-loader::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 204, 0, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: particlesMove 20s linear infinite;
    opacity: 0.5;
}

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

/* Contenedor del loader */
.loader-container {
    position: relative;
    z-index: 10;
    text-align: center;
}

/* Logo profesional con animación */
.loader-brand {
    margin-bottom: 3rem;
    animation: brandPulse 2s ease-in-out infinite;
}

.loader-brand-text {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #ffcc00 0%, #ffd700 50%, #ffcc00 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 3s ease infinite;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.loader-brand-tagline {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 0.5rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    font-weight: 300;
}

/* Spinner circular triple con efectos avanzados */
.loader-spinner-container {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 2rem;
}

.loader-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.loader-spinner-ring {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    position: absolute;
    top: 0;
    left: 0;
}

/* Anillo externo */
.loader-spinner-ring:nth-child(1) {
    width: 120px;
    height: 120px;
    border: 3px solid transparent;
    border-top-color: #ffcc00;
    border-right-color: #ffcc00;
    animation: spinClockwise 1.5s cubic-bezier(0.68, -0.55, 0.27, 1.55) infinite;
    opacity: 0.8;
}

/* Anillo medio */
.loader-spinner-ring:nth-child(2) {
    width: 90px;
    height: 90px;
    border: 3px solid transparent;
    border-left-color: #ffd700;
    border-bottom-color: #ffd700;
    animation: spinCounterClockwise 2s cubic-bezier(0.68, -0.55, 0.27, 1.55) infinite;
    top: 15px;
    left: 15px;
    opacity: 0.6;
}

/* Anillo interno */
.loader-spinner-ring:nth-child(3) {
    width: 60px;
    height: 60px;
    border: 2px solid transparent;
    border-top-color: #ffed4e;
    border-right-color: #ffed4e;
    animation: spinClockwise 1s cubic-bezier(0.68, -0.55, 0.27, 1.55) infinite;
    top: 30px;
    left: 30px;
    opacity: 0.4;
}

/* Centro brillante */
.loader-spinner-core {
    position: absolute;
    width: 20px;
    height: 20px;
    background: radial-gradient(circle, #ffcc00, #ffd700);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 20px #ffcc00, 0 0 40px rgba(255, 204, 0, 0.5);
    animation: corePulse 2s ease-in-out infinite;
}

/* Texto de estado */
.loader-status {
    margin: 2rem 0 1rem;
}

.loader-text {
    color: #ffffff;
    font-size: 1.3rem;
    font-weight: 600;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
    animation: textFade 2s ease-in-out infinite;
}

.loader-subtext {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.95rem;
    font-weight: 300;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* Progress bar profesional */
.loader-progress-container {
    width: 280px;
    margin: 2rem auto 1.5rem;
}

.loader-progress {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
}

.loader-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #ffcc00, #ffd700, #ffed4e, #ffd700, #ffcc00);
    background-size: 200% 100%;
    border-radius: 10px;
    animation: progressFlow 2.5s ease-in-out infinite;
    box-shadow: 0 0 10px rgba(255, 204, 0, 0.5);
    position: relative;
}

.loader-progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 1.5s infinite;
}

/* Indicador de porcentaje */
.loader-percentage {
    text-align: center;
    margin-top: 0.5rem;
    color: #ffcc00;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 1px;
}

/* Puntos animados minimalistas */
.loader-dots {
    display: flex;
    gap: 0.7rem;
    justify-content: center;
    margin-top: 2rem;
}

.loader-dots span {
    width: 8px;
    height: 8px;
    background: #ffcc00;
    border-radius: 50%;
    animation: dotPulse 1.4s cubic-bezier(0.4, 0, 0.6, 1) infinite;
    box-shadow: 0 0 8px rgba(255, 204, 0, 0.6);
}

.loader-dots span:nth-child(1) {
    animation-delay: 0s;
}

.loader-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.loader-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

/* Tips profesionales */
.loader-tip {
    position: absolute;
    bottom: 3rem;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.85rem;
    text-align: center;
    max-width: 400px;
    padding: 0 2rem;
    font-style: italic;
    animation: tipFade 3s ease-in-out infinite;
}

/* ================================================
   ANIMACIONES PROFESIONALES
   ================================================ */

@keyframes particlesMove {
    0% {
        transform: translate(0, 0);
    }
    100% {
        transform: translate(50px, 50px);
    }
}

@keyframes gradientShift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

@keyframes brandPulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.85;
        transform: scale(1.02);
    }
}

@keyframes spinClockwise {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes spinCounterClockwise {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(-360deg);
    }
}

@keyframes corePulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 0.8;
    }
}

@keyframes textFade {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

@keyframes progressFlow {
    0% {
        width: 0%;
        background-position: 0% 50%;
    }
    50% {
        width: 70%;
        background-position: 100% 50%;
    }
    100% {
        width: 100%;
        background-position: 200% 50%;
    }
}

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

@keyframes dotPulse {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1.2);
        opacity: 1;
    }
}

@keyframes tipFade {
    0%, 100% {
        opacity: 0.4;
    }
    50% {
        opacity: 0.7;
    }
}

/* ================================================
   RESPONSIVE DESIGN
   ================================================ */

@media (max-width: 768px) {
    .loader-brand-text {
        font-size: 2rem;
    }
    
    .loader-spinner-container {
        width: 90px;
        height: 90px;
    }
    
    .loader-spinner-ring:nth-child(1) {
        width: 90px;
        height: 90px;
    }
    
    .loader-spinner-ring:nth-child(2) {
        width: 65px;
        height: 65px;
        top: 12.5px;
        left: 12.5px;
    }
    
    .loader-spinner-ring:nth-child(3) {
        width: 40px;
        height: 40px;
        top: 25px;
        left: 25px;
    }
    
    .loader-text {
        font-size: 1.1rem;
    }
    
    .loader-progress-container {
        width: 220px;
    }
    
    .loader-tip {
        font-size: 0.75rem;
        bottom: 2rem;
    }
}

@media (max-width: 480px) {
    .loader-brand-text {
        font-size: 1.5rem;
    }
    
    .loader-brand-tagline {
        font-size: 0.75rem;
    }
}
