
/* ============================================
   ESTILOS GENERALES EDUCAU
============================================ */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;

    font-family: "Segoe UI", Arial, Helvetica, sans-serif;

    background: #eef2ff;

    color: #172554;

    line-height: 1.5;
}

/* ============================================
   ENCABEZADO INSTITUCIONAL EDUCAU
============================================ */

.header-institucional {
    background: linear-gradient(
        110deg,
        #1e1b4b 0%,
        #312e81 50%,
        #4338ca 100%
    );

    color: #ffffff;

    /* Encabezado más bajo */
    padding: 7px 5%;

    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.18);

    position: relative;

    z-index: 10;
}

.header-contenido {
    max-width: 1400px;

    margin: 0 auto;

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 14px;

    min-height: 43px;
}

/* ============================================
   MARCA EDUCAU
============================================ */

.marca {
    display: flex;

    align-items: center;

    gap: 11px;

    text-decoration: none;

    color: #ffffff;

    min-width: 0;
}

/* Logo institucional pequeño */

.logo-institucional {
    width: 52px;

    height: 43px;

    object-fit: contain;

    background: #ffffff;

    border-radius: 6px;

    padding: 3px;

    flex-shrink: 0;

    display: block;
}

/* Contenedor de textos */

.marca-texto {
    display: flex;

    flex-direction: column;

    justify-content: center;

    gap: 0;

    min-width: 0;
}

/* Nombre del sistema */

.nombre-sistema {
    font-family: "Segoe UI", Arial, Helvetica, sans-serif;

    font-size: 25px;

    font-weight: 700;

    letter-spacing: 0.8px;

    line-height: 1.1;

    color: #ffffff;

    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);

    white-space: nowrap;
}

/* Subtítulo */

.subtitulo-sistema {
    font-family: "Segoe UI", Arial, Helvetica, sans-serif;

    font-size: 12px;

    font-weight: 400;

    letter-spacing: 0.4px;

    line-height: 1.3;

    color: #ffffff;

    opacity: 0.95;

    white-space: nowrap;
}

/* ============================================
   BOTONES DEL ENCABEZADO
============================================ */

.header-acciones {
    display: flex;

    align-items: center;

    gap: 8px;

    flex-wrap: wrap;
}

.btn-header {
    background: #ffffff;

    color: #312e81;

    border: none;

    border-radius: 8px;

    padding: 9px 16px;

    font-weight: 600;

    font-size: 13px;

    cursor: pointer;

    transition: all 0.2s ease;

    width: auto;

    margin: 0;
}

.btn-header:hover {
    background: #e0e7ff;

    color: #1e1b4b;

    transform: translateY(-1px);
}

.btn-header:focus-visible {
    outline: 3px solid #a5b4fc;

    outline-offset: 2px;
}

/* ============================================
   CONTENEDOR PRINCIPAL
============================================ */

main {
    max-width: 1300px;

    margin: 30px auto;

    padding: 0 18px;
}

.panel {
    background: #ffffff;

    border-radius: 18px;

    padding: 25px;

    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.06);
}

/* ============================================
   BOTONES DE NAVEGACIÓN
============================================ */

.barra-navegacion {
    display: flex;

    justify-content: space-between;

    align-items: center;

    gap: 15px;

    margin-bottom: 20px;
}

.btn-regresar,
.btn-imprimir {
    width: auto;

    padding: 12px 18px;

    border-radius: 10px;

    border: none;

    font-weight: bold;

    cursor: pointer;

    transition: all 0.2s ease;
}

.btn-regresar {
    background: #e0e7ff;

    color: #3730a3;
}

.btn-imprimir {
    background: #4338ca;

    color: #ffffff;
}

.btn-regresar:hover {
    background: #c7d2fe;

    transform: translateY(-1px);
}

.btn-imprimir:hover {
    background: #312e81;

    transform: translateY(-1px);
}

.codigo-tema {
    color: #64748b;

    font-size: 14px;
}

/* ============================================
   FORMULARIOS
============================================ */

input,
textarea,
select,
button {
    font: inherit;

    padding: 12px;

    border-radius: 9px;

    border: 1px solid #c7d2fe;

    margin: 6px 0;

    width: 100%;

    box-sizing: border-box;
}

