/* ===== Paulo AI Chatbot Widget ===== */

#paulo-chatbot-wrapper {
    position: fixed;
    bottom: 80px;
    right: 16px;
    z-index: 999999;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    display: block !important;
    visibility: visible !important;
}

/* ---- Toggle Button ---- */
#paulo-chat-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0073aa, #005f8d);
    color: #fff;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 115, 170, 0.45);
    display: flex !important;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin-left: auto;
    -webkit-appearance: none;
    appearance: none;
}

#paulo-chat-toggle:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 24px rgba(0, 115, 170, 0.55);
}

/* ---- Chat Window ---- */
#paulo-chat-window {
    width: 340px;
    height: 480px;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
    display: flex;
    flex-direction: column;
    margin-bottom: 14px;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px) scale(0.96);
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

#paulo-chat-window.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* ---- Header ---- */
#paulo-chat-header {
    background: linear-gradient(135deg, #0073aa, #005f8d);
    color: #fff;
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

#paulo-chat-header-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

#paulo-chat-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255,255,255,0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    flex-shrink: 0;
}

#paulo-chat-name {
    font-weight: 600;
    font-size: 14px;
}

#paulo-chat-status {
    font-size: 11px;
    opacity: 0.85;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 2px;
}

#paulo-status-dot {
    width: 7px;
    height: 7px;
    background: #4cff91;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 6px #4cff91;
}

#paulo-chat-close {
    background: rgba(255,255,255,0.15);
    border: none;
    color: #fff;
    cursor: pointer;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

#paulo-chat-close:hover {
    background: rgba(255,255,255,0.3);
}

/* ---- Messages Area ---- */
#paulo-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    scroll-behavior: smooth;
}

#paulo-chat-messages::-webkit-scrollbar { width: 4px; }
#paulo-chat-messages::-webkit-scrollbar-track { background: transparent; }
#paulo-chat-messages::-webkit-scrollbar-thumb { background: #ddd; border-radius: 4px; }

/* ---- Message Bubbles ---- */
.chat-msg {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    animation: msgFadeIn 0.2s ease;
}

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

.bot-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0073aa, #005f8d);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
}

.bubble {
    max-width: 78%;
    padding: 9px 13px;
    border-radius: 16px;
    font-size: 13.5px;
    line-height: 1.5;
    word-wrap: break-word;
}

.user-msg {
    flex-direction: row-reverse;
}

.user-msg .bubble {
    background: linear-gradient(135deg, #0073aa, #005f8d);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.bot-msg .bubble {
    background: #f3f4f6;
    color: #1a1a2e;
    border-bottom-left-radius: 4px;
}

/* ---- Typing Indicator ---- */
.typing-bubble {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 16px;
}

.typing-bubble span {
    width: 7px;
    height: 7px;
    background: #aaa;
    border-radius: 50%;
    animation: typingBounce 1.2s infinite ease-in-out;
}

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

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

/* ---- Suggestion Chips ---- */
.suggestion-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 2px 0 4px 36px;
    animation: msgFadeIn 0.3s ease;
}

.suggestion-chip {
    background: #fff;
    border: 1.5px solid #0073aa;
    color: #0073aa;
    border-radius: 20px;
    padding: 5px 11px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.18s ease;
    white-space: nowrap;
}

.suggestion-chip:hover {
    background: #0073aa;
    color: #fff;
}

/* ---- Input Area ---- */
#paulo-chat-input-area {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    border-top: 1px solid #f0f0f0;
    flex-shrink: 0;
    background: #fff;
}

#paulo-chat-input {
    flex: 1;
    border: 1.5px solid #e5e7eb;
    border-radius: 22px;
    padding: 8px 14px;
    font-size: 13.5px;
    outline: none;
    transition: border-color 0.2s;
    background: #f9fafb;
    color: #1a1a2e;
}

#paulo-chat-input:focus {
    border-color: #0073aa;
    background: #fff;
}

#paulo-chat-send {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, #0073aa, #005f8d);
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.15s ease, opacity 0.15s;
}

#paulo-chat-send:hover { transform: scale(1.08); }
#paulo-chat-send:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---- Mobile ---- */
@media (max-width: 480px) {
    #paulo-chat-window {
        width: calc(100vw - 32px);
        right: 0;
        bottom: 80px;
    }
    #paulo-chatbot-wrapper {
        bottom: 16px;
        right: 16px;
    }
}
