﻿/* ===== ICON BONG BÓNG ===== */
#chatbot-bubble {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 65px;
    height: 65px;
    background: #007bff;
    color: white;
    border-radius: 50%;
    font-size: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    transition: 0.25s;
    z-index: 9999;
    animation: bubbleFloat 3s ease-in-out infinite;
}
#chatbot-bubble img {
    width: 35px;
    height: 35px;
}

#chatbot-bubble:hover {
    transform: scale(1.12);
    background: #005fcc;
}

/* Hiệu ứng bong bóng nổi */
@keyframes bubbleFloat {
    0% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
    100% { transform: translateY(0); }
}


/* ===== KHUNG CHAT ===== */
#chatbot-window {
    position: fixed;
    bottom: 110px;
    right: 25px;
    width: 350px;
    height: 420px;
    background: white;
   
    box-shadow: 0 10px 35px rgba(0,0,0,0.25);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 99999;
    
    opacity: 0;
    transform: translateY(30px);
    transition: 0.35s ease;
}

#chatbot-window.active {
    display: flex !important;
    opacity: 1;
    transform: translateY(0);
}


/* ===== HEADER ===== */
.chat-header {
    background: linear-gradient(135deg, #007bff, #0056d6);
    color: white;
    padding: 14px 15px;
    font-size: 17px;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.close-btn {
    font-size: 22px;
    cursor: pointer;
    transition: 0.2s;
}

.close-btn:hover {
    color: #ffcccc;
}


/* ===== BODY ===== */
#chat-body {
    flex: 1;
    padding: 12px;
    overflow-y: auto;
    background: #f3f6fa;
    font-size: 15px;
}


/* ===== TIN NHẮN USER ===== */
.msg-user {
    background: #d8e8ff;
    color: #003f7f;
    padding: 9px 12px;
    border-radius: 14px 14px 0 14px;
    margin: 8px 0;
    max-width: 80%;
    margin-left: auto;
    animation: fadeIn 0.3s ease;
      white-space: pre-line;
}

/* ===== TIN NHẮN BOT ===== */
.msg-bot {
    background: #eeeeee;
    color: #111;
    padding: 9px 12px;
    border-radius: 14px 14px 14px 0;
    margin: 8px 0;
    max-width: 80%;
    margin-right: auto;
    animation: fadeIn 0.3s ease;
      white-space: pre-line;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}


/* ===== INPUT ===== */
.chat-input {
    display: flex;
    border-top: 1px solid #dcdcdc;
    background: white;
}

#chat-text {
    flex: 1;
    padding: 12px;
    border: none;
    font-size: 15px;
}

#send-chat {
    width: 70px;
    background: #007bff;
    border: none;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: 0.25s;
}

#send-chat:hover {
    background: #005fcc;
}

.msg-bot {
    background: #e5e7eb;
    padding: 10px;
    margin: 8px;
    border-radius: 10px;
    display: inline-block;
    max-width: 80%;
}

.typingInside {
    display: flex;
    gap: 4px;
}

.typingInside span {
    width: 6px;
    height: 6px;
    background: #555;
    border-radius: 50%;
    display: inline-block;
    animation: typing 1.4s infinite both;
}

.typingInside span:nth-child(1) { animation-delay: 0s; }
.typingInside span:nth-child(2) { animation-delay: 0.2s; }
.typingInside span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0% { transform: translateY(0); opacity: .3; }
    50% { transform: translateY(-4px); opacity: 1; }
    100% { transform: translateY(0); opacity: .3; }
}
