#aico-chatbot-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    color: #fff;
    font-size: 24px;
    line-height: 60px;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    display: flex; 
    justify-content: center;
    align-items: center;
}

#aico-chatbot-toggle .dashicons {
    font-size: 24px;
    line-height: 1;
    width: 24px;
    height: 24px;
}

#aico-chatbot-popup {
    display: none !important;
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 350px;
    height: 450px;
    background: #fff;
    border: 1px solid;
    border-radius: 10px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    flex-direction: column;
    z-index: 9999;
    overflow: hidden;
    max-width: calc(100% - 40px);
}

#aico-chatbot-popup.is-open {
    display: flex !important;
}

#aico-chatbot-popup.is-fullscreen {
    width: 100vw !important;
    height: 100vh !important;
    max-width: none !important;
    max-height: none !important;
    bottom: 0 !important;
    right: 0 !important;
    border-radius: 0 !important;
}

#aico-chatbot-header {
    padding: 10px;
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 18px;
}

.aico-header-info {
    display: flex;
    align-items: center;
}

.aico-bot-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    margin-right: 10px;
	border: 1px solid #ccc;
}

.aico-header-actions {
    display: flex;
    gap: 5px;
}

#aico-chatbot-maximize,
#aico-chatbot-close {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    font-weight: bold;
    font-size: 16px;
    padding: 0 5px;
}

#aico-chatbot-body {
    flex-grow: 1;
    padding: 15px;
    overflow-y: auto;
    background: #f7f9fb;
}

/* Cấu trúc chung của tin nhắn */
.aico-message {
    margin-bottom: 15px;
    display: flex;
    align-items: flex-start;
}

/* Tin nhắn Bot */
.aico-bot-message {
    justify-content: flex-start;
    flex-direction: column; 
    align-items: flex-start;
}

/* Header của Tin nhắn Bot (Chứa Avatar và Tên) */
.aico-bot-header {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
    margin-left: 0; /* Đảm bảo không có margin trái không cần thiết */
}

/* Định dạng tên Chatbot */
.aico-bot-header .aico-bot-name {
    font-size: 13px;
    font-weight: 600;
    color: #333;
}

/* Avatar trong tin nhắn */
.aico-message-avatar {
    width: 25px; 
    height: 25px;
    border-radius: 50%;
    margin-right: 5px;
    flex-shrink: 0;
    border: 1px solid #ccc;
}

/* Style cho Dashicon mặc định */
.aico-default-avatar {
    background-color: #eee;
    display: flex !important;
    justify-content: center;
    align-items: center;
    font-size: 16px !important;
}

/* Căn chỉnh nội dung bong bóng để thẳng hàng với header bot */
.aico-bot-message .aico-message-content {
    display: flex;
    flex-direction: column;
}

/* Tin nhắn User (Đảo vị trí: Content trước Avatar) */
.aico-user-message {
    justify-content: flex-end;
}

.aico-user-message .aico-message-content {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
	width: 100%;
}

/* Tin nhắn khởi tạo không cần căn chỉnh đặc biệt */
.aico-initial-message {
    align-items: flex-end;
    margin-bottom: 20px;
}

.aico-initial-message .aico-message-content {
    margin-left: 0;
}

.aico-message-bubble {
    padding: 8px 12px;
    border-radius: 15px;
    max-width: 90%;
    font-size: 14px;
    word-wrap: break-word;
}

.aico-bot-message .aico-message-bubble {
    background: #e5e5ea;
    color: #000;
    border-top-left-radius: 0;
	box-sizing: content-box;
}

.aico-user-message .aico-message-bubble {
    background: #0073AA;
    color: #fff;
    border-top-right-radius: 0;
}
.aico-message-bubble {
  display: flex;
  gap: 6px;
  align-items: center;
}

.dot {
  width: 4px;
  height: 4px;
  background: #999;
  border-radius: 50%;
  animation: bounce 1.4s infinite ease-in-out;
}

.dot:nth-child(1) { animation-delay: 0s; }
.dot:nth-child(2) { animation-delay: 0.2s; }
.dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce {
  0%, 80%, 100% {
    transform: scale(0);
    opacity: 0.3;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Thời gian */
.aico-message-time {
    font-size: 10px;
    color: #999;
    margin-top: 2px;
}

.aico-user-message .aico-message-time {
    text-align: right;
}

.aico-predefined-questions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
    justify-content: center;
    margin-bottom: 1rem;
}

.aico-predefined-questions .aico-predefined-q-btn {
    background-color: #e0e0e0;
    border: none;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.aico-predefined-questions .aico-predefined-q-btn:hover {
    background-color: #d0d0d0;
}

#aico-chatbot-footer {
    display: flex;
    padding: 10px;
    border-top: 1px solid #ddd;
    background-color: #fff;
}

#aico-user-input {
    flex-grow: 1;
    border: 1px solid #ccc;
    border-radius: 20px;
    padding: 10px 15px;
    font-size: 14px;
    outline: none;
}

#aico-user-input:focus {
    border-color: #0073AA;
}

#aico-send-btn {
    background-color: #0073AA;
    border: none;
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-left: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

#aico-send-btn:hover:not(:disabled) {
    opacity: 0.9;
}

#aico-send-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}
