/* ── AI Chatbot Widget Styles ─────────────────────── */

:root {
    --chat-primary: #6CC04A; /* Annam Dental Clinic primary green */
    --chat-accent: #123B4A;  /* Annam Dental Clinic accent navy */
    --chat-radius: 18px;
    --chat-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    --chat-bg: #FFFFFF;
    --chat-bot-bubble: #F0F5F9;
    --chat-user-bubble: #6CC04A;
}

/* Chat Trigger Button */
#chatbot-trigger {
    position: fixed;
    bottom: 90px;
    right: 24px;
    width: 60px;
    height: 60px;
    background: var(--chat-primary);
    color: white;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(108, 192, 74, 0.4);
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#chatbot-trigger:hover {
    transform: scale(1.1) rotate(5deg);
}

#chatbot-trigger svg {
    width: 30px;
    height: 30px;
    fill: currentColor;
}

/* Chat Panel */
#chatbot-panel {
    position: fixed;
    bottom: 100px;
    right: 24px;
    width: 380px;
    height: 550px;
    max-height: calc(100vh - 120px);
    background: var(--chat-bg);
    border-radius: var(--chat-radius);
    box-shadow: var(--chat-shadow);
    z-index: 1002;
    overflow: hidden;
    display: none;
    flex-direction: column;
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

#chatbot-panel.active {
    display: flex;
    transform: translateY(0);
    opacity: 1;
}

/* Chat Header */
.chatbot-header {
    background: var(--chat-accent);
    color: white;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chatbot-header__title {
    font-family: 'Poppins', sans-serif;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.chatbot-header__close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    font-size: 24px;
}

/* Chat Messages Area */
#chatbot-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #f8fbff;
}

/* Message Bubbles */
.chat-msg {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    position: relative;
    word-wrap: break-word;
}

.chat-msg--bot {
    align-self: flex-start;
    background: var(--chat-bot-bubble);
    color: var(--chat-accent);
    border-bottom-left-radius: 4px;
}

.chat-msg--user {
    align-self: flex-end;
    background: var(--chat-user-bubble);
    color: white;
    border-bottom-right-radius: 4px;
}

/* Loading Typing Indicator */
.typing-indicator {
    padding: 8px 16px;
    background: var(--chat-bot-bubble);
    border-radius: 16px;
    display: none;
    align-self: flex-start;
    gap: 4px;
}

.typing-indicator span {
    width: 6px;
    height: 6px;
    background: #999;
    border-radius: 50%;
    animation: typing 1s infinite alternate;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    from { opacity: 0.3; transform: translateY(0); }
    to { opacity: 1; transform: translateY(-4px); }
}

/* Chat Input Area */
.chatbot-input-area {
    padding: 16px;
    background: white;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
}

#chatbot-input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

#chatbot-input:focus {
    border-color: var(--chat-primary);
}

#chatbot-send {
    background: var(--chat-primary);
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s;
}

#chatbot-send:hover {
    transform: scale(1.1);
}

/* Mobile Adjustments */
@media (max-width: 480px) {
    #chatbot-panel {
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
    }
}
