/* ================================
   Floating LeadBot Widget
   ================================ */

   #leadbot-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Toggle Button */
#leadbot-toggle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: #16a34a;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

/* Chat box */
#leadbot-chat {
    width: 360px;
    height: 480px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin-bottom: 12px;
}

/* Hidden state */
#leadbot-chat.collapsed {
    display: none;
}

/* Header */
#leadbot-header {
    background: #16a34a;
    color: #fff;
    padding: 12px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
}

#leadbot-header button {
    background: none;
    border: none;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
}

/* Messages */
#leadbot-messages {
    flex: 1;
    padding: 14px;
    overflow-y: auto;
    background: #f9fafb;
}

/* Message bubbles */
#leadbot-messages .user,
#leadbot-messages .assistant {
    max-width: 80%;
    padding: 10px 14px;
    margin-bottom: 10px;
    border-radius: 14px;
    font-size: 14px;
}

#leadbot-messages .user {
    margin-left: auto;
    background: #16a34a;
    color: #fff;
}

#leadbot-messages .assistant {
    margin-right: auto;
    background: #e5e7eb;
    color: #111827;
}

/* Input row */
#leadbot-input-row {
    display: flex;
    border-top: 1px solid #e5e7eb;
}

#leadbot-input {
    flex: 1;
    border: none;
    padding: 12px;
    font-size: 14px;
    outline: none;
}

#leadbot-send {
    border: none;
    background: #16a34a;
    color: #fff;
    padding: 0 16px;
    cursor: pointer;
}

/* Hide toggle button while chat is open */
#leadbot-widget.open #leadbot-toggle {
    display: none;
}

/* Config warning message */
.leadbot-config-warning {
    margin: 16px 0;
    padding: 12px 14px;
    border-radius: 8px;
    background: #fef3c7;
    border: 1px solid #fbbf24;
    color: #92400e;
    font-size: 14px;
}

/* Mobile */
@media (max-width: 480px) {
    #leadbot-chat {
        width: 100vw;
        height: 100vh;
        border-radius: 0;
        bottom: 0;
        right: 0;
    }
}

/* Typing indicator */
.leadbot-typing {
    display: flex;
    gap: 4px;
    padding: 10px 14px;
    background: #e5e7eb;
    border-radius: 14px;
    width: fit-content;
    margin-bottom: 10px;
}

.leadbot-typing span {
    width: 6px;
    height: 6px;
    background: #6b7280;
    border-radius: 50%;
    animation: leadbot-blink 1.4s infinite both;
}

.leadbot-typing span:nth-child(2) {
    animation-delay: 0.2s;
}

.leadbot-typing span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes leadbot-blink {
    0% { opacity: 0.2; }
    20% { opacity: 1; }
    100% { opacity: 0.2; }
}
