@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;700&display=swap');

#unified-chatbot-container { position: fixed; z-index: 99999; font-family: 'Space Grotesk', sans-serif; display: flex; flex-direction: column; gap: 15px; }

/* 6 Positions from WPSKY */
#unified-chatbot-container.pos-bottom-right { bottom: 20px; right: 20px; align-items: flex-end; }
#unified-chatbot-container.pos-bottom-left { bottom: 20px; left: 20px; align-items: flex-start; }
#unified-chatbot-container.pos-middle-right { top: 50%; right: 20px; transform: translateY(-50%); align-items: flex-end; }
#unified-chatbot-container.pos-middle-left { top: 50%; left: 20px; transform: translateY(-50%); align-items: flex-start; }
#unified-chatbot-container.pos-top-right { top: 20px; right: 20px; align-items: flex-end; }
#unified-chatbot-container.pos-top-left { top: 20px; left: 20px; align-items: flex-start; }

#chatbot-launcher {
    width: 60px; height: 60px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: transform 0.2s;
    -webkit-tap-highlight-color: transparent;
    outline: none;
}
#chatbot-launcher:hover { transform: scale(1.05); }
#chatbot-launcher img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

#chatbot-window {
    width: var(--bot-popup-width, 350px);
    height: var(--bot-popup-height, 500px);
    max-height: calc(100vh - 100px);
    background: #fff; border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    display: none; flex-direction: column; overflow: hidden;
}

#chatbot-header {
    color: #fff; padding: 15px 20px;
    display: flex; justify-content: space-between; align-items: center;
    font-weight: 500; font-size: 16px;
}

#chatbot-messages {
    flex: 1 1 auto; height: 0;
    padding: 20px; overflow-y: auto; overflow-x: hidden; background: #f8f9fa;
    display: flex; flex-direction: column; 
}

.chat-msg {
    margin-bottom: 15px; padding: 10px 15px; border-radius: 15px;
    max-width: 80%; font-size: var(--bot-font-size, 14px); line-height: 1.4; word-wrap: break-word;
}
.bot-msg { background: #eee; color: #333; }
.user-msg { color: #fff; margin-left: auto; }
.bot-msg-row { display: flex; align-items: flex-end; margin-bottom: 15px; max-width: 100%; gap: 8px; align-self: flex-start; }
.agent-avatar { width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0; object-fit: contain; }

#chatbot-input-area {
    padding: 15px; border-top: 1px solid #eee; display: flex; gap: 10px; background: #fff;
}
#chatbot-input {
    flex: 1; border: 1px solid #ddd; border-radius: 20px;
    padding: 8px 15px; outline: none; font-family: 'Space Grotesk', sans-serif; font-size: var(--bot-font-size, 14px);
}

.bot-buttons { padding-top: 10px; display: flex; flex-wrap: wrap; gap: 8px; }
.faq-btn {
    padding: 6px 12px; border: 1px solid var(--bot-color, #6200EE); border-radius: 15px;
    background: transparent; color: var(--bot-color, #6200EE); font-size: 13px; font-weight: 500;
    cursor: pointer; transition: 0.2s;
    font-family: 'Space Grotesk', sans-serif;
}
.faq-btn:hover { background: var(--bot-color, #6200EE); color: #fff; }

/* Typing animation */
.bot-typing { padding:10px 15px; background: #eee; border-radius: 15px; display: inline-block; align-self: flex-start; margin-bottom: 15px;}
.typing-indicator span {
    display:inline-block; width:6px; height:6px; background-color:#888;
    border-radius:50%; margin-right:4px; animation: wpsky-typing 1.4s infinite ease-in-out both;
}
.typing-indicator span:nth-child(1) { animation-delay:-0.32s; }
.typing-indicator span:nth-child(2) { animation-delay:-0.16s; }
@keyframes wpsky-typing {
    0%, 80%, 100% { transform:scale(0); }
    40% { transform:scale(1); }
}

/* Fallback buttons */
.fallback-btn {
    display: inline-block; padding: 6px 14px; border-radius: 18px;
    text-decoration: none !important; color: white !important; font-size: 13px; font-weight: 500;
    margin-right: 5px; margin-top: 8px; cursor: pointer; font-family: 'Space Grotesk', sans-serif;
}
