/* ============================================
   VIDA Website — Chatbot Styles
   ============================================ */

.chatbot-toggle {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 900;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 22px;
    background: var(--color-accent);
    color: var(--color-bg);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 8px 32px rgba(200, 164, 94, 0.3);
}

.chatbot-label {
    letter-spacing: 0.02em;
}

/* --- Chat Window --- */
.chatbot-window {
    position: fixed;
    bottom: 90px;
    right: 28px;
    z-index: 950;
    width: 380px;
    max-height: 520px;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: all var(--duration-medium) var(--ease-smooth);
}

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

/* Header */
.chatbot-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border-subtle);
}

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

.chatbot-avatar {
    width: 36px;
    height: 36px;
    background: var(--color-accent);
    color: var(--color-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 900;
}

.chatbot-header h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-white);
}

.chatbot-status {
    font-size: 0.7rem;
    color: var(--color-success);
}

.chatbot-close {
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-size: 1.4rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: all var(--duration-fast);
}

.chatbot-close:hover {
    color: var(--color-white);
    background: rgba(255, 255, 255, 0.05);
}

/* Messages */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: 300px;
    max-height: 360px;
}

.chat-message {
    max-width: 85%;
    animation: msg-appear 0.3s var(--ease-smooth);
}

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

.chat-message.bot {
    align-self: flex-start;
}

.chat-message.user {
    align-self: flex-end;
}

.chat-message p {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    line-height: 1.6;
}

.chat-message.bot p {
    background: var(--color-surface);
    color: var(--color-text);
    border-bottom-left-radius: 4px;
}

.chat-message.user p {
    background: var(--color-accent);
    color: var(--color-bg);
    border-bottom-right-radius: 4px;
}

/* Typing indicator */
.chat-message.typing p {
    display: flex;
    gap: 4px;
    padding: 16px 20px;
}

.typing-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--color-text-muted);
    animation: typing-bounce 1.4s ease-in-out infinite;
}

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

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

/* Input Area */
.chatbot-input-area {
    display: flex;
    gap: 8px;
    padding: 16px;
    border-top: 1px solid var(--color-border-subtle);
    background: var(--color-surface);
}

#chatbotInput {
    flex: 1;
    background: var(--color-bg);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: 0.85rem;
    outline: none;
    transition: border-color var(--duration-fast);
}

#chatbotInput::placeholder {
    color: var(--color-text-muted);
}

#chatbotInput:focus {
    border-color: var(--color-accent);
}

#chatbotSend {
    background: var(--color-accent);
    color: var(--color-bg);
    border: none;
    border-radius: var(--radius-sm);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--duration-fast);
    flex-shrink: 0;
}

#chatbotSend:hover {
    background: var(--color-accent-light);
    transform: scale(1.05);
}

#chatbotSend:active {
    transform: scale(0.95);
}

/* Scrollbar */
.chatbot-messages::-webkit-scrollbar {
    width: 4px;
}

.chatbot-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 2px;
}

/* Responsive */
@media (max-width: 480px) {
    .chatbot-window {
        right: 12px;
        left: 12px;
        bottom: 80px;
        width: auto;
    }
    
    .chatbot-toggle {
        right: 16px;
        bottom: 16px;
    }
    
    .chatbot-label {
        display: none;
    }
    
    .chatbot-toggle {
        padding: 14px;
        border-radius: 50%;
    }
}
