/* Enhanced Chatbot Loading and Knowledge Base Styles */

/* Cool loading animation for chat bubbles */
.message.thinking {
    position: relative;
    min-height: 45px;
    padding: 12px 16px;
    border-radius: 18px;
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    border: 1px solid #0ea5e9;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 12px rgba(14, 165, 233, 0.15);
    transition: all 0.3s ease;
    overflow: hidden;
}

.message.thinking::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(14, 165, 233, 0.1), transparent);
    animation: shimmer 2s infinite;
}

.message.thinking .loading-text {
    font-size: 15px;
    color: #0c4a6e;
    font-weight: 600;
    margin-right: 12px;
    opacity: 1;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.message.thinking::after {
    content: '';
    display: flex;
    width: 32px;
    height: 8px;
    position: relative;
    background: linear-gradient(90deg, #0ea5e9 33%, transparent 33%);
    background-size: 12px 8px;
    animation: loading-dots 1.5s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

@keyframes loading-dots {
    0%, 20% {
        background-position: 0 0;
        opacity: 1;
    }
    33% {
        background-position: -12px 0;
        opacity: 0.8;
    }
    66% {
        background-position: -24px 0;
        opacity: 0.6;
    }
    100% {
        background-position: -36px 0;
        opacity: 1;
    }
}

/* Knowledge base enhanced response indicator - moved to bottom */

/* Progressive loading states */
.message.thinking[data-stage="documentation"] {
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    border: 1px solid #10b981;
}

.message.thinking[data-stage="documentation"] .loading-text {
    color: #065f46;
}

.message.thinking[data-stage="searching"] {
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    border: 1px solid #3b82f6;
}

.message.thinking[data-stage="searching"] .loading-text {
    color: #1e40af;
}

.message.thinking[data-stage="processing"] {
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    border: 1px solid #0ea5e9;
}

.message.thinking[data-stage="processing"] .loading-text {
    color: #0c4a6e;
}

.message.thinking[data-stage="crafting"] {
    background: linear-gradient(135deg, #fef3e2, #fed7aa);
    border: 1px solid #f59e0b;
}

.message.thinking[data-stage="crafting"] .loading-text {
    color: #92400e;
}

.message.thinking[data-stage="finalizing"] {
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    border: 1px solid #22c55e;
}

.message.thinking[data-stage="finalizing"] .loading-text {
    color: #15803d;
}

/* Smooth transitions for message updates */
.message {
    transition: all 0.3s ease, transform 0.15s ease;
}

.message.thinking {
    animation: slideInLeft 0.3s ease-out;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Enhanced visual feedback for different message types */
.message.system.warning {
    background: rgba(251, 191, 36, 0.15);
    border-left: 3px solid #f59e0b;
    font-size: 0.9em;
    color: #92400e;
    font-weight: 500;
}

.message.system.error {
    background: rgba(239, 68, 68, 0.15);
    border-left: 3px solid #ef4444;
    font-size: 0.9em;
    color: #991b1b;
    font-weight: 500;
}

/* Knowledge base indicator badge enhancement */
.kb-indicator {
    animation: kb-glow 2s ease-in-out infinite alternate;
}

@keyframes kb-glow {
    from { box-shadow: 0 2px 4px rgba(16, 185, 129, 0.2); }
    to { box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4); }
}

/* Loading message variants for better UX */
.message.thinking.documentation-lookup {
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    border: 1px solid #10b981;
}

.message.thinking.documentation-lookup .loading-text {
    color: #065f46;
}

.message.thinking.documentation-lookup::after {
    background: linear-gradient(90deg, #059669 33%, transparent 33%);
    background-size: 12px 8px;
}

.message.thinking.standard-query {
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    border: 1px solid #0ea5e9;
}

.message.thinking.standard-query .loading-text {
    color: #0c4a6e;
}

.message.thinking.standard-query::after {
    background: linear-gradient(90deg, #0ea5e9 33%, transparent 33%);
    background-size: 12px 8px;
}

/* Better bubble styling for regular messages */
.message {
    max-width: 80%;
    word-wrap: break-word;
    line-height: 1.4;
    font-size: 15px;
    margin-bottom: 12px;
    padding: 10px 14px;
    border-radius: 18px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Ensure messages start from top without auto-scroll */
.chatbot-messages {
    overflow-y: auto;
    scroll-behavior: auto; /* Disable smooth scrolling to prevent auto-scroll interference */
}

.message.assistant {
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    border: 1px solid #e2e8f0;
    align-self: flex-start;
    color: #1e293b;
}

.message.user {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    align-self: flex-end;
    margin-left: auto;
}

/* Knowledge base messages use standard styling */

/* Responsive adjustments for mobile */
@media (max-width: 768px) {
    .message.thinking {
        min-height: 40px;
        padding: 10px 12px;
    }
    
    .message.thinking .loading-text {
        font-size: 14px;
        color: #0c4a6e;
        font-weight: 600;
    }
    
    .message.thinking::after {
        width: 28px;
        background: linear-gradient(90deg, #0ea5e9 33%, transparent 33%);
        background-size: 10px 6px;
    }
    
    .message {
        font-size: 14px;
        max-width: 85%;
    }
    

} 