/* Bottone di toggle (icona chat) */
.chat-toggle-button {
  position: fixed;
  bottom: 20px;
  left: 20px;
  background: #0066cc;
  color: #fff;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-size: 24px;
  line-height: 48px;
  text-align: center;
  cursor: pointer;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* Finestra di chat */
.chat-window {
  position: fixed;
  bottom: 80px;
  left: 20px;
  width: 350px;
  max-height: 400px;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.2);
  z-index: 1000;
}

/* Nasconde la finestra */
.chat-window.hidden {
  display: none;
}

/* Intestazione */
.chat-header {
  background-color: #0066cc;
  color: #ffffff;
  padding: 8px 12px;
  font-size: 16px;
  font-weight: bold;
  text-align: center;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
  flex: 0 0 auto;
}

/* Corpo con padding */
.chat-body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 12px;
}

/* Area dei messaggi */
.chat-log {
  flex: 1 1 auto;
  overflow-y: auto;
  margin: 0;
  padding: 0;
}

/* Messaggio di sistema / disclaimer */
.chat-system {
  background-color: #f9f9f9;
  color: #333;
  padding: 10px;
  border-radius: 4px;
  margin: 0 0 8px;
  font-size: 14px;
  line-height: 1.4;
}
.chat-system p {
  margin: 0 0 0.5em;
}

/* Messaggi utente e bot */
.chat-user {
  text-align: right;
  margin: 5px 0;
  font-weight: bold;
}
.chat-bot {
  text-align: left;
  margin: 5px 0;
  font-size: 14px;
  line-height: 1.5;
}

/* Campo di input */
.chat-input {
  flex: 0 0 auto;
  width: 100%;
  margin-top: 8px;
  padding: 12px 12px;
  min-height: 44px;
  border: 1px solid #eee;
  border-radius: 4px;
  box-sizing: border-box;
  font-size: 14px;
}

/* Finestra inline */
.chat-window.inline {
  position: relative;
  bottom: auto;
  left: auto;
  width: 100%;
  max-height: none;
  margin: 0 auto;
  box-shadow: 0 1px 8px rgba(0,0,0,0.1);
}

/* Altezza massima per log inline */
.dai-chatbot-inline .chat-log {
  max-height: 400px;
}

/* ---------- Format link e testo ---------- */
.chat-bot a {
  color: #0066cc;
  text-decoration: underline;
}

/* Paragrafi */
.chat-bot p {
  margin: 0 0 0.6em;
  line-height: 1.5;
}

/* Liste puntate e numerate */
.chat-bot ul,
.chat-bot ol {
  margin: 0.5em 0 0.5em 1.5em;
  padding: 0;
}
.chat-bot li {
  margin-bottom: 0.4em;
}

/* Grassetto e corsivo */
.chat-bot strong {
  font-weight: bold;
}
.chat-bot em {
  font-style: italic;
}

/* Gestione <br> (a capo) */
.chat-bot br {
  display: inline;
  content: "\A";
  white-space: pre-line;
}

/* Blocchi <pre> (testo preformattato, codice) */
.chat-bot pre {
  background: #f2f2f2;
  padding: 8px;
  border-radius: 4px;
  overflow-x: auto;
  font-family: monospace;
  font-size: 13px;
  margin: 0.5em 0;
}
