/* Chatbot Component Styles */

/* Shims for Tailwind CSS compatibility on Landing Page */
.d-none { display: none !important; }
.d-flex { display: flex !important; }
.align-items-center { align-items: center !important; }
.justify-content-between { justify-content: space-between !important; }
.justify-content-center { justify-content: center !important; }
.rounded-circle, .rounded-pill { border-radius: 50rem !important; }
.shadow-sm { box-shadow: 0 .125rem .25rem rgba(0,0,0,.075) !important; }
.shadow-lg { box-shadow: 0 1rem 3rem rgba(0,0,0,.175) !important; }
.border-top { border-top: 1px solid #dee2e6 !important; }
.px-3 { padding-left: 1rem !important; padding-right: 1rem !important; }
.py-3 { padding-top: 1rem !important; padding-bottom: 1rem !important; }
.py-2 { padding-top: 0.5rem !important; padding-bottom: 0.5rem !important; }
.p-3 { padding: 1rem !important; }
.p-2 { padding: 0.5rem !important; }
.p-0 { padding: 0 !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-0 { margin-bottom: 0 !important; }
.gap-1 { gap: 0.25rem !important; }
.gap-2 { gap: 0.5rem !important; }
.fw-bold { font-weight: 700 !important; }
.text-white { color: #fff !important; }
.small { font-size: 0.875em !important; }
.bg-white { background-color: #fff !important; }
.form-control { display: block !important; width: 100% !important; border: 1px solid #dee2e6 !important; outline: none !important; }
.form-control:focus { border-color: var(--chatbot-primary) !important; box-shadow: 0 0 0 0.2rem rgba(var(--chatbot-primary), 0.25) !important; }
.btn { display: inline-block !important; font-weight: 400 !important; text-align: center !important; vertical-align: middle !important; cursor: pointer !important; border: 1px solid transparent !important; }
.btn-link { color: var(--chatbot-primary) !important; text-decoration: none !important; background: none !important; }
.btn-primary { color: #fff !important; background-color: var(--chatbot-primary) !important; border-color: var(--chatbot-primary) !important; }

.chatbot-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
}
.chatbot-toggle-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: var(--chatbot-primary);
    color: white;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.chatbot-toggle-btn:hover {
    transform: scale(1.1) rotate(5deg);
    filter: brightness(1.1);
}
.chatbot-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    height: 500px;
    background-color: white;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.3s ease;
    transform-origin: bottom right;
}
.chatbot-header {
    background-color: var(--chatbot-primary);
    background: linear-gradient(135deg, var(--chatbot-primary) 0%, rgba(0,0,0,0.1) 100%);
}
#chatbot-send-btn {
    background-color: var(--chatbot-primary);
}
.online-indicator {
    width: 8px;
    height: 8px;
    background-color: #22c55e;
    border-radius: 50%;
    display: inline-block;
}
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    background-color: #f8fafc;
    scroll-behavior: smooth;
}

/* Markdown Styling inside bubbles */
.message-bubble {
    max-width: 85%;
    word-wrap: break-word;
    line-height: 1.5;
}
.message-bubble p:last-child { margin-bottom: 0; }
.message-bubble ul, .message-bubble ol { 
    padding-left: 1.25rem; 
    margin-bottom: 0.5rem;
    margin-top: 0.5rem;
}
.message-bubble code {
    background: rgba(0,0,0,0.05);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.9em;
}
.message-bubble pre {
    background: #f1f5f9;
    padding: 0.75rem;
    border-radius: 8px;
    overflow-x: auto;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
    border: 1px solid rgba(0,0,0,0.05);
}
.message-bubble pre code {
    background: none;
    padding: 0;
}

.user-message {
    display: flex;
    justify-content: flex-end;
}
.user-message .message-bubble {
    background-color: var(--chatbot-user-bg);
    color: var(--chatbot-user-text);
    border-radius: var(--chatbot-radius) var(--chatbot-radius) 4px var(--chatbot-radius);
}
.bot-message .message-bubble {
    background-color: var(--chatbot-bot-bg);
    color: var(--chatbot-bot-text);
    border-radius: var(--chatbot-radius) var(--chatbot-radius) var(--chatbot-radius) 4px;
    border: 1px solid rgba(0,0,0,0.05);
}

/* Typing Animation */
.typing {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
}
.typing .dot {
    width: 6px;
    height: 6px;
    background-color: var(--chatbot-primary);
    border-radius: 50%;
    opacity: 0.4;
    animation: typingAnimation 1.4s infinite;
}
.typing .dot:nth-child(2) { animation-delay: 0.2s; }
.typing .dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingAnimation {
    0%, 100% { transform: translateY(0); opacity: 0.4; }
    50% { transform: translateY(-4px); opacity: 1; }
}
