
/* ==================================================
   CALMA QUEST — ESTILOS GENERALES
   ================================================== */

/* RESET */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --morado: #7b2cbf;
    --morado-oscuro: #5a189a;
    --morado-claro: #b57bff;
    --azul: #4361ee;
    --cian: #4cc9f0;
    --blanco: #ffffff;
    --texto-oscuro: #171321;
    --sombra: 0 10px 30px rgba(0, 0, 0, 0.25);
    --radio: 22px;
}

/* ==================================================
   FONDO GENERAL
   ================================================== */

html {
    min-height: 100%;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    min-height: 100vh;
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.5;
    background: linear-gradient(
        135deg,
        var(--morado),
        var(--morado-oscuro),
        var(--azul),
        var(--cian)
    );
    background-size: 400% 400%;
    animation: fondoAnimado 16s ease infinite;
}

@keyframes fondoAnimado {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* ==================================================
   PÁGINA PRINCIPAL
   ================================================== */

body.inicio {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 20px;
}

.contenedor {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 35px;

    text-align: center;

    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 25px;

    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);

    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.22);
}

/* ==================================================
   LOGO
   ================================================== */

.logo {
    display: block;
    width: 180px;
    height: 180px;
    max-width: 100%;

    object-fit: cover;
    border-radius: 50%;
    border: 4px solid var(--blanco);

    margin: 0 auto 20px;

    box-shadow: 0 0 22px rgba(255, 255, 255, 0.5);

    animation: flotar 4s ease-in-out infinite;
}

@keyframes flotar {
    0%, 100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

/* ==================================================
   TÍTULOS
   ================================================== */

h1,
h2,
h3 {
    text-transform: uppercase;
}

.titulo {
    font-size: clamp(30px, 4vw, 48px);
    line-height: 1.2;
    color: var(--texto-oscuro);

    margin-bottom: 24px;

    text-shadow: 2px 3px 6px rgba(255, 255, 255, 0.45);

    animation: moverTitulo 4s ease-in-out infinite;
}

@keyframes moverTitulo {
    0%, 100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }
}

/* ==================================================
   DESCRIPCIÓN PRINCIPAL
   ================================================== */

.texto {
    max-width: 1000px;
    margin: 0 auto 30px;

    color: var(--texto-oscuro);
    font-size: clamp(16px, 2vw, 20px);
    line-height: 1.5;
    text-align: center;
}

.texto h2 {
    margin-bottom: 4px;
    font-size: inherit;
    line-height: 1.4;
    font-weight: 700;
}

/* ==================================================
   BOTONES PRINCIPALES
   ================================================== */

.botones-inicio {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;

    margin: 25px auto 35px;
}

.boton-entrar {
    display: inline-flex;
    justify-content: center;
    align-items: center;

    min-height: 64px;
    padding: 15px 40px;

    border: 2px solid transparent;
    border-radius: 35px;

    background: var(--blanco);
    color: var(--morado);

    font-family: inherit;
    font-size: 20px;
    font-weight: bold;

    cursor: pointer;

    box-shadow: 0 7px 18px rgba(0, 0, 0, 0.2);

    transition:
        transform 0.25s ease,
        background 0.25s ease,
        box-shadow 0.25s ease;
}

.boton-entrar:hover {
    transform: translateY(-3px);
    background: #f1e7ff;
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.25);
}

.boton-entrar:active {
    transform: scale(0.97);
}

.boton-entrar:focus-visible,
.boton-ir-app:focus-visible,
.boton-volver:focus-visible,
.emocion:focus-visible {
    outline: 3px solid var(--cian);
    outline-offset: 5px;
}

/* Botón de abrir la aplicación */

.boton-ir-app {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 12px;

    min-height: 64px;
    padding: 15px 35px;

    border: 2px solid rgba(255, 255, 255, 0.75);
    border-radius: 35px;

    background: linear-gradient(
        135deg,
        #9878ff,
        #c477f7
    );

    color: var(--blanco);
    text-decoration: none;

    font-family: inherit;
    font-size: 20px;
    font-weight: bold;

    box-shadow: 0 7px 18px rgba(0, 0, 0, 0.2);

    transition:
        transform 0.25s ease,
        box-shadow 0.25s ease,
        filter 0.25s ease;
}

.boton-ir-app:hover {
    transform: translateY(-3px);
    filter: brightness(1.08);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.25);
}

.boton-ir-app:active {
    transform: scale(0.97);
}

