/* Estilos de la pantalla de bienvenida (splash) — compartidos entre login y panel */
.welcome-screen {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center,
        #ffffff 0%,
        #F6FAF9 35%,
        #E4EEFA 55%,
        #DDF2ED 75%,
        #3570BE 100%
    );
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.8s ease, visibility 0.8s ease;
    overflow: hidden;
}

/* Overlay mágico para efecto de cuento */
.welcome-screen::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.3) 0%, transparent 40%),
        radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(255, 255, 255, 0.25) 0%, transparent 45%),
        radial-gradient(circle at 90% 90%, rgba(255, 255, 255, 0.15) 0%, transparent 35%);
    pointer-events: none;
    z-index: 1;
}

/* Partículas brillantes flotantes */
.welcome-screen::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(circle at 15% 25%, rgba(255, 255, 255, 0.8) 1px, transparent 1px),
        radial-gradient(circle at 85% 35%, rgba(255, 255, 255, 0.6) 1px, transparent 1px),
        radial-gradient(circle at 25% 75%, rgba(255, 255, 255, 0.7) 1px, transparent 1px),
        radial-gradient(circle at 75% 15%, rgba(255, 255, 255, 0.5) 1px, transparent 1px),
        radial-gradient(circle at 45% 45%, rgba(255, 255, 255, 0.4) 1px, transparent 1px),
        radial-gradient(circle at 65% 85%, rgba(255, 255, 255, 0.6) 1px, transparent 1px);
    background-size: 150px 150px, 200px 200px, 180px 180px, 220px 220px, 160px 160px, 190px 190px;
    animation: sparkle 8s linear infinite;
    pointer-events: none;
    z-index: 2;
}

.welcome-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
}

/* Elementos flotantes decorativos */
.floating-elements {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.floating-squircle {
    position: absolute !important;
    width: 64px !important;
    height: 64px !important;
    border-radius: 18px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    opacity: 0.85 !important;
    animation: floatAnimation 6s ease-in-out infinite !important;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15) !important;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
    z-index: 10 !important;
}

.floating-squircle:hover {
    transform: scale(1.15) rotate(5deg) !important;
    opacity: 1 !important;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25) !important;
}

.floating-squircle svg {
    width: 32px !important;
    height: 32px !important;
    transition: transform 0.3s ease !important;
}

.book-1 {
    top: 15% !important;
    left: 10% !important;
    animation-delay: 0s !important;
    animation-duration: 8s !important;
}

.book-2 {
    top: 25% !important;
    right: 15% !important;
    animation-delay: 1.5s !important;
    animation-duration: 7s !important;
}

.book-3 {
    bottom: 30% !important;
    left: 8% !important;
    animation-delay: 3s !important;
    animation-duration: 9s !important;
}

.book-4 {
    top: 60% !important;
    right: 12% !important;
    animation-delay: 2s !important;
    animation-duration: 6s !important;
}

.book-5 {
    bottom: 15% !important;
    left: 50% !important;
    animation-delay: 4s !important;
    animation-duration: 8s !important;
}

.book-6 {
    top: 10% !important;
    left: 60% !important;
    animation-delay: 0.5s !important;
    animation-duration: 7s !important;
}

/* Contenido principal de bienvenida */
.welcome-main-content {
    text-align: center;
    position: relative;
    z-index: 10;
    max-width: 600px;
    padding: 0 30px;
}

.welcome-logo-container {
    margin-bottom: 3rem;
    opacity: 0;
    animation: logoSlideIn 1.2s ease 0.3s forwards;
}

.welcome-logo-svg {
    width: 480px;
    max-width: 90vw;
    height: auto;
    filter: drop-shadow(0 10px 25px rgba(0, 0, 0, 0.2));
    transition: transform 0.3s ease;
    display: block;
    margin: 0 auto;
}

.welcome-logo-svg:hover {
    transform: scale(1.05);
}

.welcome-message {
    margin-bottom: 2rem;
}

