@import url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100..900;1,100..900&display=swap');
/* font-family: "Roboto", sans-serif; */

/* Reset de base */
:root {
  --mjvai-color-header-button: #FDC700; /* Variabile CSS */
  --mjvai-color-text-header: #000000; /* Variabile CSS unifiée pour le texte */
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Conteneur principal du chat */
.mjvai_chat-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 22rem; /* Largeur rÃ©duite pour un widget */
  height: 32rem;
  background-color: white;
  border: 1px solid #ccc;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  font-family: "Roboto", sans-serif;
  z-index: 1000; /* S'assurer qu'il est au-dessus des autres Ã©lÃ©ments */
}

.mjvai_chat-container.mjvai_enlarged_chat{
  width: 40vw;
  max-height: 70vh ! Important;
  min-height: 70vh !important;
}

@media (max-width: 760px), screen and (max-device-width: 760px) {
  .mjvai_chat-container.mjvai_enlarged_chat {
    width:85vw;
    min-height: 90vh !Important;
  }
}

/* En-tÃªte du chat */
.mjvai_chat-header {
  background-color: var(--mjvai-color-header-button);
  color: var(--mjvai-color-text-header);
  padding: 0.5rem;
  padding: 0.6rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 0.6rem 0.6rem 0 0; /* Arrondir les coins supÃ©rieurs */
}

.mjvai_chat-header:active {
}

.mjvai_chat-header-info {
  /* display: flex; */
  align-items: center;
  /* flex-grow: 1; */ /* Permet au contenu de prendre l'espace disponible */
  width: 90%;
  float: left;
}

:root {
  --image-logo-url: url(../images/beai-chat-icon_utente.png);
}

.mjvai_user-icon {
  margin-right: 0.7rem;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid #ffffff;
  border-radius: 50%;
  position: relative;
  float: left;
  background-color: hsl(0deg 0% 71.01% / 34%);
  background-image: var(--image-logo-url);
  background-size: 70%;
  background-position: center;
  background-repeat: no-repeat;
}

.mjvai_user-icon:after{
  content: " ";
  display: block;
  width: 0.6rem;
  height: 0.6rem;
  background-color: #0ed238;
  border-radius: 50%;
  position:absolute;
  right:0;
  bottom:0;
}

.mjvai_user-content-name{
  float:left;
  width: -webkit-calc(100% - 4rem);
  width: -moz-calc(100% - 4rem);
  width: calc(100% - 4rem);
  color: var(--mjvai-color-text-header);
}

.mjvai_user-name, .mjvai_user-surname {
  color: var(--mjvai-color-text-header);
}

.mjvai_user-name {
  font-size: 1.2rem;
}

.mjvai_user-surname {
  font-size: 0.8rem;
}

/* Bouton de fermeture */
.mjvai_largerscreen-button,
.mjvai_close-button{
  width: 1.2rem;
  height: 1.2rem;
  border: none;
  float: right;
  background-image: url(../images/beai-chat-largescreen.png);
  background-color:hsl(0deg 0% 100% / 0%);
  background-repeat: no-repeat;
  background-size: contain;
}
.mjvai_close-button {
  background-image: url(../images/beai-icon-close.png);
}

.mjvai_enlarged_chat .mjvai_largerscreen-button{
  background-image: url(../images/beai-chat-largescreen_riduci.png);
}

.mjvai_largerscreen-button{
  margin-right:0.5rem;
}

.mjvai_close-button:hover,
.mjvai_largerscreen-button:hover {
  opacity:0.7;
  cursor: pointer;
}

/* Zone de messages */
.mjvai_chat-box {
  font-size: 0.8rem;
  flex: 1;
  padding: 15px;
  overflow-y: auto;
  background-color: #f9f9f9;
  font-family: "Roboto" , sans-serif;
  font-weight: 300;
  position: relative;
}

/* Style des messages */
.mjvai_message {
  max-width: 70%;
  padding: 10px;
  border-radius: 10px;
  position: relative;
}

.mjvai_message.user {
  background-color: var(--mjvai-color-header-button);
  color: black;
  align-self: flex-end;
  position: relative;
  padding-right: 15px;
}

.mjvai_message.other {
  background-color: #e0e0e0;
  color: #333333;
  align-self: flex-start;
}

