/* Chat Widget Styles */

/* Hide old chat widget if present */
#chat-widget {
    display: none !important;
}

/* Optimized scrollbar for better space usage */
.chat-messages {
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) transparent;
}
.chat-messages::-webkit-scrollbar {
    width: var(--scrollbar-size-sm, 6px);
}
.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}
.chat-messages::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 4px;
}
.chat-messages::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb-hover);
}

.chat-widget-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
}

.chat-widget-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: var(--accent);
    color: var(--text-on-accent);
    border: none;
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.3s ease;
}

.chat-widget-button:hover {
    background-color: var(--accent-hover);
    transform: scale(1.05);
}

.chat-widget-button i {
    font-size: 24px;
    color: var(--text-on-accent);
}

.chat-unread-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: var(--status-error);
    color: var(--text-on-accent);
    font-size: 11px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

.chat-widget-panel {
    position: absolute;
    bottom: 70px;
    right: 0;
    width: 500px;
    height: 85vh;
    max-height: 800px;
    background-color: var(--bg-surface-1);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow-xl);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 9999;
    min-width: 350px;
    max-width: 50vw;
}

/* Resize handle styling */
.chat-resize-handle {
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    cursor: ew-resize;
    background: transparent;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.chat-resize-handle:hover,
.chat-widget-panel:hover .chat-resize-handle {
    opacity: 1;
    background: var(--accent);
}

.chat-resize-handle::before {
    content: '';
    position: absolute;
    left: -2px;
    top: 0;
    width: 8px;
    height: 100%;
}

.chat-widget-container.expanded .chat-widget-panel {
    display: flex;
}

.chat-widget-container.expanded .chat-widget-button {
    background-color: var(--accent-active);
}

/* Maximized state */
.chat-widget-container.maximized .chat-widget-panel {
    width: 50vw;
    max-width: 50vw;
    height: 90vh;
    max-height: 90vh;
    bottom: 5vh;
    border-radius: 0;
    resize: none;
}

.chat-widget-container.maximized .chat-widget-panel::after {
    display: none;
}

.chat-header {
    padding: 12px 16px;
    background-color: var(--accent);
    color: var(--text-on-accent);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 12px 12px 0 0;
    flex-shrink: 0;
}

.chat-title {
    margin: 0;
    font-size: 15px;
    font-weight: 500;
}

.chat-header-actions {
    display: flex;
    gap: 5px;
}

.chat-header-actions button {
    background: none;
    border: none;
    color: var(--text-on-accent);
    padding: 5px;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.chat-header-actions button:hover {
    opacity: 1;
}

.chat-active-users {
    padding: 6px 12px;
    background-color: var(--bg-surface-1);
    border-bottom: 1px solid var(--border);
    font-size: 11px;
    flex-shrink: 0;
}

.chat-messages-container {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
}

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

.chat-message {
    display: flex;
    flex-direction: column;
    max-width: 75%;
    animation: slideIn 0.3s ease;
}

/* Consecutive messages from same user */
.chat-message.same-user {
    margin-top: 2px;
}

.chat-message.same-user .message-header {
    display: none;
}

.chat-message.same-user .message-content {
    border-radius: 4px 16px 16px 16px;
}

.chat-message.same-user.own-message .message-content {
    border-radius: 16px 4px 16px 16px;
}

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

.chat-message.own-message {
    align-self: flex-end;
}

.message-header {
    display: flex;
    gap: 6px;
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 2px;
}

.message-author {
    font-weight: 500;
}

.message-time {
    opacity: 0.7;
}

.message-edited {
    font-style: italic;
    opacity: 0.7;
}

.message-content {
    background-color: var(--bg-surface-2);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: 16px;
    word-wrap: break-word;
    font-size: 14px;
    line-height: 1.4;
}

.own-message .message-content {
    background-color: var(--accent);
    color: var(--text-on-accent);
}

.message-attachments {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.attachment-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 8px;
    background-color: var(--bg-surface-2);
    border-radius: 6px;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 12px;
    transition: background-color 0.2s;
}

.attachment-link:hover {
    background-color: var(--bg-surface-3);
}

.message-actions {
    opacity: 0;
    display: flex;
    gap: 4px;
    margin-top: 4px;
    transition: opacity 0.2s;
}

.chat-message:hover .message-actions {
    opacity: 1;
}

.message-actions button {
    background: none;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 3px 8px;
    font-size: 11px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.message-actions button:hover {
    background-color: var(--border);
    color: var(--text-secondary);
    transform: translateY(-1px);
}

.message-actions button i {
    font-size: 12px;
}

/* Slack-like inline edit */
.message-content.editing {
    background-color: transparent !important;
    padding: 0 !important;
}

.message-edit-inline {
    width: 100%;
}

.message-edit-textarea {
    width: 100%;
    padding: 8px 12px;
    border: 2px solid var(--border-emphasis);
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.5;
    font-family: inherit;
    resize: none;
    min-height: 36px;
    background-color: var(--bg-inset);
    color: var(--text-primary);
    transition: all 0.2s;
}

.message-edit-textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-subtle);
}

.message-edit-textarea.saving {
    opacity: 0.6;
    cursor: not-allowed;
}

.message-edit-hint {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-secondary);
}