.icono-app {
    font-size: 23px;
    line-height: 1;
}

/* ==================================================
   GALERÍA DE EMOCIONES
   ================================================== */

#emociones {
    display: none;

    width: 100%;
    margin-top: 20px;

    justify-content: center;
    align-items: stretch;
    flex-wrap: wrap;
    gap: 25px;

    animation: aparecer 0.6s ease both;
}

.emocion {
    position: relative;
    isolation: isolate;

    display: flex;
    justify-content: center;
    align-items: center;

    width: 220px;
    height: 220px;
    flex: 0 1 220px;

    overflow: hidden;
    border-radius: 22px;

    color: var(--blanco);
    text-decoration: none;
    text-align: center;

    font-size: 22px;
    font-weight: 800;
    line-height: 1.25;

    background-color: var(--morado-oscuro);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;

    text-shadow: 2px 3px 8px rgba(0, 0, 0, 0.95);

    box-shadow: 0 9px 22px rgba(0, 0, 0, 0.3);

    transition:
        transform 0.3s ease,
        box-shadow 0.3s ease,
        filter 0.3s ease;
}

/* Capa oscura para facilitar la lectura */

.emocion::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;

    background: linear-gradient(
        180deg,
        rgba(0, 0, 0, 0.12),
        rgba(0, 0, 0, 0.48)
    );

    transition: background 0.3s ease;
}

.emocion:hover {
    transform: translateY(-6px) scale(1.025);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.38);
    filter: saturate(1.08);
}

.emocion:hover::before {
    background: rgba(0, 0, 0, 0.25);
}

.emocion:active {
    transform: scale(0.98);
}

/* ==================================================
   IMÁGENES DE LAS EMOCIONES
   ================================================== */

.ansiedad {
    background-image: url("./imagenes/ansiedad.webp");
}

.culpa {
    background-image: url("./imagenes/culpa.webp");
}

.enojo {
    background-image: url("./imagenes/enojo.webp");
}

.envidia {
    background-image: url("./imagenes/envidia.webp");
}

.estres {
    background-image: url("./imagenes/estres.webp");
}

.frustracion {
    background-image: url("./imagenes/frustracion.webp");
}

.miedo {
    background-image: url("./imagenes/miedo.webp");
}

.tristeza {
    background-image: url("./imagenes/tristeza.webp");
}

.verguenza {
    background-image: url("./imagenes/verguenza.webp");
}

/* ==================================================
   BOTÓN VOLVER AL INICIO
   Compatible con el HTML actualizado
   ================================================== */

.boton-volver {
    display: block;

    width: fit-content;
    max-width: 100%;

    margin: 28px auto 10px;
    padding: 14px 28px;

    border: 2px solid var(--blanco);
    border-radius: 35px;

    background: var(--blanco);
    color: var(--morado);

    font-family: inherit;
    font-size: 17px;
    font-weight: bold;
    line-height: 1.4;

    cursor: pointer;

    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);

    transition:
        transform 0.25s ease,
        background 0.25s ease,
        box-shadow 0.25s ease;
}

.boton-volver:hover {
    background: #eee1ff;
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
}

.boton-volver:active {
    transform: scale(0.97);
}

/* Compatibilidad con páginas que usan el botón antiguo */

.btn-volver {
    position: fixed;
    top: 25px;
    left: 25px;
    z-index: 999;

    display: flex;
    justify-content: center;
    align-items: center;

    width: 60px;
    height: 60px;

    border: 2px solid rgba(255, 255, 255, 0.8);
    border-radius: 50%;

    background: var(--blanco);
    color: var(--morado-oscuro);

    text-decoration: none;
    font-size: 30px;
    font-weight: bold;

    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.3);

    transition: transform 0.25s ease;
}

.btn-volver:hover {
    transform: scale(1.08);
}

/* ==================================================
   FONDOS DE LAS PÁGINAS DE EMOCIONES
   ================================================== */

.ansiedad-fondo {
    background: url("./imagenes/ansiedad.webp") center / cover fixed;
}

.culpa-fondo {
    background: url("./imagenes/culpa.webp") center / cover fixed;
}

.enojo-fondo {
    background: url("./imagenes/enojo.webp") center / cover fixed;
}

.envidia-fondo {
    background: url("./imagenes/envidia.webp") center / cover fixed;
}

.estres-fondo {
    background: url("./imagenes/estres.webp") center / cover fixed;
}