/* Zone de saisie */
.mjvai_chat-input {
  display: flex;
  padding: 0.5rem;
  background-color: #ffffff;
  /* border-top: 1px solid #e0e0e0; */
}

#mjvai_message-input {
  flex: 1;
  padding: 0.6rem;
  border: 1px solid #e0e0e0;
  border-radius: 20px;
  outline: none;
}

#mjvai_input-send-button{
  margin-left: 0.6rem;
  background-color: var(--mjvai-color-header-button);
  color: black;
  border: none;
  cursor: pointer;
  transition: background-color 0.3s;
  border-radius: 50%;
  height: 2.2rem;
  width: 2.2rem;
  padding: 0.5rem;
  float: right;
  background-image: url(../images/beai-chat-send.png);
  background-size: 70%;
  background-position: left 0.4rem center;
  background-repeat: no-repeat;
}

#mjvai_input-send-button:hover {
  opacity:0.7;
}

/* Personnalisation de la barre de dÃ©filement */
.mjvai_chat-box::-webkit-scrollbar {
  width: 8px;
}

.mjvai_chat-box::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.mjvai_chat-box::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 4px;
}

.mjvai_chat-box::-webkit-scrollbar-thumb:hover {
  background: #555;
}

.mjvai_chat-box .message {
  margin-bottom: 0.5rem;
  margin-right: 0;
  width: auto;
  border-radius: 0.8rem;
  clear:both;
  display: inline-block;
  padding: 0.2rem 0.5rem;
  line-height: 1.4;
  text-align: justify;
}
.mjvai_chat-box .message.user {
  float: right;
  background-color: #c5c5c5;
  border-bottom-right-radius: 0;
  max-width: 60%;
}
.mjvai_chat-box .message.other{
  float: left;
  margin-left: 0rem;
  background-color: #efefed;
  border-bottom-left-radius: 0;
  max-width: 75%;
}


/* STILE PER L'INDICATORE DI DIGITAZIONE */
.mjvai_typing-indicator {
  display: inline-block;
  padding: 10px;
  background-color: #e0e0e0; /* Colore di sfondo simile ai messaggi del bot */
  border-radius: 10px; /* Bordi arrotondati */
  margin-bottom: 10px; /* Spaziatura inferiore */
}

/* init wait message */
.mjvai_typing-indicator {
  display: inline-flex;
  padding: 10px 15px;
  background-color: hsl(0deg 0% 87.84% / 0%);
  border-radius: 18px;
  margin: 5px 0;
  align-items: center;
  gap: 5px;
  float: left;
  clear: both;
}

.mjvai_typing-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--mjvai-color-header-button);
  animation: mjvai_typing-animation 1.4s infinite ease-in-out;
}

@keyframes mjvai_typing-animation {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-5px); }
}

.mjvai_typing-dot:nth-child(1) { animation-delay: 0s; }
.mjvai_typing-dot:nth-child(2) { animation-delay: 0.2s; }
.mjvai_typing-dot:nth-child(3) { animation-delay: 0.4s; }
/* end wait message */

/* privacy css*/
.privacy-message {
  display: block;
  text-align: center;
  margin: 8px auto;
  padding: 4px 0;
  font-size: 11px;
  color: #999999;
  font-family: 'Segoe UI', system-ui, sans-serif;
  width: 82%;
  line-height: 1.3;
  letter-spacing: 0.02em;
}

.privacy-message a {
  color: #3a5a9a;
  text-decoration: none;
  font-weight: 600;
}
/*end privacy css*/

.chat-date {
  width: 100%;
  display: flex;
  justify-content: center;
  margin: 20px 0;
}

.chat-date span {
  background-color: #f1efff;
  color: #3b3b3b;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 14px;
  font-family: sans-serif;
  font-size: 13px;
  text-transform: lowercase;
}

/*orario*/
.message {
  position: relative;
}

.message-text {
  padding-bottom: 16px;
}
.message.other .message-time {
  position: absolute;
  right: 10px;
  bottom: 3px;
  font-size: 0.65rem;
  color: rgba(0,0,0,0.45);
}

.message.user .message-time {
  position: absolute;
  right: 2px;
  bottom: 2px;
  font-size: 0.65rem;
  color: rgba(0,0,0,0.45);
}
