.fnbm-chatbot {
    position: fixed;
    bottom: 120px;
    right: 24px;
    z-index: 9999;
    font-family: 'Nunito', sans-serif;
}

/* Floating Button */
.chatbot-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00A862, #0078D4);
    border: none;
    cursor: pointer;
    box-shadow: 0 8px 32px rgba(0, 168, 98, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    animation: cbPulse 2s ease-in-out infinite;
    color: white;
}

.chatbot-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 40px rgba(0, 168, 98, 0.5);
}

.chatbot-btn.open {
    animation: none;
    background: linear-gradient(135deg, #00A862, #0078D4);
}

@keyframes cbPulse {
    0%, 100% { box-shadow: 0 8px 32px rgba(0, 168, 98, 0.35); }
    50% { box-shadow: 0 8px 48px rgba(0, 120, 212, 0.5); }
}

/* Chat Window - opens upward from button */
.chatbot-window {
    display: none;
    position: fixed;
    bottom: 120px;
    right: 24px;
    width: 370px;
    max-height: 480px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    flex-direction: column;
    animation: cbSlideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.chatbot-window.open {
    display: flex;
}

@keyframes cbSlideUp {
    from { opacity: 0; transform: translateY(30px) scale(0.9); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.chatbot-header {
    background: linear-gradient(135deg, #00704A, #0063B1);
    padding: 14px 18px;
    color: white;
    display: flex;
    align-items: center;
    gap: 10px;
}

.chatbot-header .avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.chatbot-header .info h3 {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
    margin: 0;
}

.chatbot-header .info span {
    font-size: 0.68rem;
    opacity: 0.85;
}

.chatbot-header .close-btn {
    margin-left: auto;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.9rem;
}

.chatbot-body {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    background: #F8FAF9;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 180px;
    max-height: 300px;
}

.chat-msg {
    max-width: 85%;
    padding: 9px 12px;
    border-radius: 14px;
    font-size: 0.82rem;
    line-height: 1.4;
    animation: msgIn 0.3s ease;
}

@keyframes msgIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.chat-msg.bot {
    background: white;
    color: #1C2620;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    align-self: flex-start;
}

.chat-msg.user {
    background: linear-gradient(135deg, #00A862, #0078D4);
    color: white;
    border-bottom-right-radius: 4px;
    align-self: flex-end;
}

.chat-msg .time {
    font-size: 0.6rem;
    opacity: 0.6;
    margin-top: 3px;
    display: block;
}

.quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    padding: 0 2px;
}

.quick-reply-btn {
    padding: 7px 12px;
    background: white;
    border: 1px solid #E8ECEA;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Nunito', sans-serif;
    color: #00704A;
    transition: all 0.2s;
    white-space: nowrap;
}

.quick-reply-btn:hover {
    background: #D4F5E9;
    border-color: #00A862;
}

.chatbot-footer {
    padding: 10px 14px;
    background: white;
    border-top: 1px solid #E8ECEA;
    display: flex;
    gap: 6px;
}

.chatbot-footer input {
    flex: 1;
    padding: 9px 12px;
    border: 2px solid #E8ECEA;
    border-radius: 99px;
    font-family: 'Nunito', sans-serif;
    font-size: 0.82rem;
    outline: none;
}

.chatbot-footer input:focus {
    border-color: #00A862;
}

.chatbot-footer .send-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #00A862;
    border: none;
    color: white;
    font-size: 0.9rem;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
}
.chatbot-footer .send-btn:hover {
    background: #00704A;
}

.typing-dots {
    display: flex;
    gap: 3px;
    padding: 6px 12px;
}

.typing-dots span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #C8D8D0;
    animation: typingBounce 1.4s infinite;
}

.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-7px); }
}

@media (max-width: 480px) {
    .fnbm-chatbot {
        bottom: 100px;
        right: 14px;
    }
    
    .chatbot-window {
        width: calc(100vw - 32px);
        right: 14px;
        bottom: 100px;
        max-height: 55vh;
    }
    
    .chatbot-btn {
        width: 48px;
        height: 48px;
        font-size: 1.2rem;
    }
}

/* Hide the PWA register button if it appears near chatbot */
.pwa-register-btn,
.pwa-install-btn,
.pwa-close-btn,
button[id*="pwa"] {
    display: none !important;
}

/* Hide any extra close/+ button near chatbot footer */
.chatbot-footer + button,
.chatbot-footer ~ button,
#chatbotWindow + button {
    display: none !important;
}
/* Hide PWA install button when it appears near the chatbot */
.fnbm-chatbot ~ button,
#fnbmChatbotContainer ~ button,
button[class*="pwa"],
button[id*="pwa"],
button[class*="install"],
.add-button,
.add-to-home {
    display: none !important;
}
.chatbot-btn.open {
    animation: none;
    background: linear-gradient(135deg, #00A862, #0078D4);
}

/* Force hide the ✕ text */
.chatbot-btn.open::after {
    content: '💬' !important;
    position: absolute;
    color: white;
}