    /* Cài đặt chung cho widget chat */
.chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 350px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    z-index: 1000;
    font-family: system-ui, -apple-system, sans-serif;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
}

.chat-widget.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

.chat-icon {
    position: fixed;
    bottom: 140px;
    right: 20px;
    width: 80px; /* Size of the icon */
    height: 80px; /* Size of the icon */
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
    transition: all 0.3s ease;
    animation: shake 5s ease-in-out infinite;
}

.chat-icon img {
    width: 100px;  /* Half the size of the container */
    height: 100px; /* Half the size of the container */
    object-fit: contain; /* Keeps the aspect ratio */
}



.chat-icon:hover {
    transform: scale(1.05);
    background: #4338CA;
}

.chat-icon.hidden {
    display: none;
}

.chat-close-icon {
    position: absolute;
    right: 16px;
    cursor: pointer;
    color: white;
    font-size: 20px;
}

.chat-header {
    padding: 16px;
    background: #4e888d;
    color: white;
    border-radius: 16px 16px 0 0;
    display: flex;
    align-items: center;
    font-weight: 600;
}

.chat-content {
    height: 450px;
    display: flex;
    flex-direction: column;
}

.messages {
    flex-grow: 1;
    overflow-y: auto;
    padding: 16px;
    scroll-behavior: smooth;
}

.messages::-webkit-scrollbar {
    width: 6px;
}

.messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.messages::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.input-area {
    padding: 16px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 8px;
    background: #f8f9fa;
    border-radius: 0 0 16px 16px;
}

.input-area input {
    flex: 1;
    padding: 12px;
    border: 1px solid #4e888d;
    border-radius: 8px;
    outline: none;
    font-size: 16px; /* Set the font-size to 16px or more to prevent zooming on iOS */
    transition: border-color 0.2s;
    -webkit-text-size-adjust: 100%; /* Prevents automatic zoom on iOS */
}


.input-area input:focus {
    border-color: #4F46E5;
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.1);
}

.input-area button {
    padding: 8px 16px;
    background: #4e888d;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s;
}

.input-area button:hover {
    background: #4338CA;
}

.message {
    margin: 8px 0;
    padding: 12px;
    border-radius: 12px;
    max-width: 80%;
    word-wrap: break-word;
    position: relative;
    animation: messageSlide 0.3s ease;
}

@keyframes messageSlide {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.user-message {
    background: #4e888d;
    color: white;
    margin-left: auto;
    border-bottom-right-radius: 4px;
}

.bot-message {
    background: #f3f4f6; /* Màu nền */
    color: #1f2937; /* Màu chữ */
    margin-right: auto; /* Để căn sang trái */
    border-bottom-left-radius: 4px; /* Bo góc dưới bên trái */
    padding: 10px 15px; /* Tăng khoảng cách bên trong */
    max-width: 90%; /* Tăng độ rộng tối đa của tin nhắn */
    word-wrap: break-word; /* Đảm bảo xuống dòng nếu quá dài */
    display: inline-block; /* Giới hạn kích thước theo nội dung */
}


.bot-message a {
    color: #4F46E5;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.bot-message a:hover {
    color: #4338CA;
    text-decoration: underline;
}

.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px;
    background: #f3f4f6;
    border-radius: 12px;
    margin-right: auto;
    width: fit-content;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: #9ca3af;
    border-radius: 50%;
    animation: typingAnimation 1.4s infinite;
}


/* Cài đặt cho thiết bị nhỏ */
@media (max-width: 600px) {
    .chat-widget {
        bottom: 10px;
        right: 10px;
        width: calc(100% - 20px);
        border-radius: 12px;
        box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
    }

    .chat-header {
        font-size: 14px;
        padding: 12px;
    }

    .chat-content {
        margin-bottom: 20px;
    }

    .messages {
        padding: 12px;
    }

    .input-area {
        padding: 12px;
        gap: 6px;
    }

    .input-area input {
        font-size: 16px;
        padding: 10px;
        width: 100%;
        box-sizing: border-box;
    }

    .input-area button {
        padding: 8px 12px;
        font-size: 13px;
    }

    .chat-icon {
        bottom: 140px;
        right: 20px;
        width: 40px;
        height: 40px;
    }

    .message {
        padding: 10px;
        font-size: 13px;
        max-width: 90%;
    }

    .user-message, .bot-message {
        border-radius: 8px;
    }

    .typing-indicator {
        padding: 10px;
        gap: 3px;
    }

    .typing-dot {
        width: 5px;
        height: 5px;
    }
}

@keyframes shake {
    0%, 15% { transform: rotate(0deg); }
    20% { transform: rotate(-10deg); }
    25% { transform: rotate(0deg); }
    30% { transform: rotate(10deg); }
    35%, 100% { transform: rotate(0deg); }
}

    .blog-results {
    font-family: Arial, sans-serif;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-width: 100%;
}
