/* Portfolio Chatbot — Dark theme matching portfolio */

/* Chat bubble trigger */
.chatbot-bubble {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8b5cf6, #6d28d9);
    border: none;
    cursor: pointer;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
}
.chatbot-bubble:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 28px rgba(139, 92, 246, 0.55);
}
.chatbot-bubble svg {
    width: 26px;
    height: 26px;
    fill: white;
}
.chatbot-bubble.open svg.chat-icon { display: none; }
.chatbot-bubble:not(.open) svg.close-icon { display: none; }

/* Chat panel */
.chatbot-panel {
    position: fixed;
    bottom: 92px;
    right: 24px;
    width: 380px;
    height: 520px;
    background: #12122a;
    border: 1px solid rgba(139, 92, 246, 0.25);
    border-radius: 16px;
    z-index: 9998;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
}
.chatbot-panel.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* Panel header */
.chatbot-header {
    background: linear-gradient(135deg, #1a1a3a, #252550);
    padding: 14px 16px;
    border-bottom: 1px solid rgba(139, 92, 246, 0.15);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.chatbot-header-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #22c55e;
    flex-shrink: 0;
}
.chatbot-header-title {
    font-size: 14px;
    font-weight: 600;
    color: #e0e0e0;
}
.chatbot-header-sub {
    font-size: 11px;
    color: #778;
    margin-left: auto;
}

/* Messages area */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scrollbar-width: thin;
    scrollbar-color: rgba(139,92,246,0.3) transparent;
}
.chatbot-messages::-webkit-scrollbar { width: 5px; }
.chatbot-messages::-webkit-scrollbar-track { background: transparent; }
.chatbot-messages::-webkit-scrollbar-thumb { background: rgba(139,92,246,0.3); border-radius: 3px; }

/* Message bubbles */
.chatbot-msg {
    max-width: 88%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 13px;
    line-height: 1.5;
    animation: chatbot-fadeIn 0.3s ease;
}
.chatbot-msg.bot {
    align-self: flex-start;
    background: rgba(139, 92, 246, 0.12);
    border: 1px solid rgba(139, 92, 246, 0.15);
    color: #d0d4e0;
    border-bottom-left-radius: 4px;
}
.chatbot-msg.user {
    align-self: flex-end;
    background: rgba(99, 60, 180, 0.3);
    border: 1px solid rgba(139, 92, 246, 0.2);
    color: #e8e0f8;
    border-bottom-right-radius: 4px;
}

/* Links inside messages */
.chatbot-msg a {
    color: #a78bfa;
    text-decoration: none;
    cursor: pointer;
}
.chatbot-msg a:hover {
    text-decoration: underline;
    color: #c4b5fd;
}

/* Project mini-card in messages */
.chatbot-project-card {
    background: rgba(30, 30, 60, 0.6);
    border: 1px solid rgba(139, 92, 246, 0.15);
    border-radius: 10px;
    padding: 10px 12px;
    margin-top: 8px;
}
.chatbot-project-card-title {
    font-size: 13px;
    font-weight: 600;
    color: #c4b5fd;
    cursor: pointer;
    margin-bottom: 4px;
}
.chatbot-project-card-title:hover { text-decoration: underline; }
.chatbot-project-card-desc {
    font-size: 12px;
    color: #94a3b8;
    line-height: 1.4;
    margin-bottom: 6px;
}
.chatbot-project-card-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.chatbot-tech-badge {
    font-size: 10px;
    padding: 2px 7px;
    border-radius: 4px;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.2);
    color: #a78bfa;
}
.chatbot-project-links {
    display: flex;
    gap: 8px;
    margin-top: 6px;
}
.chatbot-project-links a {
    font-size: 11px;
    color: #67e8f9;
    text-decoration: none;
}
.chatbot-project-links a:hover { text-decoration: underline; }

/* Suggestion pills */
.chatbot-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}
.chatbot-pill {
    font-size: 12px;
    padding: 5px 12px;
    border-radius: 16px;
    background: rgba(139, 92, 246, 0.08);
    border: 1px solid rgba(139, 92, 246, 0.25);
    color: #a78bfa;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.chatbot-pill:hover {
    background: rgba(139, 92, 246, 0.2);
    border-color: rgba(139, 92, 246, 0.5);
}

/* Typing indicator */
.chatbot-typing {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 10px 14px;
    align-self: flex-start;
}
.chatbot-typing-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #8b5cf6;
    animation: chatbot-typingBounce 1.2s ease-in-out infinite;
}
.chatbot-typing-dot:nth-child(2) { animation-delay: 0.15s; }
.chatbot-typing-dot:nth-child(3) { animation-delay: 0.3s; }

/* Input area */
.chatbot-input-area {
    padding: 12px 14px;
    border-top: 1px solid rgba(139, 92, 246, 0.12);
    background: rgba(18, 18, 42, 0.9);
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}
.chatbot-input {
    flex: 1;
    background: rgba(30, 30, 60, 0.6);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 10px;
    padding: 9px 14px;
    color: #e0e0e0;
    font-size: 13px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}
.chatbot-input::placeholder { color: #556; }
.chatbot-input:focus { border-color: rgba(139, 92, 246, 0.5); }

.chatbot-send {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, #8b5cf6, #6d28d9);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: opacity 0.15s;
}
.chatbot-send:hover { opacity: 0.85; }
.chatbot-send svg { width: 18px; height: 18px; fill: white; }

/* Animations */
@keyframes chatbot-fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes chatbot-typingBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-5px); opacity: 1; }
}

/* Category list */
.chatbot-category-list {
    list-style: none;
    padding: 0;
    margin: 6px 0 0;
}
.chatbot-category-list li {
    padding: 3px 0;
    font-size: 12px;
}
.chatbot-category-list li a {
    color: #67e8f9;
    cursor: pointer;
    text-decoration: none;
}
.chatbot-category-list li a:hover { text-decoration: underline; }

/* Mobile responsive */
@media (max-width: 700px) {
    .chatbot-panel {
        bottom: 0;
        right: 0;
        width: 100%;
        height: 100%;
        border-radius: 0;
        border: none;
    }
    .chatbot-bubble {
        bottom: 16px;
        right: 16px;
    }
}
