/* AI Chatbot Search-Style UI */

.ai-chatbot-container {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 600px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Floating Search Bar (Pill) */
.ai-search-pill {
    width: 100%;
    background: rgba(15, 15, 15, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 9999px;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(108, 133, 120, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
}

.ai-search-pill:hover {
    border-color: rgba(108, 133, 120, 0.5);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6), 0 0 30px rgba(108, 133, 120, 0.2);
    transform: translateY(-2px);
}

.ai-search-pill input {
    background: transparent;
    border: none;
    color: white;
    flex: 1;
    min-width: 0;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    outline: none;
}

.ai-search-pill input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.ai-search-icon {
    color: #6C8578;
    width: 20px;
    height: 20px;
}

/* Chat Window (Expanded) */
.ai-chat-window {
    width: 100%;
    background: rgba(15, 15, 15, 0.95);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    margin-bottom: 1rem;
    height: 0;
    opacity: 0;
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.ai-chatbot-container.expanded .ai-chat-window {
    height: 500px;
    opacity: 1;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
}

.ai-chatbot-container.expanded .ai-search-pill {
    border-radius: 20px;
}

/* Messages Area */
.ai-messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

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

.ai-messages-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.ai-message {
    max-width: 85%;
    line-height: 1.5;
    font-size: 0.95rem;
}

.ai-message.user {
    align-self: flex-end;
    background: #6C8578;
    color: white;
    padding: 0.75rem 1.25rem;
    border-radius: 18px 18px 2px 18px;
    box-shadow: 0 5px 15px rgba(108, 133, 120, 0.2);
}

.ai-message.ai {
    align-self: flex-start;
    color: rgba(255, 255, 255, 0.9);
    display: flex;
    gap: 0.75rem;
}

.ai-avatar {
    width: 28px;
    height: 28px;
    background: #1A1A1A;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Typing Indicator */
.typing-dots {
    display: flex;
    gap: 4px;
    padding: 10px;
}

.typing-dots span {
    width: 6px;
    height: 6px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

.typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.typing-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1.0); }
}

/* Markdown styling for AI responses */
.ai-message.ai p { margin-bottom: 0.75rem; }
.ai-message.ai p:last-child { margin-bottom: 0; }
.ai-message.ai code { 
    background: rgba(255, 255, 255, 0.05); 
    padding: 0.2rem 0.4rem; 
    border-radius: 4px; 
    font-size: 0.85em; 
}
