/* ── ARIS Chat Widget ── */
#aris-widget {
  position: fixed;
  bottom: 8px;
  right: 24px;
  z-index: 9998;
  font-family: 'Inter', sans-serif;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}
#aris-widget.panel-open #aris-trigger {
  display: none;
}

/* ── Hover preview (mascote completo + balão) ── */
#aris-hover {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin-bottom: 6px;
  opacity: 0;
  transform: translateY(10px) scale(.96);
  pointer-events: none;
  transition: opacity .28s ease, transform .32s cubic-bezier(.34,1.4,.64,1);
}
#aris-widget:not(.panel-open):hover #aris-hover {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: none;
}

/* Balão de fala */
#aris-bubble-hint {
  background: white;
  border-radius: 14px 14px 0 14px;
  padding: 10px 16px;
  font-size: 13.5px;
  font-weight: 600;
  color: #1E293B;
  white-space: nowrap;
  box-shadow: 0 4px 20px rgba(0,0,0,.13);
  position: relative;
  margin-bottom: 22px;
}
#aris-bubble-hint::after {
  content: '';
  position: absolute;
  bottom: -10px;
  right: 14px;
  border: 5px solid transparent;
  border-top-color: white;
  border-right-color: white;
}

/* Mascote completo no hover */
#aris-hover-img {
  width: 120px;
  filter: drop-shadow(0 6px 16px rgba(21,101,192,.18));
}

/* ── Trigger (cabeça) ── */
#aris-trigger {
  width: 152px;
  height: 152px;
  border-radius: 0;
  overflow: visible;
  background: transparent;
  border: 0;
  box-shadow: none;
  cursor: pointer;
  position: relative;
  padding: 0;
  flex-shrink: 0;
  filter: drop-shadow(0 16px 26px rgba(0,64,150,.28));
  transition: transform .2s, filter .2s;
}
#aris-trigger:hover {
  transform: scale(1.03);
  filter: drop-shadow(0 18px 30px rgba(0,64,150,.34));
}
#aris-trigger img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  transition: opacity .18s ease, transform .22s ease;
}
/* Badge de notificação */
#aris-badge {
  position: absolute;
  top: 0;
  right: 0;
  width: 14px;
  height: 14px;
  background: #EF4444;
  border-radius: 50%;
  border: 2px solid white;
  display: none;
  z-index: 1;
}
#aris-badge.visible { display: block; }

/* ── Panel de chat ── */
#aris-panel {
  position: fixed;
  bottom: 104px;
  right: 24px;
  width: 360px;
  max-height: 580px;
  background: white;
  border-radius: 20px;
  box-shadow: 0 12px 48px rgba(0,0,0,.16);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(16px) scale(.97);
  opacity: 0;
  pointer-events: none;
  transition: transform .3s cubic-bezier(.34,1.56,.64,1), opacity .25s ease;
}
#aris-panel.open {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: all;
}

/* Header */
#aris-header {
  background: linear-gradient(135deg, #1565C0 0%, #0D47A1 100%);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
#aris-header-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: white;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
#aris-header-avatar img {
  width: 140%;
  object-fit: contain;
  transition: opacity .3s, transform .3s;
}
#aris-header-info { flex: 1; }
#aris-header-info strong { display: block; color: white; font-size: 15px; font-weight: 700; }
#aris-header-info span  { font-size: 12px; color: rgba(255,255,255,.75); }
#aris-header-status {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #4ADE80;
  margin-right: 4px;
}
#aris-close {
  background: none; border: none; cursor: pointer;
  color: rgba(255,255,255,.8); padding: 4px; border-radius: 6px; line-height: 1;
  transition: color .15s;
}
#aris-close:hover { color: white; }
#aris-close svg { display: block; width: 18px; height: 18px; }

/* Messages */
#aris-messages {
  flex: 1; overflow-y: auto;
  padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
  background: #F8FAFC;
  scroll-behavior: smooth;
}
#aris-messages::-webkit-scrollbar { width: 4px; }
#aris-messages::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 2px; }

/* Bubbles */
.aris-bubble { display: flex; gap: 8px; align-items: flex-end; max-width: 88%; }
.aris-bubble.user { align-self: flex-end; flex-direction: row-reverse; }
.aris-bubble.bot  { align-self: flex-start; }

.aris-bubble-mini-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: white; border: 1px solid #E2E8F0;
  overflow: hidden; flex-shrink: 0;
  display: flex; align-items: flex-end; justify-content: center;
}
.aris-bubble-mini-avatar img { width: 150%; object-fit: contain; }

.aris-bubble-text {
  padding: 10px 14px; border-radius: 16px;
  font-size: 13.5px; line-height: 1.55; word-break: break-word;
}
.aris-bubble.bot .aris-bubble-text {
  background: white; color: #1E293B;
  border: 1px solid #E2E8F0; border-bottom-left-radius: 4px;
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.aris-bubble.user .aris-bubble-text {
  background: #1565C0; color: white; border-bottom-right-radius: 4px;
}

/* Typing */
.aris-typing {
  display: flex; gap: 5px; align-items: center;
  padding: 12px 16px;
  background: white; border: 1px solid #E2E8F0;
  border-radius: 16px; border-bottom-left-radius: 4px;
  width: fit-content; box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.aris-typing span {
  width: 7px; height: 7px; border-radius: 50%;
  background: #94A3B8; animation: arisBounce 1.2s infinite;
}
.aris-typing span:nth-child(2) { animation-delay: .2s; }
.aris-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes arisBounce {
  0%,60%,100% { transform: translateY(0); opacity: .6; }
  30%          { transform: translateY(-6px); opacity: 1; }
}

/* WhatsApp CTA */
.aris-whatsapp-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: #22C55E; color: white; text-decoration: none;
  padding: 10px 16px; border-radius: 12px;
  font-size: 13.5px; font-weight: 600; margin-top: 6px;
  transition: background .2s;
}
.aris-whatsapp-btn:hover { background: #16A34A; }

/* Input */
#aris-footer {
  padding: 12px 14px; background: white;
  border-top: 1px solid #E2E8F0;
  display: flex; align-items: flex-end; gap: 8px; flex-shrink: 0;
}
#aris-input {
  flex: 1; border: 1px solid #E2E8F0; border-radius: 12px;
  padding: 9px 13px; font-size: 13.5px; font-family: 'Inter', sans-serif;
  resize: none; max-height: 96px; outline: none; line-height: 1.45;
  color: #1E293B; transition: border-color .2s;
}
#aris-input:focus { border-color: #1565C0; }
#aris-input::placeholder { color: #94A3B8; }
#aris-send {
  width: 40px; height: 40px; border-radius: 50%;
  background: #1565C0; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: background .2s, transform .1s;
}
#aris-send:hover  { background: #0D47A1; }
#aris-send:active { transform: scale(.93); }
#aris-send:disabled { background: #CBD5E1; cursor: default; }
#aris-send svg { display: block; width: 17px; height: 17px; fill: white; }

/* Mobile */
@media (max-width: 480px) {
  #aris-panel {
    right: 0; bottom: 0; width: 100vw;
    max-height: 88vh; border-radius: 20px 20px 0 0;
  }
  #aris-widget { bottom: 8px; right: 16px; }
  #aris-hover  { display: none; }
}
