/* Chatbot Variables */
:root {
    --chat-primary: #0078ff;
    --chat-bg: #0f172a;
    --chat-surface: rgba(30, 41, 59, 0.95);
    --chat-text: #f8fafc;
    --chat-sent: #0078ff;
    --chat-received: #334155;
    --chat-border: rgba(255, 255, 255, 0.1);
}

/* Floating Action Button */
.chatbot-fab {
    position: fixed;
    bottom: 20px;
    right: 90px;
    /* Left of WhatsApp button */
    /* width: 60px;  Removed fixed width */
    height: 60px;
    padding: 0 24px;
    /* Added padding for pill shape */
    background: var(--chat-primary);
    border-radius: 30px;
    /* Pill shape */
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 120, 255, 0.4);
    z-index: 9999;
    transition: transform 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.1);
    gap: 12px;
    /* Space between text and icon */
}

.chatbot-fab:hover {
    transform: scale(1.05);
    /* Slightly less scale for pill */
}

.fab-text {
    color: white;
    font-weight: 600;
    font-size: 16px;
    white-space: nowrap;
}

.chatbot-fab i {
    color: white;
    font-size: 28px;
}

/* Chat Container */
.chatbot-container {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 350px;
    height: 500px;
    background: var(--chat-surface);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    border: 1px solid var(--chat-border);
    display: none;
    /* Hidden by default */
    flex-direction: column;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    z-index: 9999;
    overflow: hidden;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header */
.chat-header {
    padding: 15px;
    background: linear-gradient(90deg, #0078ff, #00d2ff);
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-title h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    /* Added for alignment */
    align-items: center;
    /* Added for alignment */
    gap: 8px;
    /* Added for spacing */
}

.chat-title span {
    font-size: 12px;
    opacity: 0.9;
}

/* Online Dot */
.online-dot {
    width: 8px;
    height: 8px;
    background-color: #4ade80;
    /* Bright Green */
    border-radius: 50%;
    box-shadow: 0 0 8px #4ade80;
    display: inline-block;
}

/* Online Text */
.online-text {
    font-size: 12px;
    font-weight: 500;
    color: #e2e8f0;
}

.close-chat {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
}

/* Messages Area */
.chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.message {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
}

.message.bot {
    align-self: flex-start;
    background: var(--chat-received);
    color: var(--chat-text);
    border-bottom-left-radius: 2px;
}

.message.user {
    align-self: flex-end;
    background: var(--chat-sent);
    color: white;
    border-bottom-right-radius: 2px;
}

/* Input Area */
.chat-input-area {
    padding: 15px;
    background: rgba(15, 23, 42, 0.95);
    border-top: 1px solid var(--chat-border);
    display: flex;
    gap: 10px;
}

.chat-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--chat-border);
    border-radius: 20px;
    padding: 10px 15px;
    color: white;
    outline: none;
    font-size: 14px;
}

.chat-input::placeholder {
    color: #64748b;
}

.send-btn {
    background: var(--chat-primary);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background 0.2s;
}

.send-btn:hover {
    background: #0060cc;
}

.send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Typing Indicator */
.typing-indicator {
    display: none;
    gap: 4px;
    padding: 8px 12px;
    background: var(--chat-received);
    border-radius: 12px;
    align-self: flex-start;
    width: fit-content;
}

.dot {
    width: 6px;
    height: 6px;
    background: #94a3b8;
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

.dot:nth-child(1) {
    animation-delay: -0.32s;
}

.dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes bounce {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1);
    }
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .chatbot-container {
        width: 100%;
        height: 100%;
        bottom: 0;
        right: 0;
        border-radius: 0;
    }

    .chatbot-fab {
        right: 20px;
        bottom: 90px;
        /* Above WhatsApp on mobile if needed */
        /* Make it smaller on mobile if text is too wide? 
           For now keep it same unless user complains */
        padding: 0 16px;
    }

    .fab-text {
        font-size: 14px;
        /* Slightly smaller text on mobile */
    }
}