/* chunk_fetch_styles.css */
/* Estilos aislados para la biblioteca de subida por fragmentos. */
/* Requiere MaterializeCSS (barra de progreso) y Font Awesome Free (iconos). */

/* ===========================
   Contenedor principal
   =========================== */
.chunk-fetch-js {
    position: relative;
    margin: 1.5rem 0;
    padding: 0.75rem;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.03);
    font-family: inherit;
}

/* ===========================
   Barra de progreso (MaterializeCSS)
   =========================== */
.chunk-fetch-js__progress.progress {
    margin: 0 0 1.25rem 0;
    height: 8px;
    background-color: #eceff1;
    border-radius: 4px;
    overflow: hidden;
}

.chunk-fetch-js__progress .determinate {
    transition: width 0.15s linear;
    will-change: width;
    background: linear-gradient(90deg, #26a69a, #42a5f5);
}

/* ===========================
   Animación infinita (mensaje de espera)
   =========================== */
.chunk-fetch-js__animation {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1.25rem 1rem;
    font-size: 1rem;
    color: #455a64;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

/* Icono giratorio con aceleración hardware */
.chunk-fetch-js__animation .fa-cloud-upload-alt {
    font-size: 2.4rem;
    color: #42a5f5;
    animation: chunk-upload-spin 2s linear infinite;
    will-change: transform;
}

/* Texto con efecto morphing sutil */
.chunk-fetch-js__mensaje {
    font-weight: 500;
    letter-spacing: 0.4px;
    animation: chunk-upload-text 3s ease-in-out infinite alternate;
    will-change: opacity, transform;
}

/* Partículas decorativas con movimiento parallax */
.chunk-fetch-js__particulas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.chunk-fetch-js__particulas span {
    position: absolute;
    width: 8px;
    height: 8px;
    background: rgba(66, 165, 245, 0.3);
    border-radius: 50%;
    animation: chunk-float-particle 4s infinite alternate ease-in-out;
    will-change: transform, opacity;
}

.chunk-fetch-js__particulas span:nth-child(1) {
    top: 10%;
    left: 5%;
    animation-delay: 0s;
}
.chunk-fetch-js__particulas span:nth-child(2) {
    top: 70%;
    left: 85%;
    animation-delay: 1.2s;
    background: rgba(38, 166, 154, 0.3);
}
.chunk-fetch-js__particulas span:nth-child(3) {
    top: 45%;
    left: 48%;
    animation-delay: 2.5s;
    background: rgba(255, 202, 40, 0.3);
}

/* ===========================
   Keyframes (acelerados por hardware)
   =========================== */
@keyframes chunk-upload-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

@keyframes chunk-upload-text {
    0% {
        opacity: 0.7;
        color: #26a69a;
        transform: translateY(0);
    }
    100% {
        opacity: 1;
        color: #42a5f5;
        transform: translateY(-3px);
    }
}

@keyframes chunk-float-particle {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 0.2;
    }
    100% {
        transform: translate(18px, -20px) scale(1.6);
        opacity: 0.6;
    }
}

/* ===========================
   Adaptaciones responsivas
   =========================== */
@media (max-width: 600px) {
    .chunk-fetch-js__animation {
        flex-direction: column;
        text-align: center;
    }
    .chunk-fetch-js__mensaje {
        font-size: 0.9rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .chunk-fetch-js__animation *,
    .chunk-fetch-js__particulas span {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}