/* chatbot-floating.css */

/* Floating Button */
.jd-chatbot-trigger-wrapper {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 999990;
}

@media (max-width: 768px) {
    .jd-chatbot-trigger-wrapper {
        bottom: 20px;
        right: 20px;
    }
}

.jd-chatbot-trigger-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #1a56f0;
    color: #fff;
    border: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    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;
}

.jd-chatbot-trigger-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.2);
}

.jd-chatbot-trigger-btn svg {
    width: 30px;
    height: 30px;
    transition: transform 0.3s, opacity 0.3s;
}

.jd-chatbot-icon-open, .jd-chatbot-icon-close {
    position: absolute;
}
.jd-chatbot-icon-close {
    opacity: 0;
    transform: rotate(-90deg) scale(0.5);
}

.jd-chatbot-trigger-wrapper.jd-chat-open .jd-chatbot-icon-open {
    opacity: 0;
    transform: rotate(90deg) scale(0.5);
}
.jd-chatbot-trigger-wrapper.jd-chat-open .jd-chatbot-icon-close {
    opacity: 1;
    transform: rotate(0) scale(1);
}
.jd-chatbot-trigger-wrapper.jd-chat-open .jd-chatbot-trigger-btn {
    background: #ff5252;
}

/* Chat Window */
.jd-chatbot-window {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 360px;
    height: 550px;
    max-height: calc(100vh - 120px);
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 999991;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transform-origin: bottom right;
    transition: all 0.3s cubic-bezier(0.19, 1, 0.22, 1);
}
@media (max-width: 768px) {
    .jd-chatbot-window {
        right: 15px;
        bottom: 90px;
        width: calc(100vw - 30px);
        height: calc(100vh - 110px);
    }
}

.jd-chatbot-window.jd-show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Header */
.jd-chatbot-header {
    background: #1a56f0;
    color: #fff;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}
.jd-chatbot-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}
.jd-chatbot-avatar svg {
    width: 24px;
    height: 24px;
}
.jd-chatbot-header-info {
    flex: 1;
}
.jd-chatbot-title {
    margin: 0 0 2px 0;
    font-size: 16px;
    font-weight: 700;
}
.jd-chatbot-status {
    margin: 0;
    font-size: 12px;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 4px;
}
.jd-chatbot-dot {
    width: 8px;
    height: 8px;
    background: #4caf50;
    border-radius: 50%;
    display: inline-block;
}

/* Body */
.jd-chatbot-body {
    flex: 1;
    background: #f8f9fa;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.jd-chatbot-actions {
    display: none;
    padding: 14px 16px 10px;
    background: linear-gradient(180deg, rgba(248,249,250,0.3) 0%, #ffffff 45%);
    border-top: 1px solid #eef2f7;
}

.jd-chatbot-actions.jd-has-actions {
    display: block;
}

/* Message Bubbles */
.jd-chat-msg {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    animation: jdFadeInUp 0.3s ease;
    word-wrap: break-word;
}
@keyframes jdFadeInUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.jd-msg-bot {
    align-self: flex-start;
    background: #fff;
    color: #333;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
}
.jd-msg-user {
    align-self: flex-end;
    background: #1a56f0;
    color: #fff;
    border-bottom-right-radius: 4px;
}

/* Quick Replies */
.jd-quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 0;
    animation: jdFadeInUp 0.25s ease both;
}
.jd-qr-btn {
    background: linear-gradient(180deg, #ffffff 0%, #eef4ff 100%);
    border: 1px solid #c7d7fe;
    color: #1a56f0;
    padding: 9px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(26, 86, 240, 0.08);
    transition: all 0.2s ease;
}
.jd-qr-btn:hover {
    background: #1a56f0;
    color: #fff;
    border-color: #1a56f0;
    transform: translateY(-1px);
}

.jd-chatbot-actions .jd-qr-btn {
    min-height: 36px;
}

@media (max-width: 768px) {
    .jd-chatbot-actions {
        padding: 12px 12px 8px;
    }

    .jd-chatbot-actions .jd-quick-replies {
        gap: 7px;
    }

    .jd-chatbot-actions .jd-qr-btn {
        font-size: 12px;
        padding: 8px 12px;
    }
}

/* Typing Indicator */
.jd-typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 14px 18px;
}
.jd-typing-dot {
    width: 6px;
    height: 6px;
    background: #a0a0a0;
    border-radius: 50%;
    animation: jdTypingBounce 1.4s infinite ease-in-out both;
}
.jd-typing-dot:nth-child(1) { animation-delay: -0.32s; }
.jd-typing-dot:nth-child(2) { animation-delay: -0.16s; }
@keyframes jdTypingBounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* Input Area */
.jd-chatbot-footer {
    padding: 16px;
    background: #fff;
    border-top: 1px solid #f0f0f0;
    display: flex;
    gap: 10px;
}
.jd-chatbot-input {
    flex: 1;
    border: 1px solid #e0e0e0;
    border-radius: 24px;
    padding: 12px 16px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
    background: #fcfcfc;
}
.jd-chatbot-input:focus {
    border-color: #1a56f0;
    background: #fff;
}
.jd-chatbot-send-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #1a56f0;
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
}
.jd-chatbot-send-btn:hover {
    background: #1545c0;
}
.jd-chatbot-send-btn:active {
    transform: scale(0.95);
}
.jd-chatbot-send-btn svg {
    margin-left: 2px;
}
