﻿/* =====================================================
   INTRODUCCIÓN DEL DOCUMENTO
   ===================================================== */

.intro-documento {
    --intro-color-1: #091b2b;
    --intro-color-2: #102f45;
    --intro-color-3: #1b1740;
    --intro-resplandor-1: rgba(94, 190, 220, 0.20);
    --intro-resplandor-2: rgba(111, 29, 155, 0.25);
    position: relative;
    isolation: isolate;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 7rem 1.5rem 4rem;
    overflow: hidden;
    color: #ffffff;
    background: radial-gradient( circle at 15% 20%, var(--intro-resplandor-1), transparent 30% ), radial-gradient( circle at 85% 80%, var(--intro-resplandor-2), transparent 35% ), linear-gradient( 135deg, var(--intro-color-1) 0%, var(--intro-color-2) 48%, var(--intro-color-3) 100% );
}


/* =====================================================
   TEMAS
   ===================================================== */

.intro-documento--azul {
    --intro-color-1: #091b2b;
    --intro-color-2: #102f45;
    --intro-color-3: #1b1740;
    --intro-resplandor-1: rgba(94, 190, 220, 0.20);
    --intro-resplandor-2: rgba(111, 29, 155, 0.25);
}

.intro-documento--morado {
    --intro-color-1: #180b2c;
    --intro-color-2: #4c1a64;
    --intro-color-3: #241146;
    --intro-resplandor-1: rgba(224, 0, 122, 0.18);
    --intro-resplandor-2: rgba(115, 189, 209, 0.20);
}

.intro-documento--institucional {
    --intro-color-1: #123f50;
    --intro-color-2: #176579;
    --intro-color-3: #242153;
    --intro-resplandor-1: rgba(115, 189, 209, 0.20);
    --intro-resplandor-2: rgba(139, 124, 207, 0.22);
}


/* =====================================================
   CONTENIDO CENTRAL
   ===================================================== */

.intro-documento-contenido {
    position: relative;
    z-index: 2;
    width: min(100%, 1050px);
    text-align: center;
}

.intro-documento-etiqueta {
    display: block;
    margin-bottom: 1.1rem;
    color: rgba(255, 255, 255, 0.72);
    font-size: clamp(0.75rem, 1.2vw, 0.95rem);
    font-weight: 600;
    letter-spacing: 0.28em;
    opacity: 0;
    transform: translateY(20px);
    animation: introAparecer 700ms ease forwards 200ms;
}


/* =====================================================
   LÍNEA DECORATIVA
   ===================================================== */

.intro-documento-linea {
    width: 0;
    height: 2px;
    margin: 0 auto 1.8rem;
    background: linear-gradient( 90deg, transparent, rgba(255, 255, 255, 0.9), transparent );
    animation: introLinea 900ms cubic-bezier(0.22, 1, 0.36, 1) forwards 450ms;
}


/* =====================================================
   TÍTULO
   ===================================================== */

.intro-documento-titulo {
    margin: 0;
    overflow: hidden;
    padding-block: 0.08em;
    font-size: clamp(2.6rem, 7vw, 6.5rem);
    font-weight: 300;
    line-height: 1.15;
    letter-spacing: -0.045em;
    text-wrap: balance;
}

    .intro-documento-titulo span {
        display: block;
        opacity: 0;
        transform: translateY(110%);
        animation: introTitulo 1100ms cubic-bezier(0.22, 1, 0.36, 1) forwards 550ms;
    }


/* =====================================================
   DESCRIPCIÓN
   ===================================================== */

.intro-documento-descripcion {
    width: min(100%, 650px);
    margin: 2rem auto 0;
    color: rgba(255, 255, 255, 0.72);
    font-size: clamp(1rem, 2vw, 1.25rem);
    font-weight: 300;
    line-height: 1.7;
    opacity: 0;
    transform: translateY(25px);
    animation: introAparecer 800ms ease forwards 1.1s;
}


/* =====================================================
   BOTÓN
   ===================================================== */

.intro-documento-boton {
    display: inline-flex;
    align-items: center;
    gap: 0.85rem;
    margin-top: 2.3rem;
    padding: 0.85rem 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.42);
    border-radius: 999px;
    background-color: rgba(255, 255, 255, 0.07);
    color: #ffffff;
    font-size: 0.9rem;
    letter-spacing: 0.06em;
    text-decoration: none;
    opacity: 0;
    transform: translateY(25px);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: color 250ms ease, background-color 250ms ease, border-color 250ms ease, transform 250ms ease;
    animation: introAparecer 800ms ease forwards 1.35s;
}

    .intro-documento-boton:hover {
        color: #183243;
        background-color: #ffffff;
        border-color: #ffffff;
        transform: translateY(-3px);
    }