input,
textarea,
select {
    background: #ffffff;

    color: #172554;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;

    border-color: #6366f1;

    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

button {
    background: #4338ca;

    color: #ffffff;

    cursor: pointer;

    font-weight: bold;

    transition: background 0.2s ease;
}

button:hover {
    background: #312e81;
}

button:focus-visible {
    outline: 3px solid #a5b4fc;

    outline-offset: 2px;
}

/* ============================================
   COLUMNAS
============================================ */

.grid {
    display: grid;

    grid-template-columns: 340px 1fr;

    gap: 20px;
}

/* ============================================
   NUBE DE PALABRAS
============================================ */

#nube {
    text-align: center;

    min-height: 500px;

    padding: 30px;

    display: flex;

    flex-wrap: wrap;

    align-items: center;

    justify-content: center;

    gap: 12px;
}

#nube span {
    display: inline-block;

    font-weight: bold;

    margin: 10px;

    color: #4338ca;

    transition: transform 0.2s ease;
}

#nube span:hover {
    transform: scale(1.15) rotate(0deg) !important;
}




/* ============================================
   GLOSARIO ILUSTRADO DIGITAL - EDUCAU
============================================ */

/* Fondo especial del glosario */

body[data-tema-visual] #glosario {

    position: relative;

    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 12px;

    padding: 18px;

    background:

        radial-gradient(
            circle at 8% 10%,
            rgba(255, 255, 255, 0.8),
            transparent 25%
        ),

        radial-gradient(
            circle at 92% 90%,
            rgba(255, 255, 255, 0.7),
            transparent 28%
        ),

        #f8f0df;

    border-radius: 18px;

    border: 1px solid #eadbc4;

    box-shadow:
        0 8px 25px rgba(100, 70, 30, 0.08);

}


/* ============================================
   TARJETAS DEL GLOSARIO
============================================ */

#glosario article {

    position: relative;

    display: flex;

    flex-direction: column;

    align-items: center;

    text-align: center;

    min-width: 0;

    min-height: 245px;

    padding: 15px 12px 18px;

    margin: 0;

    background:

        linear-gradient(
            145deg,
            #d7b6a5,
            #c49a86
        );

    border: 1px solid #b78b76;

    border-radius: 13px;

    box-shadow:

        0 4px 10px rgba(100, 60, 40, 0.12);

    overflow: hidden;

    transition:

        transform 0.25s ease,

        box-shadow 0.25s ease;

}


/* Alternar colores como el afiche */

#glosario article:nth-child(4n + 1) {

    background:

        linear-gradient(
            145deg,
            #d8b8a7,
            #c59b87
        );

}


#glosario article:nth-child(4n + 2) {

    background:

        linear-gradient(
            145deg,
            #d7c0ad,
            #c9aa91
        );

}


#glosario article:nth-child(4n + 3) {

    background:

        linear-gradient(
            145deg,
            #cdb09c,
            #b9937f
        );

}


#glosario article:nth-child(4n + 4) {

    background:

        linear-gradient(
            145deg,
            #dfc6a9,
            #c6a17e
        );

}


/* Efecto al pasar el cursor */

#glosario article:hover {

    transform: translateY(-5px);

    box-shadow:

        0 10px 20px rgba(100, 60, 40, 0.20);

}


/* ============================================
   ÍCONOS CIRCULARES
============================================ */

#glosario article::before {

    content: "📚";

    display: flex;

    align-items: center;

    justify-content: center;

    width: 65px;

    height: 65px;

    margin-bottom: 10px;

    background:

        linear-gradient(
            145deg,
            #f5eee4,
            #d9e4e6
        );

    border: 3px solid #f8f0df;

    border-radius: 50%;

    box-shadow:

        0 3px 8px rgba(70, 50, 30, 0.20);

    font-size: 30px;

    flex-shrink: 0;

}


/* Íconos diferentes por tarjeta */

#glosario article:nth-child(4n + 1)::before {

    content: "📚";

}


#glosario article:nth-child(4n + 2)::before {

    content: "💡";

}


#glosario article:nth-child(4n + 3)::before {

    content: "🤝";

}


#glosario article:nth-child(4n + 4)::before {

    content: "🌟";

}


/* ============================================
   NOMBRE DEL PARTICIPANTE
============================================ */

#glosario article small {

    display: block;

    width: 100%;

    margin-bottom: 7px;

    color: #fffaf5;

    font-size: 11px;

    font-weight: bold;

    text-transform: uppercase;

    letter-spacing: 0.5px;

}


/* ============================================
   CONCEPTO
============================================ */

#glosario article h3 {

    width: 100%;

    margin: 5px 0 12px;

    color: #fffaf5;

    font-family: Georgia, "Times New Roman", serif;

    font-size: 19px;

    font-weight: bold;

    line-height: 1.25;

    overflow-wrap: anywhere;

}


