body {
  font-family: Arial, sans-serif;
  background: #f2f2f2;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  margin: 0;
}

.chat-container {
  width: 450px;
  height: 650px; /* To sẵn khung chat */
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
  display: flex;
  flex-direction: column;
}

.chat-header {
  background: #007bff;
  color: white;
  padding: 14px;
  text-align: center;
  border-radius: 12px 12px 0 0;
  font-weight: bold;
}

.chat-box {
  flex: 1;
  padding: 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.message {
  margin: 8px 0;
  max-width: 75%;
  padding: 10px 14px;
  border-radius: 12px;
  line-height: 1.4;
  word-wrap: break-word;
}

/* User (bên phải, xanh) */
.user {
  background: #007bff;
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 2px;
}

/* Bot (bên trái, xám) */
.bot {
  background: #e9e9eb;
  color: #000;
  align-self: flex-start;
  border-bottom-left-radius: 2px;
}

.bot-line {
  margin-bottom: 6px;
}

.chat-input {
  display: flex;
  border-top: 1px solid #ddd;
}

.chat-input input {
  flex: 1;
  border: none;
  padding: 12px;
  font-size: 14px;
  border-radius: 0 0 0 12px;
  outline: none;
}

.chat-input button {
  background: #007bff;
  border: none;
  color: white;
  padding: 0 18px;
  cursor: pointer;
  border-radius: 0 0 12px 0;
  font-size: 14px;
}

.typing {
  font-style: italic;
  color: #666;
  font-size: 14px;
  animation: blinkText 1.5s infinite;
}

@keyframes blinkText {
  0% { opacity: 0.2; }
  50% { opacity: 1; }
  100% { opacity: 0.2; }
}
.chat-box {
  flex: 1;
  padding: 12px;
  overflow-y: auto;       /* Cho phép cuộn dọc */
  overflow-x: hidden;     /* Không cho cuộn ngang */
  display: flex;
  flex-direction: column;
  scroll-behavior: smooth; /* Cuộn mượt */
}

/* Tuỳ chỉnh thanh cuộn (scrollbar) */
.chat-box::-webkit-scrollbar {
  width: 8px;   /* Độ rộng scrollbar */
}

.chat-box::-webkit-scrollbar-track {
  background: #f1f1f1; 
  border-radius: 10px;
}

.chat-box::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 10px;
}

.chat-box::-webkit-scrollbar-thumb:hover {
  background: #888; /* Khi hover chuột vào thanh cuộn */
}