.welcome-title {
    font-family: 'Circular XX', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    white-space: nowrap;
    color: #16344E;
    margin: 0 0 1rem 0;
    text-shadow: 1px 2px 4px rgba(255, 255, 255, 0.8),
                 0 1px 2px rgba(53, 112, 190, 0.3),
                 0 0 8px rgba(255, 255, 255, 0.5);
    opacity: 0;
    animation: titleSlideIn 1s ease 0.8s forwards;
    letter-spacing: -1px;
}

.welcome-subtitle {
    font-family: 'Circular XX', sans-serif;
    font-size: 1.4rem;
    font-weight: 400;
    color: #587081;
    margin: 0;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.6),
                 0 0 4px rgba(53, 112, 190, 0.2);
    opacity: 0;
    animation: subtitleSlideIn 1s ease 1.2s forwards;
    letter-spacing: 0.5px;
}

/* Ondas decorativas de fondo */
.background-waves {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 200px;
    pointer-events: none;
    overflow: hidden;
}

.wave {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 200%;
    height: 100px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50% 50% 0 0;
    animation: waveAnimation 8s ease-in-out infinite;
}

.wave-1 {
    animation-delay: 0s;
    opacity: 0.7;
}

.wave-2 {
    animation-delay: 2s;
    opacity: 0.5;
    height: 80px;
}

.wave-3 {
    animation-delay: 4s;
    opacity: 0.3;
    height: 60px;
}

/* Animaciones de bienvenida */
@keyframes floatAnimation {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
        opacity: 0.7;
    }
    50% {
        transform: translateY(-20px) rotate(5deg);
        opacity: 1;
    }
}

@keyframes logoSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes titleSlideIn {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes subtitleSlideIn {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes waveAnimation {
    0%, 100% {
        transform: translateX(-50%) scaleY(1);
    }
    50% {
        transform: translateX(-50%) scaleY(1.2);
    }
}

@keyframes sparkle {
    0% {
        opacity: 1;
        transform: rotate(0deg) scale(1);
    }
    50% {
        opacity: 0.7;
        transform: rotate(180deg) scale(1.1);
    }
    100% {
        opacity: 1;
        transform: rotate(360deg) scale(1);
    }
}

/* Ocultar pantalla de bienvenida */
.welcome-screen.fade-out {
    opacity: 0;
    visibility: hidden;
}

/* Responsive para pantalla de bienvenida */
@media (max-width: 1024px) {
    .welcome-title {
        font-size: 2.5rem;
    }

    .welcome-subtitle {
        font-size: 1.2rem;
    }

    .welcome-logo-svg {
        width: 380px;
    }

    .floating-squircle {
        width: 54px;
        height: 54px;
        border-radius: 14px;
    }
    .floating-squircle svg {
        width: 26px;
        height: 26px;
    }
}

@media (max-width: 768px) {
    .welcome-title {
        font-size: 2rem;
    }

    .welcome-subtitle {
        font-size: 1.1rem;
    }

    .welcome-logo-svg {
        width: 340px;
        max-width: 90vw;
    }

    .welcome-main-content {
        padding: 0 20px;
    }

    .floating-squircle {
        width: 44px;
        height: 44px;
        border-radius: 12px;
    }
    .floating-squircle svg {
        width: 22px;
        height: 22px;
    }

    .book-1, .book-3, .book-5 {
        left: 5%;
    }

    .book-2, .book-4 {
        right: 5%;
    }
}

@media (max-width: 576px) {
    .welcome-title {
        font-size: 1.5rem;
    }

    .welcome-subtitle {
        font-size: 1rem;
    }

    .welcome-logo-svg {
        width: 280px;
        max-width: 90vw;
    }

    .floating-squircle {
        width: 38px;
        height: 38px;
        border-radius: 10px;
        opacity: 0.6;
    }
    .floating-squircle svg {
        width: 18px;
        height: 18px;
    }

    .welcome-logo-container {
        margin-bottom: 2rem;
    }

    .welcome-message {
        margin-bottom: 2rem;
    }
}

@media (max-width: 480px) {
    .floating-squircle {
        display: none !important;
    }
}
