/* ASODOMI chatbot flottante — v1.0 */
#asodomi-chat-btn {
  position: fixed; right: 20px; bottom: 20px; z-index: 999990;
  width: 60px; height: 60px; border-radius: 50%;
  background: linear-gradient(135deg, #0b3d91 0%, #1b2a4a 100%);
  border: none; cursor: pointer; box-shadow: 0 4px 16px rgba(11,61,145,.4);
  display: flex; align-items: center; justify-content: center;
  transition: transform .2s ease, box-shadow .2s ease;
}
#asodomi-chat-btn:hover { transform: scale(1.06); box-shadow: 0 6px 20px rgba(11,61,145,.5); }
#asodomi-chat-btn svg { width: 28px; height: 28px; fill: #fff; }
#asodomi-chat-btn .asodomi-chat-badge {
  position: absolute; top: -2px; right: -2px; width: 18px; height: 18px;
  background: #ce1126; color: #fff; border-radius: 50%;
  font-size: 11px; font-weight: bold; display: flex;
  align-items: center; justify-content: center; font-family: sans-serif;
}
#asodomi-chat-panel {
  position: fixed; right: 20px; bottom: 92px; z-index: 999991;
  width: 360px; max-width: calc(100vw - 40px); height: 520px; max-height: calc(100vh - 130px);
  background: #fff; border-radius: 16px; overflow: hidden;
  box-shadow: 0 12px 40px rgba(0,0,0,.25);
  display: flex; flex-direction: column;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  transform: translateY(16px) scale(.98); opacity: 0; pointer-events: none;
  transition: transform .22s ease, opacity .22s ease;
}
#asodomi-chat-panel.open { transform: none; opacity: 1; pointer-events: auto; }
.asodomi-chat-header {
  background: linear-gradient(135deg, #0b3d91 0%, #1b2a4a 100%);
  color: #fff; padding: 14px 16px; display: flex; align-items: center; gap: 10px;
}
.asodomi-chat-avatar {
  width: 38px; height: 38px; border-radius: 50%; background: #fff;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  font-size: 20px; overflow: hidden;
}
.asodomi-chat-avatar img { width: 100%; height: 100%; object-fit: contain; }
/* Domi-Bot: robottino animato con i colori dominicani (SVG inline nell'avatar) */
.asodomi-chat-avatar svg { width: 100%; height: 100%; animation: asodomi-bot-bob 2.4s ease-in-out infinite; transform-origin: 50% 90%; }
@keyframes asodomi-bot-bob { 0%, 100% { transform: translateY(0) rotate(-1.5deg); } 50% { transform: translateY(-3px) rotate(1.5deg); } }
.asodomi-chat-avatar .bot-eyes { animation: asodomi-bot-blink 4s ease-in-out infinite; transform-origin: 50px 41px; }
@keyframes asodomi-bot-blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(0.1); } }
.asodomi-chat-avatar .bot-antenna-light { animation: asodomi-bot-pulse 1.8s ease-in-out infinite; }
@keyframes asodomi-bot-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
#asodomi-chat-panel.chatbot-typing .bot-arm-right { animation: asodomi-bot-wave 0.9s ease-in-out infinite; transform-origin: 74px 66px; }
@keyframes asodomi-bot-wave { 0%, 100% { transform: rotate(0deg); } 50% { transform: rotate(-28deg); } }
.asodomi-chat-avatar .bot-flag { animation: asodomi-bot-flagwave 3s ease-in-out infinite; transform-origin: 50px 74px; }
@keyframes asodomi-bot-flagwave { 0%, 100% { transform: skewX(0deg); } 50% { transform: skewX(-6deg); } }
.asodomi-chat-title { font-weight: 700; font-size: 15px; line-height: 1.2; }
.asodomi-chat-status { font-size: 12px; opacity: .85; display: flex; align-items: center; gap: 5px; }
.asodomi-chat-status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #4caf50; display: inline-block; }
.asodomi-chat-close { margin-left: auto; background: none; border: none; color: #fff; font-size: 22px; cursor: pointer; line-height: 1; opacity: .8; }
.asodomi-chat-close:hover { opacity: 1; }
#asodomi-chat-messages { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: #f7f9fc; }
.asodomi-msg { max-width: 82%; padding: 10px 13px; border-radius: 14px; font-size: 14px; line-height: 1.45; word-wrap: break-word; }
.asodomi-msg.bot { background: #fff; color: #1b2a4a; border: 1px solid #e3e8f0; border-bottom-left-radius: 4px; align-self: flex-start; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.asodomi-msg.user { background: #0b3d91; color: #fff; border-bottom-right-radius: 4px; align-self: flex-end; }
.asodomi-msg a { color: #0b3d91; }
.asodomi-msg.user a { color: #fff; text-decoration: underline; }
.asodomi-typing { display: flex; gap: 4px; padding: 12px 14px; background: #fff; border: 1px solid #e3e8f0; border-radius: 14px; border-bottom-left-radius: 4px; align-self: flex-start; }
.asodomi-typing span { width: 7px; height: 7px; border-radius: 50%; background: #0b3d91; opacity: .4; animation: asodomi-blink 1.2s infinite; }
.asodomi-typing span:nth-child(2) { animation-delay: .2s; }
.asodomi-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes asodomi-blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.asodomi-suggestions { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 8px; background: #f7f9fc; }
.asodomi-suggestion {
  background: #fff; border: 1px solid #0b3d91; color: #0b3d91; border-radius: 20px;
  padding: 6px 12px; font-size: 13px; cursor: pointer; transition: all .15s;
}
.asodomi-suggestion:hover { background: #0b3d91; color: #fff; }
.asodomi-chat-input { display: flex; gap: 8px; padding: 12px 14px; background: #fff; border-top: 1px solid #e3e8f0; }
#asodomi-chat-text {
  flex: 1; border: 1px solid #d5dbe7; border-radius: 22px; padding: 10px 14px;
  font-size: 14px; outline: none; font-family: inherit; resize: none; max-height: 90px;
}
#asodomi-chat-text:focus { border-color: #0b3d91; }
#asodomi-chat-send {
  width: 42px; height: 42px; border-radius: 50%; border: none; cursor: pointer;
  background: #0b3d91; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
#asodomi-chat-send svg { width: 18px; height: 18px; fill: #fff; }
#asodomi-chat-send:disabled { opacity: .5; cursor: default; }
@media (max-width: 480px) {
  #asodomi-chat-panel { right: 10px; bottom: 86px; width: calc(100vw - 20px); max-height: calc(100vh - 100px); max-height: calc(100dvh - 100px); }
  #asodomi-chat-btn { right: 14px; bottom: 14px; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
}
