/* chatbot.css */
#chatbot-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10000;
    font-family: 'Manrope', sans-serif;
}

#chatbot-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #24a346; /* brand green */
    color: #fff;
    border: none;
    box-shadow: 0 4px 15px rgba(36, 163, 70, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
    animation: chatPulse 2.5s infinite ease-in-out;
}

#chatbot-button:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(36, 163, 70, 0.6);
}

@keyframes chatPulse {
    0% {
        box-shadow: 0 4px 15px rgba(36, 163, 70, 0.4);
    }
    50% {
        box-shadow: 0 4px 25px rgba(36, 163, 70, 0.8);
    }
    100% {
        box-shadow: 0 4px 15px rgba(36, 163, 70, 0.4);
    }
}

/* WhatsApp quick-contact FAB — sits just left of the chat launcher */
#whatsapp-fab {
    position: fixed;
    bottom: 20px;
    right: 90px; /* 20 (launcher right) + 60 (launcher width) + 10 gap */
    z-index: 10000;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #25D366; /* WhatsApp green */
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.45);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
    -webkit-tap-highlight-color: transparent;
}
#whatsapp-fab:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.65);
}
#whatsapp-fab svg { display: block; }

#chatbot-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    height: 450px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform-origin: bottom right;
    transform: scale(0);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    pointer-events: none;
}

#chatbot-window.open {
    transform: scale(1);
    opacity: 1;
    pointer-events: auto;
}

#chatbot-header {
    background: #111;
    color: #fff;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
}

#chatbot-close {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
    padding: 0;
}

#chatbot-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-message {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.4;
    animation: fadeIn 0.3s ease forwards;
}

.chat-message.bot {
    background: #f0f0f0;
    color: #111;
    align-self: flex-start;
    border-bottom-left-radius: 2px;
}

.chat-message.user {
    background: #24a346;
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 2px;
}

.chatbot-typing {
    display: flex;
    gap: 4px;
    padding: 14px 18px;
    align-items: center;
}

.chatbot-typing span {
    width: 6px;
    height: 6px;
    background: #999;
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

.chatbot-typing span:nth-child(1) { animation-delay: -0.32s; }
.chatbot-typing span:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

#chatbot-input-area {
    display: flex;
    padding: 12px;
    background: #fff;
    border-top: 1px solid #eee;
}

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

#chatbot-input:focus {
    border-color: #24a346;
}

#chatbot-send {
    background: #111;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    margin-left: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

#chatbot-send:hover {
    background: #24a346;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 480px) {
    #chatbot-window {
        position: fixed;
        top: auto;
        left: 12px;
        right: 12px;
        bottom: 88px; /* float above the launcher instead of covering the screen */
        width: auto;
        height: 68vh;
        max-height: calc(100vh - 110px);
        border-radius: 16px;
    }
}


/* Dynamic Language Toggle Styling */
.chatbot-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

#chatbot-languages {
    display: flex;
    gap: 4px;
    background: rgba(255, 255, 255, 0.08);
    padding: 3px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.chat-lang-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 13px;
    padding: 2px 6px;
    border-radius: 10px;
    transition: all 0.2s cubic-bezier(0.22, 1, 0.36, 1);
    opacity: 0.4;
    outline: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-lang-btn:hover {
    opacity: 0.7;
    background: rgba(255, 255, 255, 0.05);
}

.chat-lang-btn.active {
    opacity: 1;
    background: rgba(255, 255, 255, 0.18);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}


/* Dynamic Chatbot Row & Header Avatar Alignment */
.chat-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    width: 100%;
    margin-bottom: 8px;
}

.chat-row.user {
    justify-content: flex-end;
}

.chatbot-msg-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(0,0,0,0.06);
    flex-shrink: 0;
    margin-bottom: 2px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.06);
}

.chatbot-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

#chatbot-avatar-header {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid rgba(255,255,255,0.25);
    flex-shrink: 0;
}

.chatbot-typing-row {
    margin-bottom: 8px;
}
