/* ========================================
   PANTALLA DE CARGA - LOGO CON COMETA ORBITAL
   Animación elegante y fluida
   ======================================== */

/* ===== PANTALLA DE CARGA ===== */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

/* Estado oculto */
.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* ===== CONTENEDOR PRINCIPAL ===== */
.loading-content {
    position: relative;
    width: 200px;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== LOGO CENTRAL ===== */
.loading-logo {
    width: 120px;
    height: auto;
    z-index: 2;
    position: relative;
    animation: logoFloat 3s ease-in-out infinite;
    filter: drop-shadow(0 0 20px rgba(114, 214, 255, 0.5));
}

@keyframes logoFloat {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* ===== ÓRBITA DEL COMETA ===== */
.orbit-container {
    position: absolute;
    width: 180px;
    height: 180px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: rotateOrbit 3s linear infinite;
}

@keyframes rotateOrbit {
    from {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* ===== COMETA AZUL ===== */
.comet {
    position: absolute;
    width: 16px;
    height: 16px;
    background: radial-gradient(circle, #72d6ff 0%, #4db8ff 50%, transparent 70%);
    border-radius: 50%;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    box-shadow: 
        0 0 10px #72d6ff,
        0 0 20px #72d6ff,
        0 0 30px #72d6ff;
    animation: cometGlow 1.5s ease-in-out infinite;
}

/* Núcleo brillante del cometa */
.comet::before {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    background: #ffffff;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 8px #ffffff;
}

/* Estela del cometa */
.comet::after {
    content: '';
    position: absolute;
    width: 4px;
    height: 50px;
    background: linear-gradient(
        to bottom,
        rgba(114, 214, 255, 0.9),
        rgba(114, 214, 255, 0.5),
        rgba(114, 214, 255, 0.2),
        transparent
    );
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 2px;
    filter: blur(2px);
}

@keyframes cometGlow {
    0%, 100% {
        box-shadow: 
            0 0 10px #72d6ff,
            0 0 20px #72d6ff,
            0 0 30px #72d6ff;
        transform: translateX(-50%) scale(1);
    }
    50% {
        box-shadow: 
            0 0 15px #72d6ff,
            0 0 30px #72d6ff,
            0 0 45px #72d6ff;
        transform: translateX(-50%) scale(1.2);
    }
}

/* ===== TEXTO DE CARGA ===== */
.loading-text {
    position: absolute;
    bottom: -70px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 3px;
    text-transform: uppercase;
    white-space: nowrap;
    animation: textPulse 2s ease-in-out infinite;
}

@keyframes textPulse {
    0%, 100% {
        opacity: 0.5;
    }
    50% {
        opacity: 1;
    }
}

/* ===== PUNTOS ANIMADOS ===== */
.loading-dots {
    display: inline-block;
    min-width: 20px;
}

.loading-dots::after {
    content: '';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: ''; }
    40% { content: '.'; }
    60% { content: '..'; }
    80%, 100% { content: '...'; }
}

/* ===== CÍRCULO ORBITAL (decorativo) ===== */
.orbit-ring {
    position: absolute;
    width: 180px;
    height: 180px;
    border: 2px solid rgba(114, 214, 255, 0.1);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: ringPulse 3s ease-in-out infinite;
}

@keyframes ringPulse {
    0%, 100% {
        opacity: 0.3;
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        opacity: 0.6;
        transform: translate(-50%, -50%) scale(1.05);
    }
}

/* ===== PARTÍCULAS DE FONDO ===== */
.loading-particles {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
    opacity: 0.3;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: #72d6ff;
    border-radius: 50%;
    animation: particleFloat 10s linear infinite;
}

.particle:nth-child(1) { left: 10%; animation-delay: 0s; animation-duration: 8s; }
.particle:nth-child(2) { left: 20%; animation-delay: 1s; animation-duration: 10s; }
.particle:nth-child(3) { left: 30%; animation-delay: 2s; animation-duration: 12s; }
.particle:nth-child(4) { left: 40%; animation-delay: 3s; animation-duration: 9s; }
.particle:nth-child(5) { left: 50%; animation-delay: 4s; animation-duration: 11s; }
.particle:nth-child(6) { left: 60%; animation-delay: 5s; animation-duration: 8s; }
.particle:nth-child(7) { left: 70%; animation-delay: 6s; animation-duration: 10s; }
.particle:nth-child(8) { left: 80%; animation-delay: 7s; animation-duration: 12s; }
.particle:nth-child(9) { left: 90%; animation-delay: 0.5s; animation-duration: 9s; }
.particle:nth-child(10) { left: 15%; animation-delay: 2.5s; animation-duration: 11s; }

@keyframes particleFloat {
    0% {
        transform: translateY(100vh) scale(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100px) scale(1.5);
        opacity: 0;
    }
}

/* ===== RESPONSIVE MÓVIL ===== */
@media (max-width: 768px) {
    .loading-content {
        width: 160px;
        height: 160px;
    }
    
    .loading-logo {
        width: 90px;
    }
    
    .orbit-container,
    .orbit-ring {
        width: 140px;
        height: 140px;
    }
    
    .comet {
        width: 14px;
        height: 14px;
    }
    
    .comet::before {
        width: 6px;
        height: 6px;
    }
    
    .comet::after {
        height: 40px;
        width: 3px;
    }
    
    .loading-text {
        font-size: 12px;
        bottom: -60px;
        letter-spacing: 2px;
    }
}

@media (max-width: 400px) {
    .loading-content {
        width: 140px;
        height: 140px;
    }
    
    .loading-logo {
        width: 80px;
    }
    
    .orbit-container,
    .orbit-ring {
        width: 120px;
        height: 120px;
    }
}

/* ===== MODO REDUCIR MOVIMIENTO ===== */
@media (prefers-reduced-motion: reduce) {
    .loading-logo,
    .comet,
    .loading-text,
    .particle,
    .orbit-ring {
        animation-duration: 10s !important;
    }
    
    .orbit-container {
        animation-duration: 8s !important;
    }
}

/* ===== ANIMACIÓN DE SALIDA ===== */
.loading-screen.fade-out {
    animation: fadeOut 0.6s ease forwards;
}

@keyframes fadeOut {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(1.05);
    }
}