.message-edit-hint a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
}

.message-edit-hint a:hover {
    text-decoration: underline;
}

.message-edit-hint .separator {
    color: var(--border);
}

/* Markdown rendering in messages */
.message-content h1,
.message-content h2,
.message-content h3,
.message-content h4,
.message-content h5,
.message-content h6 {
    margin: 0.5em 0;
    font-weight: 600;
}

.message-content h1 { font-size: 1.5em; }
.message-content h2 { font-size: 1.3em; }
.message-content h3 { font-size: 1.1em; }
.message-content h4 { font-size: 1em; }
.message-content h5 { font-size: 0.9em; }
.message-content h6 { font-size: 0.85em; }

.message-content p {
    margin: 0;
}

.message-content p + p {
    margin-top: 0.5em;
}

.message-content strong {
    font-weight: 600;
}

.message-content em {
    font-style: italic;
}

.message-content s,
.message-content del {
    text-decoration: line-through;
    opacity: 0.7;
}

/* Inline code */
.message-content code {
    background-color: var(--bg-inset);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: var(--font-mono);
    font-size: 0.85em;
    color: var(--status-error);
}

/* Code blocks */
.message-content pre {
    background-color: var(--bg-surface-2);
    padding: 16px;
    border-radius: 6px;
    overflow-x: auto;
    line-height: 1.45;
    border: 1px solid var(--border);
    margin: 8px 0;
}

.message-content pre code {
    background-color: transparent;
    padding: 0;
    color: var(--text-primary);
    font-size: 0.85em;
    display: block;
}

/* Syntax highlighting classes */
.message-content .codehilite {
    background-color: var(--bg-surface-2);
    padding: 16px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 8px 0;
}

.message-content .codehilite pre {
    margin: 0;
    padding: 0;
    background: none;
    border: none;
}

/* @mentions */
.message-content .mention {
    background-color: var(--status-info-subtle);
    color: var(--status-info);
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.message-content .mention:hover {
    background-color: var(--status-info-subtle);
    text-decoration: underline;
}

/* @channel and @all mentions - special styling */
.message-content .mention-channel {
    background-color: var(--status-warning-subtle);
    color: var(--status-warning);
    font-weight: 600;
}

.message-content .mention-channel:hover {
    background-color: var(--status-warning-subtle);
}

.message-content ul,
.message-content ol {
    margin: 0.5em 0;
    padding-left: 1.5em;
}

.message-content blockquote {
    margin: 0.5em 0;
    padding-left: 1em;
    border-left: 3px solid var(--border);
    color: var(--text-secondary);
}

.message-content a {
    color: var(--status-info);
    text-decoration: none;
}

.message-content a:hover {
    text-decoration: underline;
}

/* Own messages markdown */
.own-message .message-content code {
    background-color: rgba(255, 255, 255, 0.2);
}

.own-message .message-content pre {
    background-color: rgba(255, 255, 255, 0.15);
}

.own-message .message-content blockquote {
    border-left-color: rgba(255, 255, 255, 0.5);
    color: rgba(255, 255, 255, 0.9);
}

.own-message .message-content a {
    color: var(--text-on-accent);
    text-decoration: underline;
}

.chat-system-message {
    text-align: center;
    font-size: 12px;
    color: var(--text-secondary);
    padding: 5px;
    font-style: italic;
}

.chat-system-message.error {
    color: var(--status-error);
}

.chat-typing-indicator {
    padding: 8px 16px;
    font-size: 12px;
    color: var(--text-secondary);
    font-style: italic;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Animated typing dots */
.typing-dots {
    display: inline-flex;
    gap: 3px;
}

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

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingDot {
    0%, 60%, 100% {
        opacity: 0.3;
        transform: scale(1);
    }
    30% {
        opacity: 1;
        transform: scale(1.2);
    }
}

/* Date separator */
.chat-date-separator {
    text-align: center;
    margin: 16px 0;
    position: relative;
    font-size: 12px;
    color: var(--text-secondary);
}

.chat-date-separator span {
    background-color: var(--bg-surface-1);
    padding: 0 12px;
    position: relative;
    z-index: 1;
}

.chat-date-separator::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background-color: var(--border);
}

.chat-input-container {
    border-top: 1px solid var(--border);
    padding: 12px 16px;
    background-color: var(--bg-surface-1);
    flex-shrink: 0;
}

/* Formatting toolbar */
.chat-formatting-toolbar {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-bottom: 8px;
    padding: 4px;
    background-color: var(--bg-surface-1);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.format-btn {
    background: none;
    border: none;
    padding: 6px 8px;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
    font-size: 14px;
}

.format-btn:hover {
    background-color: var(--border);
    color: var(--text-secondary);
}

.format-btn:active,
.format-btn.active {
    background-color: var(--border);
    color: var(--text-primary);
}

.format-btn i {
    font-size: 16px;
}

.format-separator {
    width: 1px;
    height: 20px;
    background-color: var(--border);
    margin: 0 4px;
}

/* Reply preview */
.chat-reply-preview {
    margin-bottom: 8px;
    padding: 8px 10px;
    background-color: var(--bg-surface-2);
    border-left: 3px solid var(--text-secondary);
    border-radius: 4px;
    position: relative;
}

.reply-preview-content {
    display: flex;
    align-items: center;
    gap: 8px;
}

.reply-to-label {
    font-size: 12px;
    color: var(--text-secondary);
}

.reply-to-user {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-secondary);
}

.reply-to-message {
    font-size: 13px;
    color: var(--text-secondary);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.reply-cancel-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
}

.reply-cancel-btn:hover {
    background-color: var(--bg-surface-2);
    color: var(--text-primary);
}

/* Reply count container */
.message-reply-count-container:empty {
    display: none;
}

/* Reply count button */
.message-reply-count {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    padding: 6px 12px;
    background-color: transparent;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.message-reply-count:hover {
    background-color: var(--bg-surface-1);
    border-color: var(--text-secondary);
}

.reply-count-text {
    font-weight: 500;
}

.reply-last-time {
    color: var(--text-secondary);
    font-size: 12px;
}

/* Thread view */
.chat-thread-view {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--bg-surface-1);
    display: flex;
    flex-direction: column;
    z-index: 10;
}

.thread-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid var(--border);
    background-color: var(--bg-surface-1);
}

