/* ----------------------------------------------------------------------------------------------------------
   DomoGEST - Chatbot Customer Care
   Stile del widget di chat del sito.
   Copyright (C) 2020 - DOMOTICA 3000
---------------------------------------------------------------------------------------------------------- */

.dgchat,
.dgchat * {
  box-sizing: border-box;
}

/* ---------------------------------------------------------------- bubble */

.dgchat-bubble {
  position: fixed;
  left: 20px;
  bottom: 20px;
  z-index: 10500;
  width: 58px;
  height: 58px;
  border: 0;
  border-radius: 50%;
  background: #ff6821;
  color: #fff;
  font-size: 24px;
  line-height: 58px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.dgchat-bubble:hover {
  transform: scale(1.06);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.32);
}

.dgchat-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 10px;
  background: #d9534f;
  color: #fff;
  font-size: 11px;
  font-weight: bold;
  line-height: 20px;
  text-align: center;
}

/* ----------------------------------------------------------------- panel */

.dgchat-panel {
  position: fixed;
  left: 20px;
  bottom: 90px;
  z-index: 10501;
  display: none;
  flex-direction: column;
  width: 360px;
  max-width: calc(100vw - 40px);
  height: 520px;
  max-height: calc(100vh - 120px);
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.28);
  overflow: hidden;
}

.dgchat-aperto .dgchat-panel {
  display: flex;
}

.dgchat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 0 0 auto;
  padding: 12px 14px;
  background: #2f3e4d;
  color: #fff;
}

.dgchat-head-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dgchat-head-info strong {
  display: block;
  font-size: 14px;
  line-height: 1.2;
}

.dgchat-head-info small {
  display: block;
  font-size: 11px;
  opacity: 0.75;
}

.dgchat-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #95a5a6;
  flex: 0 0 auto;
}

.dgchat-dot-on {
  background: #2ecc71;
  box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.25);
}

.dgchat-close {
  border: 0;

/* ------------------------------------------------------------------ body */

.dgchat-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 14px;
  background: #f2f6f8;
}

.dgchat-msg {
  margin-bottom: 10px;
  clear: both;
}

.dgchat-testo {
  display: inline-block;
  max-width: 85%;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.45;
  white-space: normal;
  word-wrap: break-word;
}

.dgchat-msg-bot,
.dgchat-msg-operatore {
  float: left;
}

.dgchat-msg-bot .dgchat-testo,
.dgchat-msg-operatore .dgchat-testo {
  background: #fff;
  color: #4b5563;
  border: 1px solid #e3e8ee;
}

.dgchat-msg-operatore .dgchat-testo {
  border-color: #62a8ea;
  background: #f4f9ff;
}

.dgchat-msg-cliente {
  float: right;
  text-align: right;
}

.dgchat-msg-cliente .dgchat-testo {
  background: #62a8ea;
  color: #fff;
  text-align: left;
}

.dgchat-meta {
  margin-top: 3px;
  font-size: 10px;
  color: #9aa5b1;
}

.dgchat-msg-cliente .dgchat-meta {
  text-align: right;
}

.dgchat-nome {
  font-weight: bold;
  margin-right: 5px;
}

.dgchat-voti {
  margin-left: 6px;
  white-space: nowrap;
}

.dgchat-voto {
  border: 0;
  background: transparent;
  padding: 0 2px;
  font-size: 12px;
  opacity: 0.45;
  cursor: pointer;
}

.dgchat-voto:hover,
.dgchat-voto-attivo {
  opacity: 1;
}

/* "sta scrivendo..." */
.dgchat-typing .dgchat-testo span {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 3px;
  border-radius: 50%;
  background: #9aa5b1;
  animation: dgchat-blink 1.2s infinite ease-in-out;
}

.dgchat-typing .dgchat-testo span:nth-child(2) {
  animation-delay: 0.2s;
}

.dgchat-typing .dgchat-testo span:nth-child(3) {
  animation-delay: 0.4s;
  margin-right: 0;
}

@keyframes dgchat-blink {
  0%, 80%, 100% { opacity: 0.25; }
  40% { opacity: 1; }
}


/* ------------------------------------------------------------------ foot */

.dgchat-foot {
  flex: 0 0 auto;
  padding: 8px 12px 12px;
  border-top: 1px solid #e3e8ee;
  background: #fff;
}

.dgchat-azioni {
  margin-bottom: 6px;
}

.dgchat-operatore {
  border: 0;
  background: transparent;
  padding: 0;
  color: #ff6821;
  font-size: 12px;
  text-decoration: underline;
  cursor: pointer;
}

.dgchat-inputwrap {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.dgchat-inputwrap textarea {
  flex: 1 1 auto;
  min-height: 38px;
  max-height: 90px;
  padding: 9px 10px;
  border: 1px solid #cfd8e3;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.35;
  resize: none;
  outline: none;
}

.dgchat-inputwrap textarea:focus {
  border-color: #62a8ea;
}

.dgchat-inputwrap button {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 8px;
  background: #ff6821;
  color: #fff;
  font-size: 15px;
  cursor: pointer;
}

.dgchat-inputwrap button:disabled {
  opacity: 0.45;
  cursor: default;
}

/* ----------------------------------------------------------------- mobile */

@media (max-width: 767px) {
  .dgchat-panel {
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
  }

  .dgchat-bubble {
    left: 14px;
    bottom: 14px;
    width: 52px;
    height: 52px;
    font-size: 21px;
    line-height: 52px;
  }

  .dgchat-aperto .dgchat-bubble {
    display: none;
  }
}

/* ---------------------------------------------------------- quick reply */

.dgchat-quick {
  display: none;
  flex: 0 0 auto;
  padding: 0 14px 10px;
  background: #f2f6f8;
}

.dgchat-qr {
  display: inline-block;
  margin: 0 6px 6px 0;
  padding: 5px 10px;
  border: 1px solid #cfd8e3;
  border-radius: 14px;
  background: #fff;
  color: #2f3e4d;
  font-size: 12px;
  cursor: pointer;
}

.dgchat-qr:hover {
  border-color: #ff6821;
  color: #ff6821;
}

  background: transparent;
  color: #fff;
  font-size: 24px;
  line-height: 1;
  opacity: 0.75;
  cursor: pointer;
}

.dgchat-close:hover {
  opacity: 1;
}
