#aiChatButton {
    position: fixed;
    right: 25px;
    bottom: 25px;
    width: 60px;
    height: 60px;
    border: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, #18a58a, #55a196);
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    z-index: 99999;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.20);
    transition: 0.3s;
}

#aiChatButton:hover {
    transform: scale(1.08);
}


/* Chat Box */

#aiChatBox {
    position: fixed;
    right: 25px;
    bottom: 95px;
    width: 370px;
    max-width: calc(100vw - 30px);
    height: 550px;
    background: #fff;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.20);
    z-index: 99998;
    display: none;
    flex-direction: column;
}

#aiChatBox.active {
    display: flex;
}


/* Header */

.ai-chat-header {
    padding: 16px;
    background: linear-gradient(135deg, #18a58a, #55a196);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ai-chat-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ai-chat-avatar {
    width: 42px;
    height: 42px;
    background: #fff;
    color: #18a58a;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 19px;
}

.ai-chat-title strong {
    display: block;
    font-size: 15px;
}

.ai-chat-title small {
    display: block;
    margin-top: 2px;
    opacity: 0.85;
    font-size: 11px;
}

#closeAiChat {
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 25px;
    cursor: pointer;
}


/* Messages */

#aiMessages {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    background: #f6f8f9;
}

.ai-message {
    max-width: 82%;
    padding: 10px 13px;
    margin-bottom: 10px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.5;
    word-break: break-word;
}

.ai-message.bot {
    background: #fff;
    color: #333;
    border-top-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.ai-message.user {
    margin-left: auto;
    background: #18a58a;
    color: #fff;
    border-top-right-radius: 4px;
}


/* Quick Buttons */

.ai-quick-buttons {
    padding: 10px;
    background: #fff;
    border-top: 1px solid #eee;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.ai-quick-btn {
    border: 1px solid #18a58a;
    background: #fff;
    color: #18a58a;
    padding: 6px 10px;
    border-radius: 20px;
    font-size: 11px;
    cursor: pointer;
    transition: 0.2s;
}

.ai-quick-btn:hover {
    background: #18a58a;
    color: #fff;
}


/* Input */

.ai-chat-input {
    padding: 10px;
    background: #fff;
    border-top: 1px solid #eee;
    display: flex;
    gap: 7px;
}

#aiMessage {
    flex: 1;
    height: 42px;
    border: 1px solid #ddd;
    border-radius: 25px;
    padding: 0 15px;
    outline: none;
    font-size: 13px;
}

#aiMessage:focus {
    border-color: #18a58a;
}

#sendAiMessage {
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    background: #18a58a;
    color: #fff;
    cursor: pointer;
    font-size: 15px;
}


/* Typing Animation */

#aiTyping {
    display: flex;
    align-items: center;
    gap: 4px;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: #999;
    border-radius: 50%;
    animation: aiTyping 1.2s infinite;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes aiTyping {

    0%,
    60%,
    100% {
        transform: translateY(0);
    }

    30% {
        transform: translateY(-5px);
    }
}


/* Mobile */

@media (max-width: 600px) {

    #aiChatButton {
        right: 18px;
        bottom: 18px;
        width: 56px;
        height: 56px;
    }

    #aiChatBox {
        right: 10px;
        bottom: 85px;
        width: calc(100vw - 20px);
        height: 70vh;
        border-radius: 15px;
    }
}