/* Variables de color */
:root {
    --vitai-color: #5590C9; /* Azul VITAI */
    --darkblue-color: #011732;/* Azul Oscuro */
    --white-color: #f5f5f5;/* Blanco */
    --grey-color: #B1C3D1;; /* Gris*/
    --highlight-color: #3EB489;  /* A new highlight color */
    --soft-background: #f1f1f1;  /* Soft background for cards */
}

body {
    font-family: 'Cera Pro', sans-serif;
}

/* Chatbot */
#chatbot {
    position: fixed;
    bottom: 0;
    right: 0;
    border: 0.07rem solid var(--darkblue-color);
    border-radius: 0.625rem;
    display: flex;
    flex-direction: column;
    overflow: auto;
    margin-right: 1rem;
    transition: width 0.5s ease-in-out, height 0.5s ease-in-out, opacity 0.5s ease-in-out;
}

/* Header */

#chat-header {
    background-image: url('/static/images/fondo1.png');
    color: var(--white-color);
    padding: 1.2em;  
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0px 0.125em 0.3125em rgba(0,0,0,0.1);  /* Nueva sombra */
    height: 1.875rem;
    font-family: 'Roboto', sans-serif;
    border-bottom: 0.0625em solid var(--grey-color);
}

.left-section {
    display: flex;
    align-items: center;
}

.title-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    
}

.response-time {
    font-size: 0.7em;
    margin: 0;
    padding-left: 0.1rem;
    color: rgba(255, 255, 255, 0.7);
}

.online-indicator {
    width: 13px;
    height: 13px;
    background-color: green; /* Color verde para indicar que está en línea */
    border-radius: 50%; /* Forma redonda */
    position: absolute;
    bottom: 0px;
    right: 1px;
}


.header-title {
    color: var(--vitai-color);
    margin: 0;
    font-size: 1.3em;
    font-weight: 300;
    margin-bottom:0.2rem;
}


#logo {
    height: 3.75rem;
    margin-right: 0;
    vertical-align: middle;
    margin-top: 0.4375rem;
}

.normal {
    width: 25rem;
    height: 30rem;
}

.minimized {
    width: 20rem;
    height: 3rem;
}

.expanded {
    width: 25rem;
    height: 40rem;
}

#minimize {
    background-color: transparent;
    color: white;
    border: none;
    padding: 0.3125rem 0.625rem;
    border-radius: 0.3125rem;
    cursor: pointer;
    font-size: 0.8rem;
}

#minimize:hover {
    cursor: pointer;
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
}

@keyframes pulse {
    0% {
      box-shadow: 0 0 0 0px rgba(85, 144, 201, 0.7);
    }
    70% {
      box-shadow: 0 0 0 10px rgba(85, 144, 201, 0);
    }
    100% {
      box-shadow: 0 0 0 0px rgba(85, 144, 201, 0);
    }
  }
  

#minimized-chat {
    display: none; /* Oculto por defecto */
    position: fixed;
    bottom: 0;
    right: 0;
    margin:1rem;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-image: url('/static/images/fondo1.png');
    border: 2px solid var(--vitai-color);
    box-shadow: 0px 6px 8px rgba(0, 0, 0, 0.2); 
    background-size: cover;
    z-index: 100;
    transition: box-shadow 0.3s ease, background-color 0.3s ease, transform 0.3s ease; 
    animation: pulse 2s infinite; 
}


#minimized-chat:hover {
    cursor: pointer;
    box-shadow: 0px 6px 8px rgba(0, 0, 0, 0.2); 
    border: 2px solid var(--white-color); 
    background-color: #4178a7;  
    transform: translateY(-8px);
    transition: box-shadow 0.3s ease, background-color 0.3s ease, transform 0.3s ease; 

}

#minimized-chat img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
}

#expand {
    background-color: transparent;
    color: white;
    border: none;
    padding: 0.3125rem 0.625rem;
    border-radius: 0.3125rem;
    cursor: pointer;
    font-size: 0.8rem;
    transition: background-color 0.3s ease;
}

#expand:hover {
    cursor: pointer;
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
}



#button-group {
    display: flex;
}


#button-group button {
    background: none;
    border: none;
    color: var(--vitai-color);
    opacity: 0.7; /* Reducir la opacidad */
}

#button-group button:hover {
    opacity: 1; /* Opacidad completa al pasar el ratón */
}

.avatar-container {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin-right:1em;
    
}
.avatar-wrapper {
    margin-right: 10px; /* Espacio entre el avatar y el mensaje */
}

#avatar-img {
    height: 3.125em;
    border-radius: 50%; /* Hacer la imagen redonda */
    background-color: transparent;
    border: 1px solid var(--vitai-color);
    
}

/* Formulario */
#chat-container-form {
    display: none;
    flex-direction: column;
    height: 100%;
    
}

#user-form-container {
    display: flex;
    flex-direction: column;
    height: 100%;

    justify-content: center;
    align-items: center;
    padding: 20px;
    background-color: #f8f8f8; /* color de fondo */
    border-radius: 10px; /* bordes redondeados */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); /* sombra ligera */
}

