/* Aseguramos que el body pueda hacer scroll */
body {
    margin: 0;
    padding: 0;
    overflow-y: auto; /* Permite desplazamiento vertical */
    height: 100vh; /* Altura completa de la ventana */
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.section{
    overflow:hidden;
}

/* Contenedor principal */
.input-container {
    position: relative;
    display: flex;
    align-items: flex-start; /* Evita que la imagen se alinee al centro */
    width: 100%;
    max-width: auto;
    margin-left: 10px;
    flex: 3;  
}


/* Contenedor principal */
.page-container {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    width: 100vw; 
    justify-content: flex-start; /* Alinea los elementos al principio del contenedor */
}

/* Formulario */
.contenedor-historia {
    padding: 5px;
    text-align: center;
    border: none;
    outline: none;
    flex: 7; /*  contenedor historia ocupe el 70% restante */

}

/* En caso de que el .input-container o .contenedor-historia se desborden */
.page-container > .input-container, .page-container > .contenedor-historia {
    overflow: hidden;
}

/* Estilos adicionales */
.hidden {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.8s ease-in-out, visibility 0.8s ease-in-out;
}

.input-group {
    display: flex;
    align-items: center;
    gap:10px;
    margin-left:10px;
}

.icon-img {
    height: 280px;
    width: auto;
    border-radius: 30px;
}

.stacked-card:focus + .icon-img,
.stacked-card:hover + .icon-img {
    opacity: 1;
    visibility: visible;
}


/* Wrapper del textarea */
.textarea-wrapper {
    position: relative;
    width: 100%;
    max-width:480px;
}

    /* Estilos del textarea */
    .textarea-wrapper textarea {
        background-color: #061125;
        color: #ffffff;
        border: 1px solid #08224B;
        width: 100%;
        padding: 15px;
        padding-right: 50px; /* Espacio para el micrófono */
        font-size: 16px;
        border-radius: 20px;
        outline: none;
        transition: all 0.3s ease-in-out;
        box-sizing: border-box;
        overflow-y: auto;
        height: 280px;
        resize: none;
        margin-top: 10px;
        font-family: 'Poppins', sans-serif;
        box-shadow: 2px 2px 25px rgba(8, 34, 75, 0.4);
    }

        /* Placeholder */
        .textarea-wrapper textarea::placeholder {
            color: #9AA0C6;
        }

        /* Focus en textarea */
        .textarea-wrapper textarea:focus,
        .textarea-wrapper textarea:hover {
            border-color: #9AA0C6;
            box-shadow: 0px 0px 8px rgba(106, 90, 205, 0.6);
        }

    /* Botón del micrófono */
    .textarea-wrapper .mic-btn {
        position: absolute;
        right: 15px;
        bottom: 15px;
        background: none;
        border: none;
        cursor: pointer;
        font-size: 20px;
        color: #6A5ACD;
        transition: 0.3s;
    }

        /* Efecto hover */
        .textarea-wrapper .mic-btn:hover {
            color: #B0AEE0;
        }



/* Fondo dinámico */
.gradient-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
}



/* Contenedor de tarjetas */
.scroll-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
    width: 100%;
    max-width: 700px;
    height: 100vh;
    overflow-y: auto;
    scroll-snap-type: y mandatory;
    padding: 30px 0;
    box-sizing: border-box;
    /* Oculta la barra de scroll */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* Internet Explorer 10+ */
}

    .scroll-container::-webkit-scrollbar {
        display: none; /* Chrome, Safari y Opera */
    }


.stacked-card {
    scroll-snap-align: start;
    background-color: #061125;
    color: #9AA0C6;
    border: 1px solid #08224B;
    width: 100%;
    max-width: 440px;
    padding: 20px;
    font-size: 16px;
    border-radius: 20px;
    transition: all 0.3s ease-in-out;
    box-shadow: 0px 0px 20px rgba(8, 34, 75, 0.6);
    height: 280px;
    scroll-snap-align: center;
    transform: scale(0.98);
    opacity: 0.9;
    filter: blur(1px);
    transition: transform 0.3s ease-in-out, filter 0.3s ease-in-out, opacity 0.3s ease-in-out;
}

.stacked-card-cuento {
    background-color: #14203B;
    border-radius: 25px 25px 70px 70px;
    box-shadow: 2px 12px 25px rgba(162, 82, 129, 0.8);
    scroll-snap-align: center;
    font-family: Geist, sans-serif;
    color: white;
    border: 1px solid #08224B;
    width: 100%;
    max-width: 700px;
    padding: 20px;
    font-size: 16px;
    border-radius: 20px;
    height: 600px;
    transform: scale(0.98);
    opacity: 1; /* Asegura buena visibilidad */
    filter: none; /* Elimina el desenfoque */
    transition: transform 0.3s ease-in-out, filter 0.3s ease-in-out, opacity 0.3s ease-in-out;
}

/* Ajuste de escala al pasar el mouse */
.scroll-container:has(.stacked-card:hover) .stacked-card:not(:hover) {
    transform: scale(0.98);
    opacity: 0.9;
    filter: blur(1px);
}

.stacked-card:hover {
    transform: scale(1);
    opacity: 1;
    filter: blur(0px);
}

/* Botón principal */
button {
    background-color: #061125;
    color: white;
    font-size: 20px;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    transition: background 0.8s ease-in-out;
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 480px;
    max-width: 100%;
}

    button:hover {
        background-color: #2627ff;
    }

/* Media Queries para Responsividad */
@media (max-width: 1024px) {
    .page-container {
        padding: 15px;
        height: auto;
    }

    .contenedor-historia {
        width: 95%;
    }

    .textarea-wrapper textarea {
        width: 100%;
        height: 250px;
    }


}

@media (max-width: 768px) {
    .page-container {
        height: auto;
        padding: 10px;
    }

    .contenedor-historia {
        width: 100%;
    }

    .textarea-wrapper textarea {
        height: 220px;
        font-size: 14px;
    }

    .scroll-container {
        width: 100%;
        padding: 0 10px;
    }


}

@media (max-width: 480px) {
    .textarea-wrapper textarea {
        height: 200px;
        font-size: 14px;
        padding: 10px;
    }

    .mic-btn {
        right: 10px;
        bottom: 10px;
    }

    button {
        font-size: 14px;
        padding: 14px 25px;
    }


}


