.wp-aichat-widget {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 290px;
    height: 420px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 5px 40px rgba(0, 0, 0, 0.16);
    display: flex;
    flex-direction: column;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
}

.wp-aichat-widget.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

.wp-aichat-header {
    padding: 10px 16px;
    background: var(--wp-aichat-theme-color, #007bff);
    color: #fff;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 8px;
}

.wp-aichat-logo {
    width: 24px;
    height: 24px;
    max-width: 24px;
    max-height: 24px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 4px;
}

.wp-aichat-logo img {
    width: 24px;
    height: 24px;
    max-width: 24px;
    max-height: 24px;
    object-fit: cover;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    display: block;
}

.wp-aichat-title {
    font-weight: 600;
    font-size: 14px;
    flex-grow: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
    padding: 0;
}

.wp-aichat-minimize {
    background: none;
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
    transition: opacity 0.2s;
    flex-shrink: 0;
}

.wp-aichat-minimize:hover {
    opacity: 1;
}

.wp-aichat-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #f8f9fa;
}

.wp-aichat-messages {
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-wrap: anywhere;
}

.wp-aichat-message {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
}

.wp-aichat-message-bot {
    align-self: flex-start;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.wp-aichat-message-user {
    align-self: flex-end;
    background: var(--wp-aichat-theme-color, #007bff);
    color: #fff;
}

.wp-aichat-footer {
    padding: 16px;
    background: #fff;
    border-top: 1px solid #eee;
    border-radius: 0 0 12px 12px;
}

.wp-aichat-form {
    display: flex;
    gap: 8px;
}

.wp-aichat-input {
    flex: 1;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 24px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.wp-aichat-input:focus {
    border-color: var(--wp-aichat-theme-color, #007bff);
}

.wp-aichat-send {
  border: none;
  background: none; /* bỏ nền */
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  transition: transform 0.2s ease;
  color: #8CB100; 
}

.wp-aichat-send:hover {
     background: none;
  color: #5e7703; /* đổi màu khi hover */
  transform: scale(1.1);
}

.wp-aichat-send svg {
  width: 22px;
  height: 22px;
}



.wp-aichat-toggle {
  position: fixed;
  bottom: 20px;   
  right: 15px;    /* cách mép phải 20px */
  z-index: 9999;  /* nổi trên cùng */
  
  display: inline-flex;
  align-items: center;
  gap: 6px;

  background: #f68733;
  color: #fff;
  border: none;
  border-radius: 30px;
  padding: 14px 18px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;

  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  transition: background 0.3s, transform 0.2s;
}
.wp-aichat-toggle:hover {
  transform: scale(1.05);
}

.wp-aichat-toggle .icon {
  display: flex;
  align-items: center;
}
.wp-aichat-toggle svg {
  width: 20px;
  height: 20px;
}
/* Khi bật on */
.wp-aichat-toggle.active {
  background: #eca60f; 
}



/* Loading animation */
.wp-aichat-typing {
    display: flex;
    gap: 3px;
    padding: 8px 12px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    align-self: flex-start;
}

.wp-aichat-typing span {
    width: 6px;
    height: 6px;
    background: #ccc;
    border-radius: 50%;
    animation: wp-aichat-typing 1s infinite ease-in-out;
}

.wp-aichat-typing span:nth-child(2) {
    animation-delay: 0.2s;
}

.wp-aichat-typing span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes wp-aichat-typing {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-4px);
    }
} 