#user-form {
    display: flex;
    flex-direction: column;
    width: 80%; /* ancho del formulario */
}

#user-form input {
    margin-bottom: 10px; /* espacio entre campos */
    padding: 10px;
    border: 1px solid #ccc; /* borde de los campos de texto */
    border-radius: 5px; /* bordes redondeados */
}

#user-form button {
    padding: 10px 20px;
    background-color: var(--vitai-color); /* color de fondo del botón */
    color: white; /* color de texto del botón */
    border: none;
    border-radius: 5px;
    cursor: pointer; /* cursor en forma de mano al pasar sobre el botón */
}

#user-form button:hover {
    background-color: #003d82; /* color al pasar el ratón por encima */
}


/* USUARIO Y CONTRASEÑA PARA CONTROL */
#login-container-form {
    display: flex;
    flex-direction: column;
    height: 100%;
    
}

#login-container-form {
    display: flex;
    flex-direction: column;
    height: 100%;

    justify-content: center;
    align-items: center;
    padding: 20px;
    background-color: #f8f8f8; /* color de fondo */
     /* bordes redondeados */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); /* sombra ligera */
}

#login-form {
    display: flex;
    flex-direction: column;
    width: 80%; /* ancho del formulario */
}

#login-form input {
    margin-bottom: 10px; /* espacio entre campos */
    padding: 10px;
    border: 1px solid #ccc; /* borde de los campos de texto */
    border-radius: 5px; /* bordes redondeados */
}

#login-form button {
    padding: 10px 20px;
    background-color: var(--vitai-color); /* color de fondo del botón */
    color: white; /* color de texto del botón */
    border: none;
    border-radius: 5px;
    cursor: pointer; /* cursor en forma de mano al pasar sobre el botón */
}

#login-form button:hover {
    background-color: var(--darkblue-color); /* color al pasar el ratón por encima */
}


/* Conversacion */

#chat-container {
    display: none;
    flex-direction: column;
    height: 100%;
}
#chat-content {
    margin-top:0.5rem;
margin-bottom: 2rem;
}


#chat-body {
    flex-grow: 1;
    overflow-y: auto;
    padding: 0.625em;
    height: 10rem;
    background-color: white;
    
}

.user-name {
    text-align: right;
    color: black;
    font-size: 0.8em;  /* Modificado a em */
    margin: 0.2em;  /* Modificado a em */
    font-weight: bold;

}

.bot-name {
    text-align: left;
    color: #5590C9;
    font-size: 0.8em;  /* Modificado a em */
    margin: 0.2em;  /* Modificado a em */
    font-weight: bold;
    
}

.user-message-container {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    margin: 0.3em;
}

.user-message {
    text-align: left;
    background-color: var(--vitai-color);
    color: var(--white-color);
    padding-right: 0.45rem;
    padding-left: 0.45rem;
    border-radius: 0.625rem;
    word-wrap: break-word;
    line-height: 1.5;
    font-size: 0.75rem;
    overflow-wrap: break-word;
    white-space: pre-wrap; /* Añadido */
    display: inline-block; /* Modificado */
    max-width: 100%;
    margin-bottom: 0.5rem;
    margin-left: 3.5rem;
    transition: all 0.3s ease-in-out;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
   
}
.user-message p{
    white-space: pre-wrap; 
    overflow-wrap: break-word;
    line-height: 1.4;
}


.bot-message-container {
    display: flex;
    align-items: flex-start;
    margin: 0.1em;
}



.bot-message {
    text-align: left;
    background-color: var(--grey-color);
    color: var(--darkblue-color);
    padding-right: 0.45rem;
    padding-left: 0.45rem;
    border-radius: 0.625rem;
    word-wrap: break-word;
    line-height: 1.5;
    font-size: 0.75rem;
    overflow-wrap: break-word;
    margin-bottom:0.5rem;
    transition: all 0.3s ease-in-out;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);

}

.bot-icon {
 
    height: 2.125em;
    border-radius: 50%; /* Hacer la imagen redonda */
    background-color: var(--darkblue-color);
    border: 1px solid var(--vitai-color);
}

/* Iconos para agregar: Carrito de compras
#action-icons {
    display: flex;
    justify-content: space-around;
    padding: 0.5rem;
}
#action-icons i {
    font-size: 1.2rem;
    cursor: pointer;
}
*/

/* FAQ */




/* Footer */
#chat-footer {
    padding: 0.5rem;
    display: none;
    align-items: center;
    justify-content: space-between;
    background-color: white;  /* Fondo blanco para toda la sección del pie de página */
    border-top: 1px solid var(--grey-color);  /* Línea divisoria */
}

#chat-input {
    outline: none;
    padding: 0.3125 rem;
    border-radius: 1rem;
    border: none;
    resize: none;
    width: 80%;
    font-size: 0.775rem;
    background-color: white; 
    height: 1.2rem;
    max-height: 7rem;
    
    
}

