/* widget-frontend/styles/global.css */
body {
  margin: 0;
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
  background: linear-gradient(135deg, #eef2f7, #d9e2ec);
  color: #333;
  overflow-x: hidden;
}

/* Scrollbar mượt */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.35);
}
/* global.css */

/* Container chatbot */
.chat-widget-container {
  position: fixed;
  bottom: 16vh;
  right: 4vw;
  z-index: 999;
}

/* Nút mở chat */
.chat-widget-button {
  background: linear-gradient(135deg, #8e0ce9, #00c6ff);
  color: #fff;
  border-radius: 50%;

  border: none;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.3s ease;
  animation: pulse 2.5s infinite;
  font-size: 0.8rem;
}
.chat-widget-button:hover {
  transform: scale(1.25);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}
@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.07);
  }
}

/* Popup chat box */
.chat-widget-popup-wrapper {
  position: relative;
  overflow: visible;
  z-index: 9999;
}
.chat-widget-popup {
  width: 22vw;
  height: 72vh;
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  background: linear-gradient(180deg, #ffffff, #e6f7ff);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translateY(20px);
  /* Thêm border-bottom */
  border-bottom: 2px solid #0b74ff; /* đổi màu theo ý bạn */
  border-top: 2px solid #0b74ff; /* đổi màu theo ý bạn */
  opacity: 0;
  animation: slideIn 0.4s forwards;
}
@keyframes slideIn {
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Header */
.chat-widget-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  color: #fff;
  position: relative;
  /* overflow: hidden; */
  z-index: 10;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  /* background: linear-gradient(135deg, #092685, #34a9ec, #092685); */
}

.chat-widget-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-widget-header-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
}

.chat-widget-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}

.chat-widget-settings-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.chat-widget-settings-icon {
  cursor: pointer;
  color: #fff;
}

.chat-widget-settings-dropdown {
  position: absolute;
  top: 28px;
  right: 0;
  font-size: 0.85rem;
  background: #fff;
  color: #111;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  min-width: 150px;
  overflow: hidden;
  z-index: 1200;
}

.chat-widget-settings-item {
  padding: 10px 14px;
  cursor: pointer;
  transition: background 0.2s;
}

.chat-widget-settings-item:hover {
  background: rgba(0, 0, 0, 0.05);
}
/*close-button */
.chat-widget-close-button {
  background: transparent; /* trong suốt */
  border: none;
  color: #fff; /* icon màu trắng */
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  transition: all 0.2s ease;
}

.chat-widget-close-button:hover {
  color: #00f0ff; /* đổi màu khi hover */
  transform: scale(1.2); /* phóng to nhẹ khi hover */
}

/* Messages area */
.chat-widget-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;

  /* background: #fefefe; */
  background: linear-gradient(135deg, #f6f7f8, #ffffff);
}

/* Message bubble */

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
/* Wrapper mỗi tin nhắn */
.chat-widget-message-wrapper {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  width: 100%;
}

/* Bot: avatar bên trái, bubble bên phải */
.chat-widget-message-wrapper.bot {
  flex-direction: row;
  justify-content: flex-start;
}

/* User: avatar bên phải, bubble bên trái */
.chat-widget-message-wrapper.user {
  flex-direction: row-reverse;
  justify-content: flex-start;
}

/* Avatar */
.chat-widget-message-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}