.frustracion-fondo {
    background: url("./imagenes/frustracion.webp") center / cover fixed;
}

.miedo-fondo {
    background: url("./imagenes/miedo.webp") center / cover fixed;
}

.tristeza-fondo {
    background: url("./imagenes/tristeza.webp") center / cover fixed;
}

.verguenza-fondo {
    background: url("./imagenes/verguenza.webp") center / cover fixed;
}

/* ==================================================
   ESTRUCTURA DE LAS PÁGINAS DE EMOCIONES
   ================================================== */

.emocion-page {
    position: relative;

    min-height: 100vh;
    padding: 35px 50px;

    overflow-x: hidden;
    color: var(--blanco);
}

/* Fondo desenfocado */

.emocion-page::before {
    content: "";

    position: fixed;
    inset: 0;
    z-index: -2;

    background: inherit;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;

    transform: scale(1.08);
    filter: blur(5px);
}

/* Capa oscura para mejorar el contraste */

.emocion-page::after {
    content: "";

    position: fixed;
    inset: 0;
    z-index: -1;

    background: rgba(0, 0, 0, 0.48);
    pointer-events: none;
}

/* ==================================================
   TÍTULO DE CADA EMOCIÓN
   ================================================== */

.titulo-emocion {
    width: 100%;
    margin-bottom: 25px;

    color: var(--blanco);
    text-align: center;

    font-size: clamp(34px, 4vw, 54px);
    line-height: 1.2;

    overflow-wrap: break-word;

    text-shadow: 3px 4px 14px rgba(0, 0, 0, 0.8);
}

/* ==================================================
   CONTENIDO DE CADA EMOCIÓN
   ================================================== */

.contenido-emocion {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 40px;

    width: 100%;
    max-width: 1400px;

    margin: 0 auto;
}

/* Imagen */

.imagen-emocion {
    display: flex;
    justify-content: center;
    align-items: center;

    width: 45%;
    min-width: 0;
    padding-top: 20px;
}

.imagen-emocion img {
    display: block;

    width: 90%;
    max-width: 500px;
    height: 360px;

    object-fit: cover;
    object-position: center;

    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 25px;

    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.45);

    transition: transform 0.35s ease;
}

.imagen-emocion img:hover {
    transform: scale(1.025);
}

/* Texto */

.texto-emocion {
    width: 55%;
    min-width: 0;

    overflow-wrap: break-word;
}

.texto-emocion h2 {
    margin: 10px 0;

    color: var(--blanco);
    font-size: clamp(24px, 2.3vw, 32px);
    line-height: 1.3;

    text-shadow: 2px 3px 9px rgba(0, 0, 0, 0.8);
}

.texto-emocion p {
    margin-bottom: 14px;

    color: var(--blanco);
    font-size: clamp(18px, 1.8vw, 25px);
    line-height: 1.6;
}

.texto-emocion ul {
    padding-left: 24px;
}

.texto-emocion li {
    margin-bottom: 10px;

    font-size: 18px;
    line-height: 1.65;
}

/* ==================================================
   PIE DE PÁGINA
   ================================================== */

.footer {
    margin-top: 70px;
    padding-top: 30px;

    border-top: 2px solid rgba(255, 255, 255, 0.3);

    color: var(--blanco);
    text-align: center;
}

.footer h2 {
    margin-bottom: 15px;
    font-size: clamp(22px, 2.5vw, 30px);
    line-height: 1.3;
}

.footer > p {
    margin-bottom: 20px;

    font-size: 16px;
    font-weight: bold;
    line-height: 1.7;

    overflow-wrap: break-word;
}

/* Redes sociales */

.redes-box {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 35px;
}

.redes-box a {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    gap: 7px;

    color: var(--blanco);
    text-decoration: none;

    transition: transform 0.25s ease;
}

.redes-box a:hover {
    transform: translateY(-4px);
}

.red-icon {
    display: block;

    width: 55px;
    height: auto;
    max-height: 60px;

    object-fit: contain;
}

.redes-box a p {
    font-size: 13px;
    font-weight: bold;
}

/* ==================================================
   ANIMACIONES
   ================================================== */

@keyframes aparecer {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==================================================
   TABLET Y PANTALLAS MEDIANAS
   ================================================== */

@media (max-width: 1000px) {
    body.inicio {
        padding: 15px;
    }

    .contenedor {
        padding: 28px;
    }

    #emociones {
        gap: 20px;
    }

    .emocion {
        width: 200px;
        height: 200px;
        flex-basis: 200px;
        font-size: 20px;
    }

    .contenido-emocion {
        gap: 28px;
    }

    .imagen-emocion img {
        width: 100%;
        height: 320px;
    }

    .emocion-page {
        padding: 30px;
    }
}

