﻿/*** AI chat box ----*/
/* Floating Button */
#chatbot-toggle {
    position: fixed;
    bottom: 40px;
    right: 20px;
    background: linear-gradient(135deg, #28a745, #85e085);
    border-radius: 50%;
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 6px 15px rgba(0,0,0,0.3);
    z-index: 9999;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: pulseGlow 2s infinite;
}

    #chatbot-toggle:hover {
        transform: scale(1.1) rotate(5deg);
        box-shadow: 0 8px 20px rgba(0,0,0,0.4);
    }

    /* Avatar AI GIF */
    #chatbot-toggle .ai-avatar {
        width: 80px;
        height: 80px;
        border-radius: 50%;
        object-fit: cover;
    }
    #chatbot-toggle img {
        width: 125px;
        height: 125px;
    }

/* Chatbot Container */
#chatbot-container {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 320px;
    height: 420px;
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 10000;
    /* Animation ẩn mặc định */
    opacity: 0;
    transform: scale(0.8) translateY(30px);
    pointer-events: none;
    transition: all 0.3s ease;
}

    #chatbot-container.open {
        opacity: 1;
        transform: scale(1) translateY(0);
        pointer-events: auto;
    }
/* Header */
#chatbot-header {
    background: linear-gradient(135deg, #28a745, #85e085);
    color: #fff;
    padding: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: bold;
}

    #chatbot-header img {
        width: 24px;
        height: 24px;
    }

#chatbot-close {
    margin-left: auto;
    background: transparent;
    border: none;
    font-size: 18px;
    color: #fff;
    cursor: pointer;
}

/* Messages */
#chatbot-messages {
    flex: 1;
    padding: 10px;
    overflow-y: auto;
    font-size: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.message {
    display: flex;
    align-items: flex-end;
    max-width: 80%;
}

    .message.user {
        margin-left: auto;
        justify-content: flex-end;
    }

    .message.ai {
        margin-right: auto;
        justify-content: flex-start;
    }
/* Input */
#chatbot-input-area {
    display: flex;
    border-top: 1px solid #ddd;
}

#chatbot-input {
    flex: 1;
    border: none;
    padding: 10px;
    font-size: 14px;
}

.message .bubble {
    padding: 10px 14px;
    border-radius: 18px;
    word-wrap: break-word;
    max-width: 100%;
    font-size: 14px;
    line-height: 1.4;
}

.message.user .bubble {
    background: #0084ff;
    color: #fff;
    border-bottom-right-radius: 4px;
}

.message.ai .bubble {
    background: #f0f0f0;
    color: #333;
    border-bottom-left-radius: 4px;
}

#chatbot-send {
    background: linear-gradient(135deg, #28a745, #85e085);
    color: #fff;
    border: none;
    padding: 0 15px;
    cursor: pointer;
}

.message .avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    margin: 0 6px;
    object-fit: cover;
}
@keyframes pulseGlow {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 201, 167, 0.6);
    }

    70% {
        box-shadow: 0 0 0 20px rgba(0, 201, 167, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(0, 201, 167, 0);
    }
}