/* ********************** CHAT TOGGLER ************************** */

.chatbot-toggler
{
  z-index: 100;
  box-sizing: border-box;
  position: fixed;

  right: 140px;
  /*bottom: 32px;
  height: 80px;
  width: 80px;*/

  bottom: 2rem;
  width: 5rem;
  height: 5rem;

  outline: none;
  border: none;
  display: flex;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #d5465e;
  transition: all 0.3s ease;
  box-shadow: 0 20px 20px #00000012;
}

.chatbot-toggler:hover
{
  background: #000000;
}

.show-chatbot.chatbot-toggler {
  transform: rotate(90deg);
}


.chatbot-toggler .icon-bot,.chatbot-toggler .icon-bot img
{
  width: 38px;
  height: 38px;
}

.chatbot-toggler .icon-close,.chatbot-toggler .icon-close img
{
  width: 25px;
  height: 25px;
}

.chatbot-toggler span {
  color: #fff;
  position: absolute;
}

.chatbot-toggler span:last-child,
.show-chatbot.chatbot-toggler span:first-child {
  opacity: 0;
}

.show-chatbot.chatbot-toggler span:last-child {
  opacity: 1;
}

/* ********************** CHAT ************************** */

.chatbot 
{
  z-index: 99999999;
  position: fixed;
  box-sizing: border-box;
  right: 35px;
  bottom: 120px;
  width: 500px;
  background: #fff;
  border-radius: 15px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.1);
  transform-origin: 80% 100%;
  transition: all 0.3s ease;
  box-shadow: 0px 0px 20px #55555555;
}

.chatbot.show-chatbot 
{
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

/* ********************** HEADER ************************** */

.chatbot .chatheader 
{
  height:60px;
  text-align: center;
  color: #fff;
  background: #d5465e;
  /* box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);*/
}

.chatbot .chatheader .close-btn {
  position: absolute;
  right: 10px;
  top: 8px;
  padding : 10px;
  border-radius: 12px;
  width: 20px;
  height: 20px;
  cursor: pointer;
  box-sizing: content-box;
}

.chatbot .chatheader .close-btn:hover {
  background-color: #FFFFFF33; 
}

.chatbot .chatheader h2
{
  margin:0;
  padding : 14px 0px;
  font-size: 22px;
  font-weight: 700;
}

/* ********************** CHAT ************************** */

.chatbot .chatbox
{
  box-sizing: content-box;
  overflow-y: auto;
  height: 450px;
  padding: 20px 20px 100px;
}

.chatbot :where(.chatbox, textarea)::-webkit-scrollbar {
  width: 6px;
}

.chatbot :where(.chatbox, textarea)::-webkit-scrollbar-track {
  background: #fff;
  border-radius: 25px;
}

.chatbot :where(.chatbox, textarea)::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 25px;
}

.chatbox .chat {
  display: flex;
  list-style: none;
  margin-bottom: 20px;
}

.chatbox .outgoing {
  /*margin: 20px 0;*/
  justify-content: flex-end;
}

.chatbox .incoming .chaticon {
  width: 32px;
  height: 32px;
  color: #fff;
  cursor: default;
  text-align: center;
  line-height: 32px;
  align-self: flex-end;
  background: #d5465e;
  border-radius: 4px;
  margin: 0 10px 7px 0;
}

.chatbox .incoming .chaticon img {
  width: 20px;
  margin-top: 6px;
  margin-left: 6px;
  margin-right: 6px;
}


.chatbox .incoming .chaticonaudio {
  display:block;
  width: 22px;
  height: 22px;
  border: 1px solid #000000;
  border-radius: 5px;
  color: #fff;
  cursor: pointer;
  text-align: center;
  line-height: 22px;
  margin: 10px 0 0 0;
}

.chatbox .incoming .chaticonaudio:hover {
  background-color: #00000033;
}

.chatbox .incoming .chaticonaudio img {
  margin-top: 2px;
  width: 18px;
}



.chatbox .chat .chatmessage {
  white-space: pre-wrap;
  word-wrap: break-word;   
  -webkit-hyphens: auto;
  hyphens: auto;
  padding: 12px 16px;
  border-radius: 10px 10px 0 10px;
  max-width: 75%;
  color: #fff;
  font-size: 1rem;
  background: #d5465e;
  min-width: 100px;
}

.chatbox .incoming .chatmessage {
  border-radius: 10px 10px 10px 0;
}

.chatbox .chat p.error {
  color: #721c24;
  background: #f8d7da;
}

.chatbox .incoming .chatmessage {
  color: #000;
  background: #f2f2f2;
}

.chatbot .chat-input
{
  box-sizing: border-box;
  position: absolute;
  bottom: 0;
  width: 100%;
  background: #fff;
  padding: 3px 20px;
  border-top: 1px solid #ddd;
}