/* ==================================================
   TABLET VERTICAL
   ================================================== */

@media (max-width: 768px) {
    .contenedor {
        padding: 25px 20px;
        border-radius: 20px;
    }

    .logo {
        width: 145px;
        height: 145px;
    }

    .titulo {
        font-size: clamp(28px, 5vw, 38px);
    }

    .texto {
        font-size: 17px;
        text-align: center;
    }

    .boton-entrar,
    .boton-ir-app {
        min-height: 56px;
        padding: 13px 25px;
        font-size: 17px;
    }

    #emociones {
        gap: 18px;
    }

    .emocion {
        width: 175px;
        height: 175px;
        flex-basis: 175px;
        border-radius: 18px;
        font-size: 18px;
    }

    .footer {
        margin-top: 45px;
        padding-top: 25px;
    }

    .footer > p {
        font-size: 14px;
    }

    /* Páginas individuales */

    .emocion-page {
        padding: 80px 25px 30px;
    }

    .titulo-emocion {
        font-size: 42px;
        margin-bottom: 25px;
    }

    .contenido-emocion {
        flex-direction: column;
        align-items: center;
        gap: 25px;
    }

    .imagen-emocion,
    .texto-emocion {
        width: 100%;
    }

    .imagen-emocion {
        padding-top: 0;
    }

    .imagen-emocion img {
        width: 100%;
        max-width: 500px;
        height: 320px;
    }

    .texto-emocion h2 {
        font-size: 28px;
        text-align: center;
    }

    .texto-emocion p {
        font-size: 19px;
    }

    .texto-emocion li {
        font-size: 17px;
    }
}

/* ==================================================
   CELULARES
   ================================================== */

@media (max-width: 480px) {
    body.inicio {
        padding: 10px;
    }

    .contenedor {
        padding: 24px 14px;
        border-radius: 18px;
    }

    .logo {
        width: 120px;
        height: 120px;
        margin-bottom: 18px;
    }

    .titulo {
        margin-bottom: 18px;
        font-size: 28px;
    }

    .texto {
        margin-bottom: 22px;
        font-size: 15px;
        line-height: 1.5;
    }

    .texto h2 {
        font-size: inherit;
    }

    .botones-inicio {
        flex-direction: column;
        gap: 12px;
        margin: 22px auto 28px;
    }

    .boton-entrar,
    .boton-ir-app {
        width: 100%;
        max-width: 290px;
        min-height: 52px;
        padding: 12px 18px;
        font-size: 16px;
    }

    #emociones {
        gap: 12px;
        margin-top: 15px;
    }

    .emocion {
        width: calc(50% - 6px);
        height: auto;
        min-height: 145px;
        flex: 0 0 calc(50% - 6px);

        border-radius: 15px;
        font-size: 15px;
        padding: 8px;
        overflow-wrap: anywhere;
    }

    .boton-volver {
        width: 100%;
        max-width: 280px;
        margin: 24px auto 8px;
        padding: 13px 16px;
        font-size: 15px;
    }

    .footer {
        margin-top: 35px;
        padding-top: 22px;
    }

    .footer h2 {
        font-size: 21px;
    }

    .footer > p {
        font-size: 13px;
        line-height: 1.8;
    }

    .redes-box {
        gap: 25px;
    }

    .red-icon {
        width: 45px;
    }

    /* Páginas individuales */

    .emocion-page {
        padding: 75px 16px 25px;
    }

    .titulo-emocion {
        font-size: 32px;
    }

    .imagen-emocion img {
        height: 250px;
        border-radius: 18px;
    }

    .texto-emocion h2 {
        font-size: 23px;
    }

    .texto-emocion p {
        font-size: 17px;
        line-height: 1.65;
    }

    .texto-emocion li {
        font-size: 16px;
        line-height: 1.6;
    }

    .btn-volver {
        top: 12px;
        left: 12px;
        width: 48px;
        height: 48px;
        font-size: 24px;
    }
}

/* ==================================================
   ACCESIBILIDAD: REDUCIR MOVIMIENTO
   ================================================== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    body {
        background-size: cover;
    }
}

/* ==================================================
   FIN DE CALMA QUEST
   ================================================== */
