/* WordPress AI Agent - Public Chatbot Styles */

.wpa-chatbot {
    position: fixed; bottom: 20px; z-index: 99999;
    width: 380px; max-height: 560px;
    background: #fff; border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0,0,0,.15), 0 2px 8px rgba(0,0,0,.08);
    display: flex; flex-direction: column;
    overflow: hidden; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.wpa-chatbot-right { right: 20px; }
.wpa-chatbot-left { left: 20px; }

.wpa-chatbot-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff; padding: 16px 20px;
    display: flex; justify-content: space-between; align-items: center;
    font-size: 16px; font-weight: 600;
}
.wpa-chatbot-toggle { cursor: pointer; font-size: 22px; line-height: 1; opacity: 0.8; }
.wpa-chatbot-toggle:hover { opacity: 1; }

.wpa-chatbot-body {
    flex: 1; overflow-y: auto; padding: 16px;
    background: #f7f8fc; max-height: 380px;
}
.wpa-chatbot-body::-webkit-scrollbar { width: 5px; }
.wpa-chatbot-body::-webkit-scrollbar-thumb { background: #cbd5e0; border-radius: 4px; }

.wpa-chatbot-footer {
    display: flex; border-top: 1px solid #e2e8f0; padding: 12px 16px; gap: 8px;
    background: #fff;
}
.wpa-chatbot-footer input {
    flex: 1; padding: 10px 14px; border: 1px solid #e2e8f0; border-radius: 24px;
    font-size: 14px; outline: none; transition: border-color .2s;
}
.wpa-chatbot-footer input:focus { border-color: #667eea; }
.wpa-chatbot-send {
    padding: 10px 20px; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff; border: none; border-radius: 24px; font-size: 14px;
    cursor: pointer; font-weight: 600; transition: opacity .2s;
}
.wpa-chatbot-send:hover { opacity: 0.9; }

.wpa-chat-message { display: flex; gap: 10px; margin-bottom: 14px; }
.wpa-chat-bot { flex-direction: row; }
.wpa-chat-user { flex-direction: row-reverse; }
.wpa-chat-avatar {
    width: 34px; height: 34px; border-radius: 50%; background: #edf2f7;
    display: flex; align-items: center; justify-content: center; font-size: 18px;
    flex-shrink: 0;
}
.wpa-chat-bubble {
    max-width: 75%; padding: 10px 16px; border-radius: 18px;
    font-size: 14px; line-height: 1.55; word-break: break-word;
}
.wpa-chat-bot .wpa-chat-bubble {
    background: #fff; color: #2d3748; border: 1px solid #e2e8f0;
    border-top-left-radius: 4px;
}
.wpa-chat-user .wpa-chat-bubble {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff; border-top-right-radius: 4px;
}

/* FAB */
.wpa-chatbot-fab {
    position: fixed; bottom: 20px; z-index: 99998;
    width: 60px; height: 60px; border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff; font-size: 28px; display: flex;
    align-items: center; justify-content: center;
    cursor: pointer; box-shadow: 0 4px 16px rgba(102,126,234,.4);
    transition: transform .2s, box-shadow .2s; user-select: none;
}
.wpa-chatbot-fab:hover { transform: scale(1.08); box-shadow: 0 6px 24px rgba(102,126,234,.5); }
.wpa-chatbot-fab-right { right: 20px; }
.wpa-chatbot-fab-left { left: 20px; }

/* Typing dots */
.wpa-typing-dots { display: inline-flex; gap: 4px; padding: 4px 0; }
.wpa-typing-dots span {
    width: 7px; height: 7px; border-radius: 50%; background: #a0aec0;
    animation: wpa-typing 1.4s infinite ease-in-out both;
}
.wpa-typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.wpa-typing-dots span:nth-child(2) { animation-delay: -0.16s; }
@keyframes wpa-typing {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

/* Mobile */
@media (max-width: 480px) {
    .wpa-chatbot { width: calc(100vw - 20px); left: 10px; right: 10px; max-height: 70vh; }
    .wpa-chatbot-right, .wpa-chatbot-left { right: 10px; left: 10px; }
}