/* ============================================
   DEFINICIÓN
============================================ */

#glosario article p {

    width: 100%;

    margin: 0;

    color: #fffaf5;

    font-family: Arial, Helvetica, sans-serif;

    font-size: 13px;

    line-height: 1.55;

    overflow-wrap: anywhere;

}


/* ============================================
   TÍTULO DEL GLOSARIO
============================================ */

body[data-tema-visual] #vt {

    color: #a66b2b;

    font-family: Georgia, "Times New Roman", serif;

    font-size: 28px;

    font-weight: bold;

    text-align: center;

    letter-spacing: 0.5px;

    margin-bottom: 18px;

}


/* ============================================
   DECORACIÓN SUPERIOR
============================================ */

body[data-tema-visual] #gf {

    position: relative;

}


/* Línea decorativa */

body[data-tema-visual] #gf::before {

    content: "✦  GLOSARIO ILUSTRADO DIGITAL  ✦";

    display: block;

    text-align: center;

    color: #b98545;

    font-family: Georgia, "Times New Roman", serif;

    font-size: 15px;

    letter-spacing: 1.5px;

    margin-bottom: 10px;

}




/* ============================================
   RESPONSIVE - TABLET
============================================ */

@media (max-width: 1100px) {

    body[data-tema-visual] #glosario {

        grid-template-columns:
            repeat(2, minmax(0, 1fr));

    }

}


/* ============================================
   RESPONSIVE - CELULAR
============================================ */

@media (max-width: 600px) {

    body[data-tema-visual] #glosario {

        grid-template-columns: 1fr;

        padding: 12px;

    }

    #glosario article {

        min-height: 220px;

        padding: 18px;

    }

    #glosario article h3 {

        font-size: 20px;

    }

    #glosario article p {

        font-size: 14px;

    }

}



/* ============================================
   RESPONSIVE - TABLETAS Y CELULARES
============================================ */

@media (max-width: 800px) {

    .grid {
        grid-template-columns: 1fr;
    }

    .header-institucional {
        padding: 7px 4%;
    }

    .header-contenido {
        flex-direction: column;

        align-items: center;

        gap: 8px;
    }

    .marca {
        justify-content: center;

        width: 100%;
    }

    .header-acciones {
        width: 100%;

        justify-content: center;
    }

    .btn-header {
        width: 100%;

        max-width: 300px;
    }

    .nombre-sistema {
        font-size: 22px;
    }

    .subtitulo-sistema {
        font-size: 11px;
    }

    .logo-institucional {
        width: 45px;

        height: 38px;

        padding: 2px;
    }

    .barra-navegacion {
        flex-direction: column;

        align-items: stretch;
    }

    .btn-regresar,
    .btn-imprimir {
        width: 100%;
    }

    main {
        margin: 20px auto;

        padding: 0 12px;
    }

    .panel {
        padding: 18px;

        border-radius: 14px;
    }

    #nube {
        min-height: 350px;

        padding: 20px 10px;
    }
}

/* ============================================
   CELULARES PEQUEÑOS
============================================ */

@media (max-width: 420px) {

    .nombre-sistema {
        font-size: 20px;
    }

    .subtitulo-sistema {
        font-size: 10px;

        letter-spacing: 0.2px;
    }

    .logo-institucional {
        width: 42px;

        height: 35px;
    }

    .marca {
        gap: 8px;
    }

    .header-contenido {
        gap: 6px;
    }

    .panel {
        padding: 14px;
    }

    #nube {
        padding: 15px 5px;

        gap: 8px;
    }

    #nube span {
        margin: 6px;
    }
}

/* ============================================
   IMPRESIÓN / PDF
   SOLO NUBE O GLOSARIO
============================================ */

