/* ==========================================
   Chatbot Widget — Neon Style
   ========================================== */

.chatbot-toggle {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--gradient-main);
    border: none;
    cursor: pointer;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    box-shadow: 0 4px 20px rgba(0, 212, 255, 0.4);
    transition: var(--transition);
    animation: glow 2s ease infinite;
}

.chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(0, 212, 255, 0.5);
}

.chatbot-window {
    position: fixed;
    bottom: 100px;
    right: 24px;
    width: 380px;
    height: 520px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-xl);
    z-index: 9998;
    display: none;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: fadeInUp 0.3s ease;
}

.chatbot-window.open {
    display: flex;
}

/* Header */
.chatbot-header {
    background: var(--gradient-main);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.chatbot-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chatbot-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.chatbot-header-text h4 {
    color: white;
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0;
}

.chatbot-header-text p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.75rem;
    margin: 0;
}

.chatbot-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.3rem;
    cursor: pointer;
    padding: 4px;
    opacity: 0.7;
    transition: var(--transition);
}

.chatbot-close:hover {
    opacity: 1;
}

/* Messages */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chatbot-messages::-webkit-scrollbar {
    width: 4px;
}

.chatbot-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: var(--border-glass);
    border-radius: 4px;
}

.chat-message {
    display: flex;
    gap: 8px;
    animation: fadeInUp 0.3s ease;
}

.chat-message.bot {
    align-self: flex-start;
    max-width: 85%;
}

.chat-message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
    max-width: 85%;
}

.chat-message .msg-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.chat-message.bot .msg-avatar {
    background: var(--gradient-card);
    color: var(--neon-blue);
}

.chat-message.user .msg-avatar {
    background: rgba(139, 92, 246, 0.2);
    color: var(--neon-purple);
}

.chat-bubble {
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 0.88rem;
    line-height: 1.5;
}

.chat-message.bot .chat-bubble {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
    border-top-left-radius: 4px;
}

.chat-message.user .chat-bubble {
    background: var(--gradient-main);
    color: white;
    border-top-right-radius: 4px;
}

.chat-time {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 4px;
    padding: 0 4px;
}

.chat-message.user .chat-time {
    text-align: right;
}

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

.typing-indicator span {
    width: 6px;
    height: 6px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: typing 1.4s ease infinite;
}

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

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

/* Input */
.chatbot-input {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid var(--border-glass);
    background: var(--bg-primary);
    flex-shrink: 0;
}

.chatbot-input input {
    flex: 1;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: 24px;
    padding: 10px 18px;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.88rem;
    outline: none;
    transition: var(--transition);
}

.chatbot-input input:focus {
    border-color: var(--neon-blue);
}

.chatbot-input input::placeholder {
    color: var(--text-muted);
}

.chatbot-input button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gradient-main);
    border: none;
    color: white;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
}

.chatbot-input button:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.3);
}

.chatbot-input button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Welcome message */
.chat-welcome {
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.chat-welcome .welcome-icon {
    font-size: 2.5rem;
    margin-bottom: 8px;
}

/* Responsive */
@media (max-width: 480px) {
    .chatbot-window {
        width: calc(100% - 16px);
        height: calc(100% - 120px);
        right: 8px;
        bottom: 90px;
        border-radius: var(--radius-lg);
    }
}