.intro-documento-flecha {
    display: inline-block;
    font-size: 1.2rem;
    animation: flechaDocumento 1.6s ease-in-out infinite;
}


/* =====================================================
   FIGURAS DECORATIVAS
   ===================================================== */

.intro-forma {
    position: absolute;
    z-index: 1;
    display: block;
    border: 1px solid rgba(255, 255, 255, 0.12);
    pointer-events: none;
}

.intro-forma-1 {
    top: 17%;
    left: 7%;
    width: clamp(110px, 16vw, 240px);
    aspect-ratio: 1;
    border-radius: 32% 68% 55% 45% / 45% 35% 65% 55%;
    background-color: rgba(72, 177, 210, 0.08);
    animation: formaFlotante 8s ease-in-out infinite;
}

.intro-forma-2 {
    right: 6%;
    bottom: 12%;
    width: clamp(150px, 22vw, 330px);
    aspect-ratio: 1;
    border-radius: 50%;
    background-color: rgba(166, 61, 190, 0.08);
    animation: formaFlotante 10s ease-in-out infinite reverse;
}

.intro-forma-3 {
    top: 12%;
    right: 18%;
    width: 45px;
    height: 45px;
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.06);
    transform: rotate(35deg);
    animation: formaPequena 7s ease-in-out infinite;
}


/* =====================================================
   VISOR DEL PDF
   ===================================================== */

.documento-pdf {
    position: relative;
    isolation: isolate;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    scroll-margin-top: 80px;
    background-color: #e9ecef;
}

    .documento-pdf iframe {
        position: absolute;
        inset: 0;
        z-index: 1;
        display: block;
        width: 100%;
        height: 100%;
        border: 0;
    }
/* =====================================================
   BOTÓN SUBIR DEL PDF
   ===================================================== */

.documento-pdf-boton-subir {
    position: absolute;
    right: clamp(1rem, 3vw, 2.5rem);
    bottom: clamp(1rem, 5vw, 5.5rem);
    z-index: 10;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.85rem 1.4rem;
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 999px;
    color: #ffffff;
    background-color: rgba(9, 27, 43, 0.78);
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-decoration: none;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.30);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: color 250ms ease, background-color 250ms ease, border-color 250ms ease, transform 250ms ease, box-shadow 250ms ease;
}

    .documento-pdf-boton-subir:hover {
        color: #183243;
        background-color: #ffffff;
        border-color: #ffffff;
        transform: translateY(-3px);
        box-shadow: 0 12px 30px rgba(0, 0, 0, 0.36);
    }

    .documento-pdf-boton-subir:focus-visible {
        outline: 3px solid #ffffff;
        outline-offset: 4px;
    }

.documento-pdf-flecha {
    display: inline-block;
    font-size: 1.2rem;
    line-height: 1;
    animation: flechaDocumentoSubir 1.6s ease-in-out infinite;
}

/* =====================================================
   ANIMACIONES
   ===================================================== */