.thread-back-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
}

.thread-back-btn:hover {
    background-color: var(--bg-surface-2);
}

.thread-title {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
}

.thread-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.thread-original-message {
    padding: 16px;
    background-color: var(--bg-surface-1);
    border-radius: 8px;
    margin-bottom: 20px;
}

.thread-separator {
    text-align: center;
    margin: 20px 0;
    position: relative;
}

.thread-separator span {
    background-color: var(--bg-surface-1);
    padding: 0 12px;
    color: var(--text-secondary);
    font-size: 13px;
    position: relative;
    z-index: 1;
}

.thread-separator::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background-color: var(--border);
}

/* Reply context in messages */
.message-reply-context {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    padding-left: 20px;
}

.reply-line {
    width: 2px;
    background-color: var(--border);
    flex-shrink: 0;
}

.reply-content {
    font-size: 13px;
    color: var(--text-secondary);
    overflow: hidden;
}

.reply-author {
    font-weight: 600;
    margin-right: 6px;
}

.reply-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
    max-width: 300px;
    vertical-align: bottom;
}

.chat-attachments-preview {
    margin-bottom: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.attachment-preview-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 8px;
    background-color: var(--bg-surface-2);
    color: var(--text-primary);
    border-radius: 6px;
    font-size: 12px;
}

.remove-attachment {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    margin-left: 5px;
}

.remove-attachment:hover {
    color: var(--status-error);
}

.chat-input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.chat-attach-btn,
.chat-send-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 8px;
    cursor: pointer;
    transition: color 0.2s;
    flex-shrink: 0;
}

.chat-attach-btn:hover,
.chat-send-btn:hover {
    color: var(--accent);
}

.chat-input-field {
    flex: 1;
    background-color: var(--bg-inset);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 10px 16px;
    resize: none;
    font-size: 14px;
    line-height: 1.4;
    max-height: 100px;
    overflow-y: auto;
    font-family: inherit;
    min-height: 42px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.chat-input-field::placeholder {
    color: var(--text-tertiary);
}

.chat-input-field:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-subtle);
}

.mention-autocomplete {
    position: absolute;
    bottom: 100%;
    left: 15px;
    right: 15px;
    background-color: var(--bg-surface-1);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.1);
    max-height: 150px;
    overflow-y: auto;
}