/* Bubble message */
.chat-widget-message {
  position: relative; /* 🎯 BẮT BUỘC */
  overflow: visible; /* để wave ló ra ngoài */

  padding: 12px 18px;
  border-radius: 18px;

  max-width: 70%;
  word-wrap: break-word;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* Wave trên đầu */
.chat-widget-messages::before {
  content: "";
  position: absolute;
  top: -40px; /* kéo lên trên thành cạnh trên dạng sóng */
  left: 0;
  width: 100%;
  height: 40px; /* độ cao của wave */
  background-repeat: no-repeat;
  background-size: 100% 100%;

  /* SVG dạng sóng — fill = màu nền bên ngoài widget */
  background-image: url("data:image/svg+xml;utf8,\
  <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 40' preserveAspectRatio='none'>\
    <path d='M0,40 C240,0 480,0 720,20 C960,40 1200,20 1440,0 L1440,40 Z' fill='%23ffffff'/>\
  </svg>");
}
/* Bot bubble */
.chat-widget-message.bot {
  background: #e8e8e8;
  color: #f3eeee;
  border-bottom-left-radius: 6px;
  border-bottom-right-radius: 18px;
  background: linear-gradient(135deg, #2949da, #34578d);
}

/* User bubble */
.chat-widget-message.user {
  background: linear-gradient(135deg, rgb(129, 168, 219), #b1bde4);
  color: #fff;
  border-bottom-left-radius: 18px;
  border-bottom-right-radius: 6px;
}
/* Typing indicator */
.chat-widget-typing {
  font-style: italic;
  font-size: 0.9rem;
  color: #555;
  animation: blink 1s infinite;
}

@keyframes blink {
  0%,
  50%,
  100% {
    opacity: 1;
  }
  25%,
  75% {
    opacity: 0;
  }
}
/* Quick Action Buttons */
.chat-widget-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 14px;
  /* background: #ddcfcc; */
  /* border-top: 1px solid #ccc; */
  /* background: linear-gradient(135deg, #2142b1, #13376e); */
  /* —— Glass Blur —— */
  background: rgba(255, 255, 255, 0.25); /* lớp mờ */
  backdrop-filter: blur(12px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(190%);
  border-top: 1px solid rgba(189, 194, 235, 0.35);
  border-bottom: 1px solid rgba(191, 188, 238, 0.15);
}
.quick-action-button {
  /* background: linear-gradient(135deg, #cfd3d8, #500b5eda, #2a6dd3);  */
  color: #2737ca;
  border: 1px solid rgba(30, 115, 184, 0.6); /* viền glow */
  border-radius: 20px;
  padding: 10px 16px;
  font-size: 0.6rem; /* tăng size dễ nhìn */
  cursor: pointer;
  font-weight: bold;
  transition: all 0.3s ease, transform 0.2s ease;
  box-shadow: 0 0 8px rgba(22, 42, 218, 0.6), 0 2px 12px rgba(0, 0, 0, 0.15);
}

/* hover hiệu ứng glow mạnh hơn */
.quick-action-button:hover {
  transform: scale(1.05);
  box-shadow: 0 0 14px rgba(60, 30, 190, 0.9),
    0 4px 18px rgba(202, 173, 211, 0.2);
  background: linear-gradient(
    135deg,
    #1932c4,
    #1249af,
    #1426ca
  ); /* sáng hơn khi hover */
  color: #ffff;
  font-weight: bold;
}
/* ------------------------------Input area ----------------------------------*/
.chat-widget-input-wrapper {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  align-content: center;
  gap: 10px;
  padding: 1rem 1.2rem;
  border-top: 1px solid #ebe5ee;
  box-shadow: 0 0 18px rgba(132, 145, 146, 0.5);
  background: linear-gradient(135deg, #ffffff, #ffffff, #ffffff);
  height: 14vh;
}

.chat-widget-input-text {
  /* position: relative;
    top:2.6vh;
    left: 3.3vw; */
  margin-left: 3.2rem;
  margin-top: 0.3rem;
  /* padding: 1rem 1rem; */
  /* border-radius: 20px; */
  border: 0.2px solid #ffffff;
  outline: none;
  font-size: 1rem;
  transition: all 0.3s ease;
  max-width: 14vw;
  padding: 0.6rem 1rem;
}

.chat-widget-input-text:focus {
  box-shadow: 0 0 0 3px rgba(11, 116, 255, 0.25);
}
.chat-widget-input button {
  /* background: linear-gradient(135deg, #0b74ff, #00e0ff); */
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 5px 10px;
  cursor: pointer;
  font-weight: 600;

  transition: all 0.3s ease, transform 0.2s ease;
}
.chat-widget-button-img {
  background: transparent;
  border: none;
  width: 2rem;
  height: 2rem;
  box-shadow: none;
  animation: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.chat-widget-input button:hover {
  transform: scale(1.1);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
}
/*Send Button */

.chat-widget-send-button {
  align-self: flex-end;
  background: linear-gradient(135deg, #0b74ff, #00d4ff);
  border: none;
  border-radius: 50%;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  cursor: pointer;
  transition: all 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
  box-shadow: 0 0 12px rgba(11, 116, 255, 0.6);
  position: absolute;
  bottom: 9.2vh;
  left: 21vw;
  z-index: 2000;
  animation: heartbeat 1.8s infinite;
}

.chat-widget-send-button:hover {
  transform: scale(1.2);
  box-shadow: 0 0 24px rgba(11, 116, 255, 0.9), 0 0 60px rgba(11, 116, 255, 0.3);
}

@keyframes heartbeat {
  0%,
  100% {
    transform: scale(1);
  }
  25% {
    transform: scale(1.1);
  }
  50% {
    transform: scale(1.2);
  }
  75% {
    transform: scale(1.1);
  }
}

/* Shock wave (vòng sáng lan tỏa) */
.chat-widget-send-button::after {
  content: "";
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  top: 0;
  left: 0;
  background: rgba(11, 116, 255, 0.3);
  animation: shockwave 1.8s infinite;
  z-index: -1;
}

@keyframes shockwave {
  0% {
    transform: scale(0.8);
    opacity: 0.7;
  }
  70% {
    transform: scale(2.2);
    opacity: 0;
  }
  100% {
    transform: scale(2.2);
    opacity: 0;
  }
}

/* Icon file + emoji nằm dưới input */
.chat-widget-input-bottom-icons {
  display: flex;
  gap: 12px;
  justify-content: flex-start;
  margin: 0 auto;
  margin-top: 0.2rem;
}
/* File button */
.chat-widget-file-button {
  cursor: pointer;
  display: flex;
  align-items: center;
  color: #797a7a;
  justify-content: center;
  transition: all 0.3s ease;
  margin-top: 1vh;
}
.chat-widget-file-button:hover {
  transform: scale(1.1);
}

/* Emoji button */
.chat-widget-smile-button {
  background: transparent; /* hoặc màu bạn muốn */
  border: none; /* nếu muốn */
  color: #797a7a; /* màu icon */
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 1vh;
}
.chat-widget-smile-button:hover {
  transform: scale(1.1);
}
.chat-widget-emoji-picker {
  position: absolute;
  bottom: 7rem; /* cách input 1 khoảng */
  left: -12rem;
  z-index: 1100;
  transform: scale(0.8);
  transform-origin: bottom left; /* picker mở từ trái */
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  border-radius: 12px;
}
.chat-widget-emoji-picker.right {
  right: 0;
  /* left: 2vw; */
  transform-origin: bottom right;
}
/* Powered by HomeNest */
.chat-widget-powered {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #949191ff;

  margin: 0 auto;
  margin-top: 1.2rem;
  margin-bottom: 0.2rem;
  font-weight: bold;
  gap: 4px;
}

.chat-widget-powered img {
  width: 16px;
  height: 16px;
  object-fit: contain;
}
/* ================= MOBILE RESPONSIVE ================= */
@media (max-width: 1400px) {

  /* Container chiếm toàn màn hình */
  .chat-widget-container {
    position: fixed;
    inset: 0;
    left: 10;
    bottom: 0;
    z-index: 9999;
  }
.chat-widget-popup {
  width: 100vw;
  height: 100vh;
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  background: linear-gradient(180deg, #ffffff, #e6f7ff);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translateY(20px);
  /* Thêm border-bottom */
  border-bottom: 2px solid #0b74ff; /* đổi màu theo ý bạn */
  border-top: 2px solid #0b74ff; /* đổi màu theo ý bạn */
  opacity: 0;
  animation: slideIn 0.4s forwards;
}

.chat-widget-send-button {
  align-self: flex-end;
  background: linear-gradient(135deg, #0b74ff, #00d4ff);
  border: none;
  border-radius: 50%;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  cursor: pointer;
  transition: all 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
  box-shadow: 0 0 12px rgba(11, 116, 255, 0.6);
  position: absolute;
  bottom: 9.2vh;
  left: 81vw;
  z-index: 2000;
  animation: heartbeat 1.8s infinite;
}
  /* Powered by HomeNest */
.chat-widget-powered {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #949191ff;

  margin: 0 auto;
  margin-top: 0.2rem;
  margin-bottom: 0.8rem;
  font-weight: bold;
  gap: 4px;
}
.chat-widget-input-text {

  margin-left: 2.2rem;
  margin-top: 0.3rem;
  border: 0.2px solid #ffffff;
  outline: none;
  font-size: 1rem;
  transition: all 0.3s ease;
  max-width: 44vw;
  padding: 0.6rem 1rem;
}
}
@media (max-width: 992px) {

  /* Container chiếm toàn màn hình */
  .chat-widget-container {
    position: fixed;
    inset: 0;
    left: 10;
    bottom: 0;
    z-index: 9999;
  }
.chat-widget-popup {
  width: 100vw;
  height: 100vh;
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  background: linear-gradient(180deg, #ffffff, #e6f7ff);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translateY(20px);
  /* Thêm border-bottom */
  border-bottom: 2px solid #0b74ff; /* đổi màu theo ý bạn */
  border-top: 2px solid #0b74ff; /* đổi màu theo ý bạn */
  opacity: 0;
  animation: slideIn 0.4s forwards;
}

.chat-widget-send-button {
  align-self: flex-end;
  background: linear-gradient(135deg, #0b74ff, #00d4ff);
  border: none;
  border-radius: 50%;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  cursor: pointer;
  transition: all 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
  box-shadow: 0 0 12px rgba(11, 116, 255, 0.6);
  position: absolute;
  bottom: 9.2vh;
  left: 81vw;
  z-index: 2000;
  animation: heartbeat 1.8s infinite;
}
  /* Powered by HomeNest */
.chat-widget-powered {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #949191ff;

  margin: 0 auto;
  margin-top: 0.2rem;
  margin-bottom: 0.8rem;
  font-weight: bold;
  gap: 4px;
}
.chat-widget-input-text {

  margin-left: 2.2rem;
  margin-top: 0.3rem;
  border: 0.2px solid #ffffff;
  outline: none;
  font-size: 1rem;
  transition: all 0.3s ease;
  max-width: 44vw;
  padding: 0.6rem 1rem;
}
}
@media (max-width: 768px) {

  /* Container chiếm toàn màn hình */
  .chat-widget-container {
    position: fixed;
    inset: 0;
    left: 10;
    bottom: 0;
    z-index: 9999;
  }
.chat-widget-popup {
  width: 100vw;
  height: 100vh;
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  background: linear-gradient(180deg, #ffffff, #e6f7ff);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translateY(20px);
  /* Thêm border-bottom */
  border-bottom: 2px solid #0b74ff; /* đổi màu theo ý bạn */
  border-top: 2px solid #0b74ff; /* đổi màu theo ý bạn */
  opacity: 0;
  animation: slideIn 0.4s forwards;
}

.chat-widget-send-button {
  align-self: flex-end;
  background: linear-gradient(135deg, #0b74ff, #00d4ff);
  border: none;
  border-radius: 50%;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  cursor: pointer;
  transition: all 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
  box-shadow: 0 0 12px rgba(11, 116, 255, 0.6);
  position: absolute;
  bottom: 9.2vh;
  left: 81vw;
  z-index: 2000;
  animation: heartbeat 1.8s infinite;
}
  /* Powered by HomeNest */
.chat-widget-powered {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #949191ff;

  margin: 0 auto;
  margin-top: 0.2rem;
  margin-bottom: 0.8rem;
  font-weight: bold;
  gap: 4px;
}
.chat-widget-input-text {

  margin-left: 2.2rem;
  margin-top: 0.3rem;
  border: 0.2px solid #ffffff;
  outline: none;
  font-size: 1rem;
  transition: all 0.3s ease;
  max-width: 44vw;
  padding: 0.6rem 1rem;
}
}
@media (max-width: 576px) {

  /* Container chiếm toàn màn hình */
  .chat-widget-container {
    position: absolute;
    margin: "0 auto";
    z-index: 9999;
  }
.chat-widget-popup {
  width: 90vw;
  height: 90vh;
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  background: linear-gradient(180deg, #ffffff, #e6f7ff);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translateY(20px);
  /* Thêm border-bottom */
  border-bottom: 2px solid #0b74ff; /* đổi màu theo ý bạn */
  border-top: 2px solid #0b74ff; /* đổi màu theo ý bạn */
  opacity: 0;
  animation: slideIn 0.4s forwards;
}

.chat-widget-send-button {
  align-self: flex-end;
  background: linear-gradient(135deg, #0b74ff, #00d4ff);
  border: none;
  border-radius: 50%;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  cursor: pointer;
  transition: all 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
  box-shadow: 0 0 12px rgba(11, 116, 255, 0.6);
  position: absolute;
  bottom: 9.2vh;
  left: 81vw;
  z-index: 2000;
  animation: heartbeat 1.8s infinite;
}
  /* Powered by HomeNest */
.chat-widget-powered {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #949191ff;

  margin: 0 auto;
  margin-top: 0.2rem;
  margin-bottom: 0.8rem;
  font-weight: bold;
  gap: 4px;
}
.chat-widget-input-text {

  margin-left: 2.2rem;
  margin-top: 0.3rem;
  border: 0.2px solid #ffffff;
  outline: none;
  font-size: 1rem;
  transition: all 0.3s ease;
  max-width: 44vw;
  padding: 0.6rem 1rem;
}
}
@media (max-width: 300px) {

  /* Container chiếm toàn màn hình */
  .chat-widget-container {
display: none;
  }
.chat-widget-popup {
display: none;
}

}