#chat-submit {
    padding: 0.5rem;
    background-color: var(--vitai-color);  /* Fondo blanco para el botón */
    color: var(--white-color);
    border: none;
    border-radius: 50%;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}


#chat-submit.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}


#chat-submit:not(.disabled):hover {
    background-color: var(--white-color);  /* Usamos el blanco para el fondo al pasar el mouse */
    color: var(--vitai-color);  /* Usamos el azul VITAI para el color del texto al pasar el mouse */
    border: 2px solid var(--vitai-color);  /* Añadimos un borde al pasar el mouse */
    cursor: pointer;
}


/* FAQ */
#faq-section {
    position: relative;
    display: none;
    justify-content: flex-end;
    background-color: white;
    z-index: 1000;
  
  }

.faq-container {
    position: absolute;
    display: none;
    flex-direction: column;
    max-height: 10rem;  /* Altura máxima que quieras */
    overflow-y: auto;  /* Hacerlo desplazable */
    bottom: 1rem;
    right: 0;
    z-index: 1001;
    align-items: flex-end;
  }

  .faq-container.hidden { /* Añadir esta clase */
    opacity: 0;
    pointer-events: none;
}
  

#quick-questions {
    position: absolute;
    bottom: 0rem;
    right: 0;
    display: flex;
    justify-content:flex-end;
    
    padding: 0.4em;
}

#faq-button{
background-color: white;
}
#faq-button:hover{
    background-color: var(--darkblue-color);
    }

.button-faq {
    background-color: transparent;
    border: 2px solid var(--darkblue-color); 
    padding: 0.3rem;
    color: var(--vitai-color);
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.7em;
    margin:0.3em;
    
    text-align:left;
    width: fit-content;
    /* Modificado */

    
}

.button-faq:hover {
    background-color:var(--darkblue-color);
    color:white;
    cursor: pointer;
}

.close-button {
    background-color: transparent;
    border:none;
    font-size: 24px;
    cursor: pointer;
    color: var(--darkblue-color);

}

  
/* Powered by */
#powered-by {

    bottom: 0;
    width: 100%;
    text-align: center;
    padding: 0rem;
    background-image: url('/static/images/fondo1.png');

    color: var(--white-color);
  
    
    font-size: 0.7rem;
    border-top: 1px solid #5590C9;
    
 
}

#powered-by p {
    display: inline-block;
    vertical-align: middle;
    padding:0;
    margin:0;
}

#powered-by img {
    height: 2.5rem; /* Ajusta esto según el tamaño que quieras para tu logo */
    margin-left: 0.5rem;
    margin-top:0;
}






/* Spinner */
#spinner-container {
    display: none;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    padding:0.2rem;
    transition: all 0.3s ease-in-out;  /* Aumentar la duración del efecto */
    background-color: white;
}

#avatar-with-spinner {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 35px;  /* Asegúrate de que este ancho coincida con el del avatar y el spinner */
    height: 35px; 
}

.loader {
      /* Cambiar color a gris claro */
    border-top: 4px solid var(--darkblue-color);  /* Color principal */
    border-radius: 50%;
    width: 35px;  /* Aumentar tamaño */
    height: 35px;  /* Aumentar tamaño */
    animation: spin 1s linear infinite;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    margin: auto;  /* Esto centrará el spinner */
}

#spinner-message {
    font-size: 1rem;
    text-align: center;
    font-family: 'Cera Pro', sans-serif;
    color:#5590C9;
    opacity: 0.8;  /* Añadir efecto de desvanecimiento */
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
/* Estilos para pantallas más pequeñas */
@media (max-width: 480px) {
    #spinner-message {
        font-size: 0.8rem;
    }


    #chatbot {
        width: 99%; /* No el 100%, pero sí más ancho que en pantallas grandes */
        min-height: 80vh; /* Altura mínima para asegurarnos de que el chat sea legible */
        max-height: 90vh; /* Altura máxima para no ocupar toda la pantalla */
        position: fixed;
        margin-right: 0rem;
        bottom: 0;
        
        border-radius: 1rem;
    }

    #chat-header, #chat-footer {
        padding: 1rem;
    }

    
    #chat-container {
        height: 70vh; /* Dejamos que el contenedor ajuste su altura automáticamente */
        overflow: hidden;
    }

    .header-title, #spinner-message {
        font-size: 1rem; /* Tamaño de fuente más grande para mejor legibilidad */
    }

    .avatar-container {
        margin-right: 0.5em;  /* Ajusta este valor para pantallas pequeñas */
    }



    #avatar-img {
        width: 40px;
        height: 40px;
    }

    #chat-body {
        overflow-y: auto; /* Aseguramos que el contenido pueda desplazarse */
        max-height: calc(70vh - 4rem); /* Altura máxima menos el tamaño del header y footer */
    }

    .user-message, .bot-message {
        font-size: 0.8rem; /* Aumentamos el tamaño de fuente de los mensajes */
    }
    #expand {
        display:none;
    }
}