/* ============================
   CHATBOT STYLES
   ============================ */

/* Floating chat button - right side, parallel to WhatsApp */
.chatbot-toggle {
    position: fixed;
    bottom: 90px; /* parallel to the floating-contact buttons */
    right: 20px;
    width: 62px;
    height: 62px;
    background: linear-gradient(135deg, #754ef9, #5a35d6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 9998;
    box-shadow: 0 4px 15px rgba(117, 78, 249, 0.5);
    transition: all 0.3s ease;
    border: none;
    outline: none;
    animation: blink-ring 2s ease-in-out infinite;
}

/* Stop blinking when chat is open */
.chatbot-toggle.active {
    animation: none;
}

@keyframes blink-ring {
    0%   { box-shadow: 0 0 0 0 rgba(117, 78, 249, 0.7); }
    50%  { box-shadow: 0 0 0 12px rgba(117, 78, 249, 0); }
    100% { box-shadow: 0 0 0 0 rgba(117, 78, 249, 0); }
}

.chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(117, 78, 249, 0.7);
    animation: none;
}

.chatbot-toggle svg {
    width: 32px;
    height: 32px;
    fill: #fff;
}

/* Notification badge */
.chatbot-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ff4444;
    color: #fff;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    animation: pulse-badge 1.5s infinite;
}

@keyframes pulse-badge {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* Chat Window */
.chatbot-window {
    position: fixed;
    bottom: 160px;
    right: 20px;
    width: 340px;
    max-height: 480px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.18);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

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

/* Header */
.chatbot-header {
    background: linear-gradient(135deg, #754ef9, #5a35d6);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.chatbot-header-avatar {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.25);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.chatbot-header-info h6 {
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    margin: 0;
}

.chatbot-header-info span {
    color: rgba(255,255,255,0.8);
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.chatbot-header-info span::before {
    content: '';
    width: 7px;
    height: 7px;
    background: #44ff88;
    border-radius: 50%;
    display: inline-block;
}

.chatbot-close {
    margin-left: auto;
    background: none;
    border: none;
    color: rgba(255,255,255,0.8);
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
    padding: 0;
    transition: color 0.2s;
}

.chatbot-close:hover { color: #fff; }

/* Messages area */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #f8f9fc;
}

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

/* Message bubbles */
.chat-msg {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    animation: msgSlideIn 0.25s ease;
}

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

.chat-msg.bot { align-self: flex-start; }
.chat-msg.user { align-self: flex-end; flex-direction: row-reverse; }

.chat-msg .avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #754ef9, #5a35d6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.chat-bubble {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 13.5px;
    line-height: 1.55;
    word-break: break-word;
}

.chat-msg.bot .chat-bubble {
    background: #fff;
    color: #32333c;
    border-radius: 4px 16px 16px 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}

.chat-msg.user .chat-bubble {
    background: linear-gradient(135deg, #754ef9, #5a35d6);
    color: #fff;
    border-radius: 16px 4px 16px 16px;
}

/* Quick reply chips */
.quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
    padding: 0 16px 10px;
}

.quick-chip {
    background: #fff;
    border: 1.5px solid #754ef9;
    color: #754ef9;
    border-radius: 20px;
    padding: 5px 14px;
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.quick-chip:hover {
    background: #754ef9;
    color: #fff;
}

/* Typing indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 10px 14px;
    background: #fff;
    border-radius: 4px 16px 16px 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    width: fit-content;
}

.typing-indicator span {
    width: 7px;
    height: 7px;
    background: #754ef9;
    border-radius: 50%;
    animation: typing-bounce 1.2s infinite;
}
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing-bounce {
    0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
    40%           { transform: translateY(-6px); opacity: 1; }
}

/* Input area */
.chatbot-input-area {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border-top: 1px solid #eee;
    gap: 8px;
    background: #fff;
    flex-shrink: 0;
}

.chatbot-input {
    flex: 1;
    border: 1.5px solid #e0e0e0;
    border-radius: 24px;
    padding: 9px 16px;
    font-size: 13.5px;
    outline: none;
    font-family: 'Poppins', sans-serif;
    color: #32333c;
    background: #f8f9fc;
    transition: border-color 0.2s;
}

.chatbot-input:focus {
    border-color: #754ef9;
    background: #fff;
}

.chatbot-send {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, #754ef9, #5a35d6);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    flex-shrink: 0;
}

.chatbot-send:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(117, 78, 249, 0.4);
}

.chatbot-send svg {
    width: 18px;
    height: 18px;
    fill: #fff;
}

/* Mobile */
@media (max-width: 480px) {
    .chatbot-window {
        width: calc(100vw - 20px);
        right: 10px;
        bottom: 150px;
        max-height: 400px;
    }
    .chatbot-toggle {
        right: 15px;
        bottom: 85px;
        width: 56px;
        height: 56px;
    }
}
