/* CheckPay Chatbot Widget Styles */

/* FAB (Floating Action Button) */
.chatbot-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #009688;
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 150, 136, 0.4);
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 0;
    padding: 0;
}

.chatbot-fab:hover {
    background: #00796B;
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(0, 150, 136, 0.5);
}

.chatbot-fab .material-icons {
    font-size: 26px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.chatbot-fab .chatbot-fab-icon-close {
    position: absolute;
    opacity: 0;
    transform: rotate(-90deg);
}

.chatbot-fab.active .chatbot-fab-icon-chat {
    opacity: 0;
    transform: rotate(90deg);
}

.chatbot-fab.active .chatbot-fab-icon-close {
    opacity: 1;
    transform: rotate(0deg);
}

/* Chat Window */
.chatbot-window {
    position: fixed;
    bottom: 92px;
    right: 24px;
    width: 380px;
    max-height: 520px;
    border-radius: 20px;
    background: #ffffff;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    z-index: 1050;
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: chatbotSlideUp 0.3s ease-out;
}

.chatbot-window.active {
    display: flex;
}

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

/* Header */
.chatbot-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: linear-gradient(135deg, #009688, #00796B);
    color: white;
    flex-shrink: 0;
}

.chatbot-header-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chatbot-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.chatbot-avatar .material-icons {
    font-size: 20px;
}

.chatbot-title {
    font-size: 15px;
    font-weight: 600;
}

.chatbot-status {
    font-size: 12px;
    opacity: 0.85;
}

.chatbot-close-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.chatbot-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.chatbot-close-btn .material-icons {
    font-size: 20px;
}

/* Messages Area */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    min-height: 280px;
    max-height: 360px;
    scroll-behavior: smooth;
}

/* Message Bubbles */
.chatbot-msg {
    margin-bottom: 12px;
    display: flex;
    animation: chatbotFadeIn 0.25s ease-out;
}

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

.chatbot-msg-user {
    justify-content: flex-end;
}

.chatbot-msg-assistant {
    justify-content: flex-start;
}

.chatbot-bubble {
    max-width: 80%;
    padding: 10px 14px;
    font-size: 14px;
    line-height: 1.55;
    word-wrap: break-word;
}

.chatbot-msg-user .chatbot-bubble {
    background: #009688;
    color: white;
    border-radius: 16px 16px 4px 16px;
}

.chatbot-msg-assistant .chatbot-bubble {
    background: #f0f2f5;
    color: #212121;
    border-radius: 16px 16px 16px 4px;
}

/* Typing Indicator */
.chatbot-typing {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 12px 16px;
    background: #f0f2f5;
    border-radius: 16px 16px 16px 4px;
    width: fit-content;
}

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

.chatbot-typing-dot:nth-child(1) { animation-delay: 0s; }
.chatbot-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.chatbot-typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes chatbotBounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

/* Input Area */
.chatbot-input-area {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border-top: 1px solid #e8e8e8;
    gap: 8px;
    flex-shrink: 0;
    background: white;
}

.chatbot-input {
    flex: 1;
    border: 2px solid #e0e0e0;
    border-radius: 24px;
    padding: 10px 16px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.3s;
    background: white;
    color: #212121;
}

.chatbot-input:focus {
    border-color: #009688;
}

.chatbot-input::placeholder {
    color: #999;
}

.chatbot-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #009688;
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, opacity 0.2s;
    flex-shrink: 0;
    padding: 0;
}

.chatbot-send-btn:hover {
    background: #00796B;
}

.chatbot-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.chatbot-send-btn .material-icons {
    font-size: 20px;
}

/* Responsive — full screen on mobile */
@media (max-width: 640px) {
    .chatbot-window {
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        max-height: 100vh;
        max-height: 100dvh;
        height: 100vh;
        height: 100dvh;
        border-radius: 0;
    }

    .chatbot-window .chatbot-messages {
        max-height: none;
        flex: 1;
    }

    .chatbot-fab.active {
        display: none;
    }
}
