﻿/*-----------------------------Loader Global Mejorado---------------------------------*/

/* Loader Global */
.loader-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a2a6c 0%, #2a4ba7 50%, #3a6bd9 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999 !important;
    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;
}

    .loader-container.hidden {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }

.loader-content {
    position: relative;
    z-index: 2;
    text-align: center;
}

/* Logo Animation */
.logo-animation {
    margin-bottom: 2rem;
}

.logo-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto;
    color: rgba(255, 255, 255, 0.9);
}

.logo-svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.3));
}

.logo-path {
    stroke-dasharray: 240;
    stroke-dashoffset: 240;
    animation: drawLogo 2s ease-in-out infinite;
}

.logo-text {
    opacity: 0;
    animation: fadeInText 2s ease-in-out 0.5s infinite;
}

/* Loader con temática educativa mejorado */
.book-loader {
    position: relative;
    width: 140px;
    height: 100px;
    margin: 0 auto 2rem;
    perspective: 1000px;
}

.book {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transform: rotateX(20deg) rotateY(-5deg);
    animation: book-float 4s infinite ease-in-out;
}

.book-cover {
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, #1a2a6c, #2a4ba7);
    border-radius: 8px;
    transform: translateZ(15px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    font-weight: bold;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.cover-content {
    text-align: center;
}

.cover-title {
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 4px;
    font-family: 'cond-heavy', sans-serif;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.cover-subtitle {
    font-size: 0.7rem;
    opacity: 0.8;
    font-weight: 500;
    font-family: 'pluto-sans', sans-serif;
}

.page {
    position: absolute;
    width: 95%;
    height: 90%;
    background: linear-gradient(to right, #f8f9fa 85%, #e9ecef 100%);
    border-radius: 0 6px 6px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1), inset -1px 0 0 rgba(0, 0, 0, 0.05);
    transform-origin: left center;
    top: 5%;
    left: 0;
}

.page-1 {
    animation: page-flip 4s 0.2s infinite ease-in-out;
}

.page-2 {
    animation: page-flip 4s 0.4s infinite ease-in-out;
}

.page-3 {
    animation: page-flip 4s 0.6s infinite ease-in-out;
}

.page-4 {
    animation: page-flip 4s 0.8s infinite ease-in-out;
}

.page-5 {
    animation: page-flip 4s 1.0s infinite ease-in-out;
}

/* Texto y progreso */
.loader-text-container {
    margin-top: 1rem;
}

.loader-text {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.95);
    font-family: 'pluto-sans', sans-serif;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.dots {
    display: inline-block;
    width: 20px;
    text-align: left;
}

    .dots::after {
        content: '';
        animation: dots 1.8s infinite steps(4);
    }

/* Barra de progreso */
.progress-container {
    width: 200px;
    margin: 0 auto;
}

.progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4facfe 0%, #00f2fe 100%);
    border-radius: 2px;
    width: 0%;
    animation: progress-load 2s ease-in-out infinite;
    box-shadow: 0 0 10px rgba(79, 172, 254, 0.5);
}

.progress-text {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.8);
    font-family: 'pluto-sans', sans-serif;
    animation: progress-text 2s ease-in-out infinite;
}

/* Partículas de fondo */
.particles-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.particle {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: float-particle 8s infinite ease-in-out;
}

    .particle:nth-child(1) {
        width: 6px;
        height: 6px;
        top: 20%;
        left: 10%;
        animation-delay: 0s;
    }

    .particle:nth-child(2) {
        width: 4px;
        height: 4px;
        top: 60%;
        left: 80%;
        animation-delay: -1s;
    }

    .particle:nth-child(3) {
        width: 8px;
        height: 8px;
        top: 80%;
        left: 20%;
        animation-delay: -2s;
    }

    .particle:nth-child(4) {
        width: 5px;
        height: 5px;
        top: 30%;
        left: 70%;
        animation-delay: -3s;
    }

    .particle:nth-child(5) {
        width: 7px;
        height: 7px;
        top: 70%;
        left: 30%;
        animation-delay: -4s;
    }

    .particle:nth-child(6) {
        width: 3px;
        height: 3px;
        top: 40%;
        left: 90%;
        animation-delay: -5s;
    }

    .particle:nth-child(7) {
        width: 6px;
        height: 6px;
        top: 90%;
        left: 60%;
        animation-delay: -6s;
    }

    .particle:nth-child(8) {
        width: 4px;
        height: 4px;
        top: 10%;
        left: 40%;
        animation-delay: -7s;
    }

/* Animaciones */
@keyframes drawLogo {
    0%, 100% {
        stroke-dashoffset: 240;
        opacity: 0.7;
    }

    50% {
        stroke-dashoffset: 0;
        opacity: 1;
    }
}

@keyframes fadeInText {
    0%, 100% {
        opacity: 0;
        transform: scale(0.8);
    }

    50% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes book-float {
    0%, 100% {
        transform: rotateX(20deg) rotateY(-5deg) translateY(0) scale(1);
    }

    25% {
        transform: rotateX(25deg) rotateY(-8deg) translateY(-8px) scale(1.02);
    }

    50% {
        transform: rotateX(20deg) rotateY(-5deg) translateY(-4px) scale(1);
    }

    75% {
        transform: rotateX(15deg) rotateY(-2deg) translateY(-6px) scale(0.98);
    }
}

@keyframes page-flip {
    0%, 20% {
        transform: rotateY(0) translateZ(1px);
        opacity: 1;
    }

    40%, 60% {
        transform: rotateY(-180deg) translateZ(1px);
        opacity: 0.8;
    }

    80%, 100% {
        transform: rotateY(-360deg) translateZ(1px);
        opacity: 0;
    }
}

@keyframes dots {
    0% {
        content: '';
    }

    25% {
        content: '.';
    }

    50% {
        content: '..';
    }

    75% {
        content: '...';
    }

    100% {
        content: '';
    }
}

@keyframes progress-load {
    0% {
        width: 0%;
    }

    50% {
        width: 70%;
    }

    100% {
        width: 100%;
    }
}

@keyframes progress-text {
    0% {
        content: "0%";
    }

    25% {
        content: "25%";
    }

    50% {
        content: "50%";
    }

    75% {
        content: "75%";
    }

    100% {
        content: "100%";
    }
}

@keyframes float-particle {
    0%, 100% {
        transform: translateY(0) translateX(0) rotate(0deg);
        opacity: 0;
    }

    25% {
        transform: translateY(-20px) translateX(10px) rotate(90deg);
        opacity: 0.5;
    }

    50% {
        transform: translateY(-40px) translateX(-5px) rotate(180deg);
        opacity: 0.8;
    }

    75% {
        transform: translateY(-20px) translateX(-10px) rotate(270deg);
        opacity: 0.5;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .book-loader {
        width: 120px;
        height: 85px;
    }

    .loader-text {
        font-size: 1rem;
    }

    .logo-icon {
        width: 60px;
        height: 60px;
    }

    .progress-container {
        width: 160px;
    }
}

/*-----------------------------finLoaderglobal---------------------------------*/