@media print {

body[data-tema-visual] #app > * {

    position: static;

    z-index: auto;

}

    /* ========================================
       CONFIGURACIÓN DE LA PÁGINA
    ======================================== */

    @page {

        size: A4 portrait;

        margin: 12mm;

    }

    html,
    body {

        margin: 0;

        padding: 0;

        background: #ffffff !important;

        color: #172554;

    }

    /* ========================================
       OCULTAR ELEMENTOS QUE NO SE IMPRIMEN
    ======================================== */

    .header-institucional,

    #inicio,

    .barra-navegacion,

    .codigo-tema,

    .grid > aside {

        display: none !important;

    }

    /* ========================================
       CONTENEDOR PRINCIPAL
    ======================================== */

    main {

        max-width: none;

        width: 100%;

        margin: 0;

        padding: 0;

    }

    #app {

        display: block !important;

        width: 100%;

        margin: 0;

        padding: 0;

        background: #ffffff !important;

        box-shadow: none !important;

        border: none !important;

    }

    /* ========================================
       TÍTULO DE LA ACTIVIDAD
    ======================================== */

    #tt {

        display: block !important;

        margin: 0 0 5mm 0;

        padding: 0;

        text-align: center;

        font-size: 24px;

        color: #312e81 !important;

        page-break-after: avoid;

    }

    /* ========================================
       SOLO EL PANEL DE NUBE/GLOSARIO
    ======================================== */

    .grid {

        display: block !important;

        width: 100%;

        margin: 0;

        padding: 0;

    }

    .area-contenido-imprimir {

        display: block !important;

        width: 100%;

        margin: 0;

        padding: 0 !important;

        background: #ffffff !important;

        border: none !important;

        box-shadow: none !important;

        border-radius: 0 !important;

    }

    /* ========================================
       TÍTULO NUBE / GLOSARIO
    ======================================== */

    #vt {

        display: block !important;

        text-align: center;

        margin: 0 0 8mm 0;

        padding: 0;

        color: #a66b2b !important;

        font-size: 20px;

        page-break-after: avoid;

    }

    /* ========================================
       NUBE DE PALABRAS
    ======================================== */

    #nube {

        display: flex !important;

        width: 100%;

        min-height: 400px;

        padding: 25px;

        margin: 0;

        background: #ffffff !important;

        border: 1px solid #dddddd;

        border-radius: 15px;

        box-shadow: none;

        page-break-inside: avoid;

        align-items: center;

        justify-content: center;

    }

    /* ========================================
       OCULTAR NUBE SI ES GLOSARIO
    ======================================== */

    #nube[hidden] {

        display: none !important;

    }

    /* ========================================
       GLOSARIO
    ======================================== */

    #glosario {

        width: 100%;

        margin: 0;

        padding: 0;

        background: #ffffff !important;

        border: none !important;

        box-shadow: none !important;

    }

    #glosario[hidden] {

        display: none !important;

    }

    /* ========================================
       TARJETAS DEL GLOSARIO
    ======================================== */

    #glosario article {

        break-inside: avoid;

        page-break-inside: avoid;

        box-shadow: none !important;

    }

    /* ========================================
       NOMBRES DE PARTICIPANTES
    ======================================== */

    .nombres-imprimir {

        display: block !important;

        width: 100%;

        margin-top: 12mm;

        padding-top: 6mm;

        border-top: 2px solid #d6b98c;

        page-break-inside: avoid;

    }

    .titulo-nombres {

        text-align: center;

        color: #8a5a25;

        font-family: Georgia, "Times New Roman", serif;

        font-size: 17px;

        font-weight: bold;

        margin-bottom: 5mm;

    }

    .lista-nombres {

        display: flex;

        flex-wrap: wrap;

        justify-content: center;

        gap: 6px;

    }

    .nombre-participante {

        display: inline-block;

        padding: 5px 12px;

        border: 1px solid #d6b98c;

        border-radius: 15px;

        background: #faf3e7;

        color: #5f4630;

        font-size: 11px;

    }

    /* ========================================
       OCULTAR ADORNOS DURANTE IMPRESIÓN
       PARA UN PDF MÁS LIMPIO
    ======================================== */

    #app::before,

    #app::after,

    #nube::before,

    #nube::after {

        display: none !important;

        content: none !important;

    }

}

/* ============================================
   NOMBRES DE PARTICIPANTES - SOLO IMPRESIÓN
============================================ */

.nombres-imprimir {

    display: none;

}



/* ============================================
   SELECTOR DE APLICACIONES EDUCAU
============================================ */

#selectorTemas {
    width: 100%;

    padding: 13px 15px;

    border: 1px solid #c7d2fe;

    border-radius: 10px;

    background: #ffffff;

    color: #172554;

    font-size: 15px;

    font-family: "Segoe UI", Arial, sans-serif;

    cursor: pointer;

    transition: all 0.2s ease;
}

#selectorTemas:focus {
    outline: none;

    border-color: #6366f1;

    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

#selectorTemas:hover {
    border-color: #818cf8;
}

#selectorTemas option {
    padding: 10px;

    background: #ffffff;

    color: #172554;
}


/* ============================================
   FONDOS PASTEL ALEATORIOS EDUCAU
============================================ */

/* Fondo general de la aplicación */

body[data-tema-visual="1"] {
    --fondo-app: #fff1d6;
    --color-adornos: #f4a261;
    --color-secundario: #f6bd60;
}

