/* AfroAI Chatbot Styles */

.chatbot-toggle {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00d4ff, #7c3aed);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 212, 255, 0.35);
    transition: all 0.3s ease;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.chatbot-toggle.hidden {
    opacity: 0;
    pointer-events: none;
}

.chatbot-toggle-icon {
    font-size: 26px;
}

/* Container */
.chatbot-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 400px;
    height: 580px;
    background: #0f1628;
    border: 1px solid #1e2d50;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: 1000;
    font-family: 'Syne', 'Segoe UI', sans-serif;
}

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

/* Header */
.chatbot-header {
    background: #141d35;
    padding: 14px 16px;
    border-radius: 16px 16px 0 0;
    border-bottom: 1px solid #1e2d50;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.chatbot-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chatbot-icon {
    font-size: 22px;
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, #00d4ff, #7c3aed);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.chatbot-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: #e2e8f0;
}

.chatbot-status {
    font-size: 0.72rem;
    color: #10b981;
    font-weight: 600;
}

.chatbot-close {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid #1e2d50;
    color: #94a3b8;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.chatbot-close:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

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

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

/* Welcome */
.chatbot-welcome {
    text-align: center;
    padding: 1.5rem 1rem;
    animation: fadeUp 0.4s ease;
}

.welcome-icon {
    font-size: 2.5rem;
    margin-bottom: 0.8rem;
}

.chatbot-welcome p {
    color: #94a3b8;
    font-size: 0.85rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.quick-prompts {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
}

.quick-prompt {
    background: #141d35;
    border: 1px solid #1e2d50;
    color: #94a3b8;
    font-size: 0.72rem;
    padding: 6px 12px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.18s;
    font-family: 'Space Mono', monospace;
}

.quick-prompt:hover {
    border-color: #00d4ff;
    color: #00d4ff;
    background: rgba(0, 212, 255, 0.06);
}

/* Message bubbles */
.chatbot-message {
    display: flex;
    gap: 8px;
    animation: fadeUp 0.3s ease;
}

.chatbot-message.user-message {
    flex-direction: row-reverse;
}

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

.msg-avatar {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
    margin-top: 2px;
    background: #141d35;
    border: 1px solid #1e2d50;
}

.ai-message .msg-avatar {
    background: linear-gradient(135deg, #00d4ff, #7c3aed);
    border: none;
}

.msg-bubble {
    max-width: 78%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 0.85rem;
    line-height: 1.65;
    word-wrap: break-word;
}

.ai-message .msg-bubble {
    background: #141d35;
    border: 1px solid #1e2d50;
    border-top-left-radius: 4px;
    color: #e2e8f0;
}

.user-message .msg-bubble {
    background: linear-gradient(135deg, rgba(0,212,255,0.15), rgba(124,58,237,0.15));
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-top-right-radius: 4px;
    color: #e2e8f0;
}

/* Code in messages */
.msg-bubble pre {
    background: #0a0e1a;
    border: 1px solid #1e2d50;
    border-radius: 8px;
    padding: 10px;
    margin: 8px 0;
    overflow-x: auto;
    font-family: 'Space Mono', monospace;
    font-size: 0.75rem;
    line-height: 1.6;
    color: #00d4ff;
}

.msg-bubble code {
    font-family: 'Space Mono', monospace;
    background: rgba(0, 212, 255, 0.1);
    color: #00d4ff;
    padding: 2px 5px;
    border-radius: 4px;
    font-size: 0.8em;
}

/* Typing dots */
.typing-dots {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 12px 14px;
}

.typing-dots span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #00d4ff;
    animation: bounce 1.2s infinite;
}

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

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

/* Input area */
.chatbot-input-container {
    padding: 10px 12px 6px;
    border-top: 1px solid #1e2d50;
    background: #141d35;
    display: flex;
    gap: 8px;
    align-items: flex-end;
    flex-shrink: 0;
}

.chatbot-input {
    flex: 1;
    background: #0a0e1a;
    border: 1px solid #1e2d50;
    color: #e2e8f0;
    font-family: 'Syne', 'Segoe UI', sans-serif;
    font-size: 0.85rem;
    padding: 10px 14px;
    border-radius: 10px;
    outline: none;
    resize: none;
    min-height: 42px;
    max-height: 120px;
    line-height: 1.5;
    transition: border-color 0.2s;
    overflow-y: auto;
}

.chatbot-input:focus {
    border-color: #00d4ff;
}

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

.chatbot-send {
    background: linear-gradient(135deg, #00d4ff, #0099bb);
    border: none;
    color: #000;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
    transition: all 0.2s;
    flex-shrink: 0;
}

.chatbot-send:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 4px 16px rgba(0, 212, 255, 0.35);
}

.chatbot-send:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.chatbot-hint {
    padding: 4px 12px 10px;
    font-size: 0.65rem;
    color: #64748b;
    background: #141d35;
    border-radius: 0 0 16px 16px;
    font-family: 'Space Mono', monospace;
    flex-shrink: 0;
}

/* Toast */
.chatbot-toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 0.83rem;
    font-weight: 600;
    z-index: 1100;
    animation: fadeUp 0.3s ease;
    backdrop-filter: blur(10px);
    white-space: nowrap;
}

/* Mobile */
@media (max-width: 480px) {
    .chatbot-container {
        width: calc(100vw - 20px);
        height: calc(100vh - 20px);
        bottom: 10px;
        right: 10px;
        border-radius: 12px;
    }

    .chatbot-toggle {
        bottom: 20px;
        right: 20px;
        width: 54px;
        height: 54px;
    }
}