.mention-item {
    padding: 8px 12px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.mention-item:hover {
    background-color: var(--bg-surface-2);
}

/* Note: an extensive [data-bs-theme="dark"] adapter block used to live
 * here re-declaring every chat-widget surface, border, and text color
 * for dark mode. After tokenizing the base rules above to use
 * --bg-surface-1/2/3, --bg-inset, --text-primary, --accent, etc.,
 * the adapter became 100% redundant — the tokens already adapt
 * per-theme through the cascade. If a future regression appears in
 * a specific theme, fix the underlying token mapping in the affected
 * theme file rather than re-introducing a CSS-level adapter here. */

/* Responsive adjustments */
@media (max-width: 1200px) {
    .chat-widget-panel {
        width: 450px;
    }
}

@media (max-width: 992px) {
    .chat-widget-panel {
        width: 400px;
        height: 90vh;
    }
}

/* Mobile responsive */
@media (max-width: 768px) {
    .chat-widget-panel {
        width: 100vw;
        height: 100vh;
        bottom: 0;
        right: 0;
        border-radius: 0;
        max-height: none;
    }
    
    .chat-widget-container.expanded .chat-widget-button {
        display: none;
    }
    
    .chat-header {
        border-radius: 0;
    }
}

/* Search functionality styles */
.chat-search-bar {
    padding: 12px 16px;
    background-color: var(--bg-surface-1);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 8px 36px 8px 36px;
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 14px;
    background-color: var(--bg-inset);
    color: var(--text-primary);
    transition: all 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-subtle);
}

.search-input::placeholder {
    color: var(--text-tertiary);
}

.search-close-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.search-close-btn:hover {
    background-color: var(--bg-surface-2);
    color: var(--text-primary);
}

.search-results-info {
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}

/* Highlight search results */
.chat-message.search-match {
    background-color: var(--bg-surface-2);
    border-radius: 8px;
    margin: 2px 0;
}

.message-highlight {
    background-color: var(--status-warning-subtle);
    padding: 0 2px;
    border-radius: 2px;
    font-weight: 500;
}

/* Message reactions */
.message-reactions {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 8px;
}

.reaction-button {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background-color: var(--bg-surface-2);
    border: 1px solid transparent;
    border-radius: 12px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.reaction-button:hover {
    background-color: var(--border);
    border-color: var(--border);
}

.reaction-button.user-reacted {
    background-color: var(--status-info-subtle);
    border-color: var(--status-info);
}

.reaction-emoji {
    font-size: 16px;
}

.reaction-count {
    color: var(--text-secondary);
    font-weight: 500;
}

.add-reaction-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: none;
    border: 1px dashed var(--border);
    border-radius: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.add-reaction-btn:hover {
    background-color: var(--bg-surface-1);
    border-color: var(--text-tertiary);
    color: var(--text-secondary);
}

/* Reaction picker */
.reaction-picker {
    position: absolute;
    bottom: 100%;
    left: 0;
    margin-bottom: 8px;
    background-color: var(--bg-surface-1);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
}

.reaction-picker-content {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 4px;
    padding: 8px;
}

.reaction-picker-emoji {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: none;
    border: none;
    border-radius: 4px;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.reaction-picker-emoji:hover {
    background-color: var(--bg-surface-1);
    transform: scale(1.2);
}

/* Pinned message indicator */
.message-pinned {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--status-warning);
    font-size: 11px;
    font-weight: 500;
}

/* Highlight animation for mentioned messages */
.chat-message.highlight-mention {
    background-color: var(--status-warning-subtle) !important;
    border-left: 4px solid var(--status-warning);
    animation: mentionHighlight 3s ease-out;
}

@keyframes mentionHighlight {
    0% {
        background-color: var(--status-warning-subtle);
        transform: scale(1.02);
    }
    50% {
        background-color: var(--status-warning-subtle);
    }
    100% {
        background-color: transparent;
        transform: scale(1);
    }
}

/* Slash command autocomplete styling */
.slash-command-item {
    padding: 8px 12px !important;
    border-bottom: 1px solid var(--border);
}

.slash-command-item:hover {
    background-color: var(--bg-surface-1) !important;
}

.slash-command-name {
    font-weight: bold;
    color: var(--accent);
    font-size: 14px;
}

.slash-command-desc {
    color: var(--text-secondary);
    font-size: 12px;
    margin: 2px 0;
}

.slash-command-usage {
    color: var(--status-success);
    font-size: 11px;
    font-family: monospace;
    font-style: italic;
}

/* Active state for autocomplete items */
.mention-item.active {
    background-color: var(--accent) !important;
    color: var(--text-on-accent) !important;
}

.mention-item.active .slash-command-name,
.mention-item.active .slash-command-desc,
.mention-item.active .slash-command-usage {
    color: var(--text-on-accent) !important;
}

/* @channel mention styling */
.mention-channel-option {
    border-left: 3px solid var(--status-warning);
    background-color: var(--status-warning-subtle);
}

.mention-channel-option:hover {
    background-color: var(--status-warning-subtle) !important;
}

