/* PRELOADER TECNOLÓGICO FUTURISTA */

.preloader-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #000028 0%, #0a0e2e 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.6s ease-out, visibility 0.6s ease-out;
}

.preloader-container.hidden {
    opacity: 0;
    visibility: hidden;
}

.preloader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
}

/* Logo animado */
.preloader-logo {
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.preloader-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 0 20px rgba(39, 193, 191, 0.6));
    animation: logoFloat 3s ease-in-out infinite;
}

@keyframes logoFloat {
    0%, 100% {
        transform: translateY(0px) scale(1);
    }
    50% {
        transform: translateY(-20px) scale(1.05);
    }
}

/* Círculos animados alrededor del logo */
.preloader-rings {
    position: absolute;
    width: 160px;
    height: 160px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid transparent;
    border-top-color: #27c1bf;
    border-right-color: rgba(39, 193, 191, 0.3);
    animation: spin linear infinite;
}

.ring:nth-child(1) {
    animation-duration: 3s;
}

.ring:nth-child(2) {
    width: 120px;
    height: 120px;
    top: 20px;
    left: 20px;
    border-top-color: #4dd4d1;
    animation-duration: 2.5s;
    animation-direction: reverse;
}

.ring:nth-child(3) {
    width: 80px;
    height: 80px;
    top: 40px;
    left: 40px;
    border-top-color: #1fa9a7;
    animation-duration: 2s;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Barra de progreso */
.progress-bar-container {
    width: 300px;
    height: 6px;
    background: rgba(39, 193, 191, 0.1);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 0 20px rgba(39, 193, 191, 0.2);
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #27c1bf 0%, #4dd4d1 50%, #27c1bf 100%);
    background-size: 200% 100%;
    width: 0%;
    border-radius: 10px;
    box-shadow: 0 0 15px rgba(39, 193, 191, 0.8);
    animation: progressMove 0.5s ease-out forwards;
}

@keyframes progressMove {
    to {
        width: 100%;
    }
}

/* Efecto de brillo en la barra */
.progress-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

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

/* Porcentaje de carga */
.progress-text {
    margin-top: 20px;
    text-align: center;
}

.progress-percentage {
    font-size: 48px;
    font-weight: 900;
    color: #27c1bf;
    font-family: 'Century Gothic', 'Trebuchet MS', sans-serif;
    text-shadow: 0 0 20px rgba(39, 193, 191, 0.5);
    animation: numberPulse 0.5s ease-out;
}

@keyframes numberPulse {
    0% {
        transform: scale(1.2);
        opacity: 0.5;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.progress-label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 8px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* Partículas flotantes */
.particles {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #27c1bf;
    border-radius: 50%;
    opacity: 0.6;
    animation: float linear infinite;
}

@keyframes float {
    to {
        transform: translateY(-100vh) translateX(var(--tx));
        opacity: 0;
    }
}

/* Líneas de código animadas */
.code-lines {
    position: absolute;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: #27c1bf;
    opacity: 0.7;
}

.code-line {
    display: inline-block;
    margin: 0 5px;
    animation: codeFlash 1.5s ease-in-out infinite;
}

.code-line:nth-child(1) {
    animation-delay: 0s;
}

.code-line:nth-child(2) {
    animation-delay: 0.5s;
}

.code-line:nth-child(3) {
    animation-delay: 1s;
}

@keyframes codeFlash {
    0%, 100% {
        opacity: 0.3;
    }
    50% {
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .preloader-logo {
        width: 80px;
        height: 80px;
    }

    .preloader-rings {
        width: 120px;
        height: 120px;
    }

    .ring:nth-child(2) {
        width: 90px;
        height: 90px;
        top: 15px;
        left: 15px;
    }

    .ring:nth-child(3) {
        width: 60px;
        height: 60px;
        top: 30px;
        left: 30px;
    }

    .progress-bar-container {
        width: 250px;
    }

    .progress-percentage {
        font-size: 40px;
    }

    .progress-label {
        font-size: 12px;
    }

    .code-lines {
        font-size: 10px;
    }
}

@media (max-width: 480px) {
    .preloader-logo {
        width: 60px;
        height: 60px;
    }

    .preloader-rings {
        width: 100px;
        height: 100px;
    }

    .ring:nth-child(2) {
        width: 70px;
        height: 70px;
        top: 15px;
        left: 15px;
    }

    .ring:nth-child(3) {
        width: 40px;
        height: 40px;
        top: 30px;
        left: 30px;
    }

    .progress-bar-container {
        width: 200px;
    }

    .progress-percentage {
        font-size: 32px;
    }

    .code-lines {
        display: none;
    }
}
