/* AIChatInput Global Styles */

/* Fix line breaks - override Lexical's flex display on paragraphs */
.ai-chat-editor .lexical-paragraph,
.ai-chat-editor p {
    display: block !important;
    margin: 0;
    padding: 0;
}

/* Ensure line breaks work correctly */
.ai-chat-editor br {
    display: block;
    content: "";
    margin: 0.25em 0;
}

/* Container */
.ai-chat-input-container {
    position: relative;
    width: 100%;
}

/* Editor styling - aligned with QInputText */
.ai-chat-editor {
    border: 1px solid var(--use-stroke-neutral-1, #e5e7eb);
    border-radius: 0.5rem;
    padding: 0.75rem;
    min-height: 40px;
    max-height: 150px;
    overflow-y: auto;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    background: var(--use-background-default, #ffffff);
}

.ai-chat-editor:focus-within {
    outline: none;
    border-color: var(--use-stroke-brand-1, #3b82f6);
    box-shadow: 0 0 0 3px var(--use-background-brand-subtle, rgba(59, 130, 246, 0.1));
}

.ai-chat-editor.theme-compact {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    line-height: 1.5;
}

/* Placeholder styling */
.ai-chat-editor .lexical-placeholder {
    color: var(--use-text-neutral-3, #9ca3af);
    font-size: 0.875rem;
}

/* Mention dropdown menu - reuse from qchat-input */
.lexical-mention-dropdown {
    background: var(--use-background-default, white);
    border: 1px solid var(--use-stroke-neutral-1, #e5e7eb);
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    max-height: 250px;
    overflow-y: auto;
    padding: 0.25rem;
    z-index: 1000;
}

/* Mention item */
.lexical-mention-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: background-color 0.15s ease-in-out;
}

.lexical-mention-item:hover {
    background-color: var(--use-background-neutral-subtle, #f3f4f6);
}

.lexical-mention-item.selected {
    background-color: var(--use-background-brand-subtle, #dbeafe);
}

/* Avatar placeholder for people mentions */
.lexical-mention-avatar-placeholder {
    width: 2rem;
    height: 2rem;
    border-radius: 9999px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    flex-shrink: 0;
}

/* Text container */
.lexical-mention-text {
    flex: 1;
    min-width: 0;
}

/* Mention name */
.lexical-mention-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--use-text-default, #111827);
    line-height: 1.25;
}

/* Mention type/description */
.lexical-mention-type {
    font-size: 0.75rem;
    color: var(--use-text-neutral-2, #6b7280);
    line-height: 1.25;
}

/* Calendar mention icon */
.lexical-calendar-mention-icon {
    width: 2rem;
    height: 2rem;
    border-radius: 0.375rem;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

/* Event mention icon */
.lexical-event-mention-icon {
    width: 2rem;
    height: 2rem;
    border-radius: 0.375rem;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

/* Attachment mention icon */
.lexical-attachment-mention-icon {
    width: 2rem;
    height: 2rem;
    border-radius: 0.375rem;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

/* Inline mention chips in editor */
.lexical-mention-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    user-select: none;
}

.lexical-mention-chip.person {
    background-color: var(--use-background-brand-subtle, #dbeafe);
    color: var(--use-text-brand, #1d4ed8);
}

.lexical-mention-chip.calendar {
    background-color: rgba(16, 185, 129, 0.1);
    color: #059669;
}

.lexical-mention-chip.event {
    background-color: rgba(245, 158, 11, 0.1);
    color: #d97706;
}

.lexical-mention-chip.attachment {
    background-color: rgba(99, 102, 241, 0.1);
    color: #4f46e5;
}

/* Disabled state */
.ai-chat-editor[aria-disabled="true"] {
    background-color: var(--use-background-neutral-subtle, #f9fafb);
    cursor: not-allowed;
    opacity: 0.6;
}

.aichat-message .lexical-editor {
    --blexycal-min-height:0;
}
