/* JS Visions Chatbot Widget */

#jsv-chatbot-trigger {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    background: #FE8F01;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    z-index: 99999;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#jsv-chatbot-trigger:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.3);
}

#jsv-chatbot-trigger.jsv-hidden {
    display: none;
}

/* Chat Window */
#jsv-chatbot-window {
    position: fixed;
    bottom: 96px;
    right: 24px;
    width: 380px;
    height: 520px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: jsv-chat-fadein 0.25s ease;
}

@keyframes jsv-chat-fadein {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Header */
.jsv-chat-header {
    background: linear-gradient(135deg, #FE8F01, #e07d00);
    padding: 18px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.jsv-chat-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
    line-height: 1.2;
}

.jsv-chat-subtitle {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.85);
    margin-top: 2px;
}

.jsv-chat-close {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 28px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.jsv-chat-close:hover {
    opacity: 1;
}

/* Messages Area */
.jsv-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.jsv-chat-messages::-webkit-scrollbar {
    width: 4px;
}

.jsv-chat-messages::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

/* Message Bubbles */
.jsv-msg {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 16px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
    animation: jsv-msg-in 0.2s ease;
}

@keyframes jsv-msg-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.jsv-msg-bot {
    background: #f5f0eb;
    color: #555656;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.jsv-msg-user {
    background: #FE8F01;
    color: #ffffff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.jsv-msg-bot a {
    color: #FE8F01;
    text-decoration: underline;
}

/* Quick Action Chips */
.jsv-chat-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.jsv-chip {
    background: #ffffff;
    border: 1px solid #FE8F01;
    color: #FE8F01;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
}

.jsv-chip:hover {
    background: #FE8F01;
    color: #ffffff;
}

/* Typing Indicator */
.jsv-typing {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    align-self: flex-start;
}

.jsv-typing-dot {
    width: 8px;
    height: 8px;
    background: #ccc;
    border-radius: 50%;
    animation: jsv-bounce 1.2s infinite;
}

.jsv-typing-dot:nth-child(2) { animation-delay: 0.15s; }
.jsv-typing-dot:nth-child(3) { animation-delay: 0.3s; }

@keyframes jsv-bounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-6px); }
}

/* Input Area */
.jsv-chat-input-area {
    display: flex;
    padding: 12px 16px;
    border-top: 1px solid #eee;
    gap: 8px;
    flex-shrink: 0;
    background: #ffffff;
}

.jsv-chat-input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 24px;
    padding: 10px 16px;
    font-size: 14px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    outline: none;
    transition: border-color 0.2s;
}

.jsv-chat-input:focus {
    border-color: #FE8F01;
}

.jsv-chat-send {
    width: 40px;
    height: 40px;
    background: #FE8F01;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s;
}

.jsv-chat-send:hover {
    background: #e07d00;
}

/* Mobile */
@media (max-width: 480px) {
    #jsv-chatbot-trigger {
        width: 52px;
        height: 52px;
        bottom: 16px;
        right: 16px;
    }

    #jsv-chatbot-window {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        border-radius: 0;
        overflow: hidden;
    }

    /* Fixed wrapper to handle Android keyboard */
    body.jsv-chat-open {
        overflow: hidden !important;
        position: fixed !important;
        width: 100% !important;
        height: 100% !important;
    }

    .jsv-chat-header {
        flex-shrink: 0;
    }

    .jsv-chat-messages {
        flex: 1;
        min-height: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .jsv-chat-input-area {
        flex-shrink: 0;
        background: #ffffff;
        padding-bottom: max(12px, env(safe-area-inset-bottom));
    }
}
