/* ==========================================================================
   Chat Interface Styles
   ========================================================================== */

.chat-container {
    background: #fff;
    border: 1px solid #e8e8f0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 2rem;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}

.chat-messages {
    height: 450px;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.chat-message {
    display: flex;
    gap: 0.75rem;
    max-width: 85%;
    animation: fadeInUp 0.3s ease-out;
}

.bot-message {
    align-self: flex-start;
}

.user-message {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
}

.bot-message .message-avatar {
    background: linear-gradient(135deg, #6c63ff, #5a52d5);
    color: #fff;
}

.user-message .message-avatar {
    background: #1a1a2e;
    color: #fff;
}

.message-content {
    background: #f5f5fa;
    padding: 0.85rem 1.15rem;
    border-radius: 12px;
    font-size: 0.95rem;
    line-height: 1.65;
}

.user-message .message-content {
    background: #1a1a2e;
    color: #fff;
}

.message-content p {
    margin: 0 0 0.5rem;
}

.message-content p:last-child {
    margin-bottom: 0;
}

.message-sources {
    margin-top: 0.75rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(0,0,0,0.08);
    font-size: 0.8rem;
    color: #888;
}

.message-sources strong {
    color: #666;
}

/* Typing indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 0.5rem 0;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #6c63ff;
    animation: typingBounce 1.4s ease-in-out infinite;
}

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

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

/* Input area */
.chat-input-form {
    display: flex;
    border-top: 1px solid #e8e8f0;
    background: #fafafa;
}

.chat-input {
    flex: 1;
    border: none;
    padding: 1rem 1.25rem;
    font-size: 0.95rem;
    font-family: 'Inter', sans-serif;
    background: transparent;
    outline: none;
}

.chat-input::placeholder {
    color: #aaa;
}

.chat-send {
    background: #6c63ff;
    color: #fff;
    border: none;
    padding: 1rem 1.75rem;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: background 0.2s;
}

.chat-send:hover {
    background: #5a52d5;
}

.chat-send:disabled {
    background: #b8b8d0;
    cursor: not-allowed;
}

/* Info footer */
.chat-info {
    text-align: center;
    padding: 1rem 0 2rem;
}

.chat-info p {
    font-size: 0.85rem;
    color: #888;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Error message */
.error-message .message-content {
    background: #fff0f0;
    color: #cc3333;
    border: 1px solid #ffdddd;
}

/* Responsive */
@media (max-width: 768px) {
    .chat-messages {
        height: 350px;
        padding: 1rem;
    }

    .chat-message {
        max-width: 95%;
    }

    .message-avatar {
        width: 30px;
        height: 30px;
        font-size: 0.65rem;
    }
}
