/* Chat toggle button — chỉ thêm animation, không đè vị trí/style từ huflit.css */
#chat-toggle-btn {
  animation: bounceChat 1.5s infinite ease-in-out;
}

#chat-toggle-btn img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.chat-label {
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  text-align: center;
}

/* Khung chat AI — toàn màn hình giữa */
#chat-widget-container {
  position: fixed;
  bottom: 170px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 700px;
  max-height: 90vh;
  overflow: hidden;
  z-index: 9998;
  display: none;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

elevenlabs-convai {
  width: 100%;
  height: 100%;
  display: block;
}

#chat-close-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.3);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  font-size: 20px;
  cursor: pointer;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: background 0.2s;
}

#chat-close-btn:hover {
  background: rgba(0, 0, 0, 0.55);
}

@keyframes bounceChat {
  0%, 100% { transform: translateY(0); }
  30%       { transform: translateY(-5px); }
  60%       { transform: translateY(3px); }
}

/* Tablet ≤ 640px: thu nhỏ widget, không full screen */
@media (max-width: 640px) {
  #chat-widget-container {
    width: calc(100vw - 32px);
    left: 16px;
    transform: none;
    bottom: 90px;
    height: 75vh;
    border-radius: 12px;
  }
}

/* Phone ≤ 480px: widget full-width bám đáy, button sát mép */
@media (max-width: 480px) {
  #chat-widget-container {
    width: 100%;
    left: 0;
    transform: none;
    bottom: 0;
    height: 90vh;
    border-radius: 12px 12px 0 0;
  }

  #chat-toggle-btn {
    right: 14px;
    bottom: 85px;
  }
}