@keyframes introAparecer {
    from {
        opacity: 0;
        transform: translateY(25px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes introTitulo {
    from {
        opacity: 0;
        transform: translateY(110%);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes introLinea {
    from {
        width: 0;
        opacity: 0;
    }

    to {
        width: min(260px, 55%);
        opacity: 1;
    }
}

@keyframes flechaDocumento {
    0%, 100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(5px);
    }
}

@keyframes formaFlotante {
    0%, 100% {
        transform: translate3d(0, 0, 0) rotate(0deg);
    }

    50% {
        transform: translate3d(0, -25px, 0) rotate(7deg);
    }
}

@keyframes formaPequena {
    0%, 100% {
        transform: translateY(0) rotate(35deg);
    }

    50% {
        transform: translateY(20px) rotate(60deg);
    }
}


/* =====================================================
   DISPOSITIVOS PEQUEÑOS
   ===================================================== */

@media (max-width: 575.98px) {
    .intro-documento {
        padding-inline: 1rem;
    }

    .intro-documento-titulo {
        line-height: 1.08;
    }

    .intro-documento-etiqueta {
        letter-spacing: 0.18em;
    }

    .intro-forma-1 {
        top: 12%;
        left: -50px;
    }

    .intro-forma-2 {
        right: -90px;
        bottom: 9%;
    }
}


/* =====================================================
   ACCESIBILIDAD
   ===================================================== */

@media (prefers-reduced-motion: reduce) {
    .intro-documento-etiqueta,
    .intro-documento-linea,
    .intro-documento-titulo span,
    .intro-documento-descripcion,
    .intro-documento-boton,
    .intro-documento-flecha,
    .intro-forma {
        animation: none;
    }

    .intro-documento-etiqueta,
    .intro-documento-titulo span,
    .intro-documento-descripcion,
    .intro-documento-boton {
        opacity: 1;
        transform: none;
    }

    .intro-documento-linea {
        width: min(260px, 55%);
    }
}


/*=======================================================
    DOCUMENTO GENERICO CON EJERCICIOS(2022,2023,ETC)

===================================================*/


/* =====================================================
       ACCIONES SOBRE PDF
       ===================================================== */

.documento-pdf-acciones {
    position: absolute;
    right: clamp(1rem, 3vw, 6.5rem);
    bottom: clamp(6rem, 3vw, 2.5rem);
    z-index: 10;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.8rem;
}

    .documento-pdf-acciones .documento-pdf-boton-subir {
        position: static;
    }

.documento-pdf-boton-regresar {
    background-color: rgba(9, 27, 43, 0.88);
}

/* =====================================================
       SELECTOR DE EJERCICIOS
       ===================================================== */

.intro-documento--selector {
    padding-top: 6rem;
    padding-bottom: 3rem;
}

    .intro-documento--selector .intro-documento-contenido {
        min-height: calc(100dvh - 9rem);
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }

.intro-documento-titulo--selector {
    font-size: clamp(2.2rem, 2vw, 4.7rem);
    line-height: 1.05;
    max-width: 980px;
}

.selector-ejercicios {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
    width: min(100%, 620px);
    margin: 2.5rem auto 0;
    max-height: 42vh;
    overflow-y: auto;
    padding: 0.25rem 0.5rem;
    opacity: 0;
    transform: translateY(25px);
    animation: introAparecer 800ms ease forwards 1.35s;
}

.selector-ejercicio-boton {
    width: 100%;
    margin-top: 0;
    justify-content: space-between;
    padding: 1rem 1.4rem;
    font-size: 1rem;
}

.selector-ejercicios::-webkit-scrollbar {
    width: 8px;
}

.selector-ejercicios::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background-color: rgba(255, 255, 255, 0.28);
}

.selector-ejercicios::-webkit-scrollbar-track {
    background-color: transparent;
}

@media (max-width: 575.98px) {
    .intro-documento--selector {
        padding-top: 5.5rem;
        padding-bottom: 2rem;
    }

    .intro-documento-titulo--selector {
        font-size: clamp(2rem, 11vw, 3rem);
    }

    .selector-ejercicios {
        width: 100%;
        max-height: 48vh;
        gap: 0.8rem;
    }

    .selector-ejercicio-boton {
        padding: 0.9rem 1.2rem;
    }
}

.intro-documento-acciones {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin-top: 2.3rem;
}

    .intro-documento-acciones .intro-documento-boton {
        margin-top: 0;
    }

.intro-documento-boton-secundario {
    background-color: rgba(255, 255, 255, 0.03);
}


/* =====================================================
     ACCIONES INTRO DOCUMENTO
     ===================================================== */

.intro-documento-acciones {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    width: min(100%, 980px);
    margin: 2.3rem auto 0;
}

.intro-documento-acciones-secundarias {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.85rem;
}

.intro-documento-acciones-principal {
    display: flex;
    justify-content: center;
    margin-left: 0;
}

.intro-documento-acciones .intro-documento-boton {
    margin-top: 0;
}

.intro-documento-boton-secundario {
    background-color: rgba(255, 255, 255, 0.03);
}

.intro-documento-boton-principal {
    background-color: rgba(255, 255, 255, 0.12);
}

.intro-documento-boton-deshabilitado {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

@media (max-width: 767.98px) {
    .intro-documento-acciones {
        flex-direction: column;
        align-items: stretch;
    }

    .intro-documento-acciones-secundarias,
    .intro-documento-acciones-principal {
        justify-content: center;
        margin-left: 0;
    }

    .intro-documento-acciones .intro-documento-boton {
        width: 100%;
        justify-content: center;
    }
}
