:root {
    --primary-color: #007bff; /* Change this to match your brand */
    --chatbot-bg: #ffffff;
    --chatbot-shadow: rgba(0, 0, 0, 0.25);
}

/* Floating Button */
#chatbot-launcher {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary-color);
    color: #fff;
    font-size: 28px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 4px 12px var(--chatbot-shadow);
    z-index: 99999;
    transition: transform .2s ease;
}

#chatbot-launcher:hover {
    transform: scale(1.1);
}

/* Modal Container */
#chatbot-modal {
    position: fixed;
    bottom: 100px;
    right: 25px;
    width: 350px;
    height: 420px;
    background: var(--chatbot-bg);
    border-radius: 12px;
    box-shadow: 0 6px 18px var(--chatbot-shadow);
    display: none; /* hidden by default */
    flex-direction: column;
    z-index: 99999;
}

/* Modal Content Area */
#chatbot-modal-content {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Header */
.chatbot-header {
    background: var(--primary-color);
    padding: 12px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 12px 12px 0 0;
}

.chatbot-header h3 {
    margin: 0;
    font-size: 18px;
}

#chatbot-close {
    background: transparent;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
}

/* Placeholder Body */
.chatbot-body {
    padding: 15px;
    overflow-y: auto;
    font-size: 15px;
}

/* Chat Messages */
#chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Message bubble base */
.chatbot-message {
    padding: 10px 14px;
    border-radius: 8px;
    max-width: 80%;
    font-size: 14px;
    line-height: 1.4;
}

/* Bot */
.chatbot-message.system,
.chatbot-message.bot {
    background: #f1f1f1;
    align-self: flex-start;
}

/* User */
.chatbot-message.user {
    background: var(--primary-color);
    color: white;
    align-self: flex-end;
}

.message-status {
    font-size: 11px;
    color: #777;
    margin-top: 3px;
    margin-bottom: 6px;
    text-align: right;
    padding-right: 4px;
}

/* WhatsApp-style ticks */
.tick {
    font-weight: bold;
    margin-left: 4px;
}

/* Input row */
.chatbot-input {
    display: flex;
    border-top: 1px solid #ddd;
}

.chatbot-input input {
    flex: 1;
    padding: 12px;
    border: none;
    outline: none;
}

#chatbot-send {
    width: 60px;
    background: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
}

.typing-indicator {
    background: #f1f1f1;
    padding: 10px 14px;
    border-radius: 8px;
    width: auto;
    display: inline-flex;
    gap: 4px;
    align-items: center;
    margin-bottom: 8px;
}

.typing-indicator .dot {
    width: 6px;
    height: 6px;
    background: #888;
    border-radius: 50%;
    animation: blink 1.4s infinite both;
}

.typing-indicator .dot:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator .dot:nth-child(3) { animation-delay: 0.4s; }


@keyframes blink {
    0% { opacity: 0.2; }
    20% { opacity: 1; }
    100% { opacity: 0.2; }
}

/* -----------------------------------------
   MOBILE RESPONSIVE STYLING
----------------------------------------- */

@media (max-width: 768px) {

    /* Adjust floating launcher */
    #chatbot-launcher {
        width: 50px;
        height: 50px;
        font-size: 22px;
        bottom: 20px;
        right: 20px;
    }

    /* Mobile modal style */
    #chatbot-modal {
        width: 90%;
        max-width: 420px;
        height: 80vh;
        bottom: 10px;
        right: 5%;
        border-radius: 14px;
    }

    .chatbot-header h3 {
        font-size: 16px;
    }

    /* Message bubbles should never overflow */
    .chatbot-message {
        max-width: 90%;
        font-size: 14px;
        word-wrap: break-word;
        word-break: break-word;
    }

    /* Typing indicator bubble */
    .typing-indicator {
        max-width: 50%;
        padding: 8px 12px;
    }

    /* Input row must remain strong */
    .chatbot-input input {
        padding: 10px;
        font-size: 14px;
    }

    #chatbot-send {
        width: 55px;
        font-size: 16px;
    }

    /* Status label under user bubble */
    .message-status {
        padding-right: 6px;
        font-size: 10px;
    }
}


@media (max-width: 480px) {

    /* Slightly smaller launcher on very small screens */
    #chatbot-launcher {
        width: 44px;
        height: 44px;
        font-size: 20px;
    }

    /* Modal fills more of the screen */
    #chatbot-modal {
        width: 94%;
        height: 82vh;
        bottom: 8px;
        right: 3%;
        border-radius: 12px;
    }

    /* Even better text wrapping */
    .chatbot-message {
        max-width: 95%;
    }
}