.chat-input textarea {
  box-sizing: border-box;
  height: 55px;
  width: 100%;
  border: none;
  outline: none;
  resize: none;
  max-height: 180px;
  padding: 15px 15px 15px 0;
  font-size: 1rem;
}

.chat-input textarea:focus
{
  outline: none;         /* Supprime le contour bleu */
  box-shadow: none;      /* Supprime l'ombre bleue si présente */
}

.chat-input .send-btn
{
  position: absolute;
  top : 10px;
  right: 10px;
  color: #d5465e;
  cursor: pointer;
  visibility: hidden;
  font-size: 1.35rem;
  padding: 10px;
  border-radius: 12px;
  width:22px;
  height:22px;
  box-sizing: content-box;
}

.chat-input .send-btn:hover 
{
  background-color: #00000011;
}

.chat-input .chat-recognition
{
  position: absolute;
  top : 10px;
  right: 10px;
  color: #d5465e;
  cursor: pointer;
  font-size: 1.35rem;
  padding: 10px;
  border-radius: 12px;
  width:22px;
  height:22px;
  box-sizing: content-box;
}

.chat-input .chat-recognition:hover {
  background-color: #00000011;
}


.chat-input textarea:valid~.send-btn {
  visibility: visible;
}
.chat-input textarea:valid~.chat-recognition {
  visibility: hidden;
}

/* ******************************** LIVE DISCUTION */

.chatbot .chat-live
{
  position: absolute;
  background-color: #FFFFFF;
  top:60px;
  bottom: 0px;
  left: 0px;
  right: 0px;
  text-align: center;
}

.chatbot .chat-live .chat-live-recording
{
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 100px;
  margin-left: auto;
  margin-right: auto;
  width:180px;
  height:180px;
  border: 1px solid #d5465e;
  border-radius: 100px;
  animation: borderExpand 0.5s ease-in-out infinite alternate;
  transition: border-width 0.3s;
  box-sizing: border-box;
}

.chatbot .chat-live .chat-live-recording img
{
  width:64px;
  height:64px;
}


.chatbot .chat-live .chat-live-talkia
{
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 100px;
  margin-left: auto;
  margin-right: auto;
  width:180px;
  height:180px;
  border: 1px solid #d5465e;
  border-radius: 100px;
  animation: borderExpandRotate 0.5s ease-in-out infinite alternate;
  transition: border-width 0.3s;
  box-sizing: border-box;
}

.chatbot .chat-live .chat-live-talkia img
{
  width:100px;
  height:100px;
}

.chatbot .chat-live .chat-live-close
{
  cursor: pointer;
  text-decoration: underline;
}

/* ******************************** MOBILE */

@media (max-width: 767px) {

  .chatbot-toggler {
    right: 100px;
    /*
    bottom: 16px;
    width:64px;
    height:64px;
    */
    bottom: 1rem;
    width: 4rem;
    height: 4rem;
  }
  
  .chatbot {
    right: 0;
    bottom: 0;
    left: 0;
    top: 0;
    
    width: auto;
    height: auto;
    border-radius: 0;
    box-shadow: none;
  }

  .chatbot .chatheader 
  {
    text-align: center;
    color: #fff;
    background: #d5465e;
    /* box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);*/
  }

  .chatbot .chatbox {
    position:absolute;
    top:60px;
    bottom: 0px;
    padding: 25px 15px 100px;
    height:auto;
  }

  .chatbot .chat-input {
    padding: 5px 15px;
  }
}

/* ******************************** BORDER ANIMATION */

.chat-border-spinner
{
  animation: fondChange 0.5s linear infinite alternate;
}

@keyframes fondChange {
  0%   { background: #ffc5cf; }
  100% { background: #d5465e; }
}


@keyframes borderExpand {
  0% {border-width: 4px;}
  100% {border-width: 20px;}
}

@keyframes borderExpandRotate {
  0% {border-width: 4px;}
  100% {border-width: 20px;transform: rotate(360deg);}
}




/* ******************************** LOADER */

.chatbot-loader, .chatbot-loader:before, .chatbot-loader:after {
  border-radius: 50%;
  width: 2.5em;
  height: 2.5em;
  animation-fill-mode: both;
  animation: bblFadInOut 1.8s infinite ease-in-out;
}
.chatbot-loader {
    color: #555;
    font-size: 7px;
    position: relative;
    text-indent: -9999em;
    transform: translateZ(0);
    animation-delay: -0.16s;
    margin-left: 30px;
    margin-bottom: 30px;
}
.chatbot-loader:before,
.chatbot-loader:after {
  content: '';
  position: absolute;
  top: 0;
}
.chatbot-loader:before {
  left: -3.5em;
  animation-delay: -0.32s;
}
.chatbot-loader:after {
  left: 3.5em;
}

@keyframes bblFadInOut {
  0%, 80%, 100% { box-shadow: 0 2.5em 0 -1.3em }
  40% { box-shadow: 0 2.5em 0 0 }
}
