/* AI Chat Component Styles */

.ai-chat-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    overflow: hidden;
}

.ai-chat-header {
    background: rgba(0,0,0,0.2);
    color: white;
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ai-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ai-chat-message {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    animation: ai-slide-in 0.3s ease-out;
}

@keyframes ai-slide-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.ai-chat-message-bubble {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 12px;
    word-wrap: break-word;
    line-height: 1.5;
    font-size: 0.95rem;
}

/* Assistant rich formatting */
.ai-chat-message.assistant .ai-chat-message-bubble {
    white-space: normal;
}

.ai-chat-assistant-summary {
    font-weight: 700;
    color: #111827;
    margin-bottom: 10px;
}

.ai-chat-assistant-heading {
    margin-top: 10px;
    margin-bottom: 6px;
    font-weight: 700;
    color: #374151;
}

.ai-chat-assistant-paragraph {
    margin: 0 0 8px 0;
}

.ai-chat-assistant-list {
    margin: 0 0 10px 18px;
    padding: 0;
}

.ai-chat-assistant-list li {
    margin-bottom: 6px;
}

.ai-chat-message.assistant .ai-chat-message-bubble {
    background: white;
    color: #1f2937;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.ai-chat-message.user .ai-chat-message-bubble {
    background: #4f46e5;
    color: white;
    border-bottom-right-radius: 4px;
}

.ai-chat-message-time {
    font-size: 0.75rem;
    opacity: 0.8;
    margin-top: 4px;
}

.ai-chat-input-area {
    background: white;
    padding: 16px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ai-chat-input-row {
    display: flex;
    gap: 12px;
    align-items: center;
}

.ai-chat-disclaimer {
    color: #6b7280;
    font-size: 0.8rem;
}

.ai-chat-suggestions {
    width: 100%;
    max-width: 720px;
}

.ai-chat-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.ai-chat-chip {
    border: 1px solid rgba(0,0,0,0.08);
    background: rgba(255,255,255,0.85);
    color: #111827;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: transform 0.05s ease, box-shadow 0.2s ease;
}

.ai-chat-chip:hover {
    box-shadow: 0 3px 12px rgba(0,0,0,0.08);
    transform: translateY(-1px);
}

.ai-chat-chip-secondary {
    background: #f3f4f6;
}

.ai-chat-input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 24px;
    padding: 10px 16px;
    font-size: 0.95rem;
    transition: border-color 0.2s;
}

.ai-chat-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.ai-chat-send-btn {
    background: #3f51d6;
    color: white;
    border: none;
    border-radius: 24px;
    padding: 10px 24px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s;
}

.ai-chat-send-btn:hover:not(:disabled) {
    background: #3344c8;
}

.ai-chat-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ai-chat-session-list {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    max-height: 400px;
    overflow-y: auto;
}

.ai-chat-session-item {
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background 0.2s;
}

.ai-chat-session-item:hover {
    background: #f9f9f9;
}

.ai-chat-session-item.active {
    background: #e8eaf6;
    border-left: 4px solid #667eea;
}

.ai-chat-loading-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    font-weight: 500;
    background: rgba(0,0,0,0.25);
    padding: 8px 12px;
    border-radius: 999px;
}

.ai-chat-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: ai-spin 0.6s linear infinite;
}

@keyframes ai-spin {
    to { 
        transform: rotate(360deg); 
    }
}

.ai-chat-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #999;
    gap: 12px;
}

.ai-chat-empty-state i {
    font-size: 3rem;
    opacity: 0.5;
}

.ai-chat-error-message {
    background: #fee;
    color: #c33;
    padding: 12px;
    border-radius: 8px;
    border-left: 4px solid #c33;
    margin-bottom: 12px;
}

.ai-brain-icon {
    color: #667eea;
    margin-right: 8px;
}

.ai-user-icon {
    color: #667eea;
    margin-right: 8px;
}
