/* frontend/css/chat.css */

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.chat-actions {
    display: flex;
    gap: 0.5rem;
}

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

.welcome-message {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
}

.welcome-card {
    text-align: center;
    max-width: 400px;
    padding: 2rem;
}

.ai-avatar {
    width: 80px;
    height: 80px;
    background: var(--accent-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2rem;
    color: white;
}

.welcome-card h3 {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.welcome-card p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.suggestions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.suggestion-chip {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-light);
    background: var(--bg-glass);
    color: var(--text-primary);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.suggestion-chip:hover {
    background: var(--bg-glass-hover);
    border-color: var(--accent-primary);
}

.chat-input-container {
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-light);
}

.input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 0.75rem;
    background: var(--bg-glass);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 0.75rem;
    backdrop-filter: blur(20px);
}

#message-input {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 0.95rem;
    resize: none;
    outline: none;
    max-height: 120px;
    line-height: 1.5;
}

#message-input::placeholder {
    color: var(--text-muted);
}

.send-btn {
    background: var(--accent-gradient);
    border: none;
    border-radius: 12px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.send-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

/* Messages */
.message {
    margin-bottom: 1.5rem;
    animation: messageSlide 0.3s ease-out;
}

@keyframes messageSlide {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.user-message {
    display: flex;
    justify-content: flex-end;
}

.assistant-message {
    display: flex;
    justify-content: flex-start;
}

.message-bubble {
    max-width: 70%;
    padding: 1rem 1.25rem;
    border-radius: 18px;
    position: relative;
}

.message-bubble.user {
    background: var(--accent-gradient);
    color: white;
    border-bottom-right-radius: 4px;
}

.message-bubble.assistant {
    background: var(--bg-glass);
    border: 1px solid var(--border-light);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
}

.message-content {
    line-height: 1.5;
}

.message-content strong { font-weight: 600; }
.message-content em { font-style: italic; }
.message-content code {
    background: rgba(255,255,255,0.1);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.875em;
}

.message-time {
    font-size: 0.75rem;
    opacity: 0.7;
    margin-top: 0.5rem;
}

.typing-indicator {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-secondary);
}

.typing-dots {
    display: flex;
    gap: 0.25rem;
}

.dot {
    width: 6px;
    height: 6px;
    background: var(--text-secondary);
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

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

@keyframes typing {
    0%, 80%, 100% { transform: scale(0.8); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

.message-sources {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.source-chip {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 12px;
    padding: 0.25rem 0.75rem;
    font-size: 0.85em;
}

[data-theme="light"] .source-chip {
    background: #e0e0e0;
    border-color: #ccc;
    color: #333;
}