body[data-tema-visual="2"] {
    --fondo-app: #fce7f3;
    --color-adornos: #ec4899;
    --color-secundario: #c084fc;
}

body[data-tema-visual="3"] {
    --fondo-app: #dff7f0;
    --color-adornos: #2a9d8f;
    --color-secundario: #7dd3fc;
}

body[data-tema-visual="4"] {
    --fondo-app: #e8e7ff;
    --color-adornos: #818cf8;
    --color-secundario: #c4b5fd;
}

body[data-tema-visual="5"] {
    --fondo-app: #fff0f0;
    --color-adornos: #fb7185;
    --color-secundario: #fda4af;
}

body[data-tema-visual="6"] {
    --fondo-app: #e0f2fe;
    --color-adornos: #38bdf8;
    --color-secundario: #93c5fd;
}


/* ============================================
   FONDO DE LA APLICACIÓN
============================================ */

body[data-tema-visual] {

    background-color: var(--fondo-app);

    background-image:

        radial-gradient(
            circle at 10% 20%,
            rgba(255, 255, 255, 0.75) 0,
            transparent 24%
        ),

        radial-gradient(
            circle at 90% 10%,
            rgba(255, 255, 255, 0.6) 0,
            transparent 25%
        ),

        radial-gradient(
            circle at 80% 85%,
            rgba(255, 255, 255, 0.65) 0,
            transparent 28%
        );

    background-attachment: fixed;

    transition:
        background-color 0.5s ease;

}


/* ============================================
   PANEL PRINCIPAL MÁS ATRACTIVO
============================================ */

body[data-tema-visual] #app {

    position: relative;

    isolation: isolate;

}


/* Paneles con efecto suave */

body[data-tema-visual] #app .panel {

    background: rgba(255, 255, 255, 0.90);

    backdrop-filter: blur(5px);

    border: 1px solid rgba(255, 255, 255, 0.85);

    box-shadow:
        0 8px 25px rgba(80, 60, 100, 0.08);

}


/* ============================================
   NUBE DE PALABRAS
============================================ */

body[data-tema-visual] #nube {

    position: relative;

    overflow: hidden;

    border-radius: 18px;

    background:

        radial-gradient(
            circle at 20% 20%,
            rgba(255, 255, 255, 0.95),
            transparent 28%
        ),

        radial-gradient(
            circle at 80% 70%,
            rgba(255, 255, 255, 0.8),
            transparent 30%
        ),

        rgba(255, 255, 255, 0.45);

    border: 2px solid rgba(255, 255, 255, 0.8);

}


/* Palabras con colores pastel */

body[data-tema-visual] #nube span {

    position: relative;

    z-index: 2;

    color: var(--color-adornos);

    text-shadow:
        1px 1px 0 rgba(255, 255, 255, 0.8);

    transition:
        transform 0.25s ease,
        filter 0.25s ease;

}


/* Animación suave al pasar el cursor */

body[data-tema-visual] #nube span:hover {

    transform: scale(1.15) rotate(0deg) !important;

    filter: brightness(1.05);

}




/* ============================================
   TÍTULO DE LA APLICACIÓN
============================================ */

body[data-tema-visual] #tt {

    color: #312e81;

    font-weight: 800;

    letter-spacing: 0.3px;

}





/* ============================================
   ADORNOS DECORATIVOS DE EDUCAU
   Funcionan tanto en NUBE como en GLOSARIO
============================================ */

body[data-tema-visual] #app {

    position: relative;

    overflow: hidden;

}

/* Adornos superiores */

body[data-tema-visual] #app::before {

    content: "☁️     🌈     😊     ⭐";

    position: absolute;

    top: 8px;

    left: 50%;

    transform: translateX(-50%);

    width: 100%;

    text-align: center;

    font-size: 25px;

    letter-spacing: 18px;

    opacity: 0.70;

    pointer-events: none;

    z-index: 0;

}

/* Adornos inferiores */

body[data-tema-visual] #app::after {

    content: "💡     📚     🤝     💙";

    position: absolute;

    bottom: 8px;

    right: 25px;

    font-size: 23px;

    letter-spacing: 10px;

    opacity: 0.70;

    pointer-events: none;

    z-index: 0;

}

body[data-tema-visual] #app > * {

    position: relative;

    z-index: 1;

}

/* ============================================
   OCULTAR COMPLETAMENTE ELEMENTOS CON HIDDEN
============================================ */

#nube[hidden],
#glosario[hidden],
#nf[hidden],
#gf[hidden] {
    display: none !important;
}