/* ============================================================================
   COMPONENTS.CSS - Consolidated component styles from base.html
   ============================================================================ */

/* ============================================================================
   SECTION 1: BASE COMPONENT STYLES
   Cursors, notifications, badges, and theme utilities
   ============================================================================ */

/* Theme detection to prevent flash */
.cursors-container {
    position: relative;
    pointer-events: none;
    z-index: 1000;
}

.collaborative-cursor {
    position: absolute;
    pointer-events: none;
    z-index: 1000;
}

.cursor-line {
    width: 2px;
    height: 20px;
    position: absolute;
    animation: blink 1s infinite;
}

.cursor-label {
    position: absolute;
    top: -25px;
    left: 0;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1001;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* Notification Badge Styles */
.notification-indicator {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--status-error);
    color: var(--text-on-accent);
    font-size: 10px;
    font-weight: bold;
    padding: 2px 5px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.notification-count {
    display: inline-block;
}

.active-users {
    margin-bottom: 10px;
    padding: 8px;
    background-color: var(--bg-surface-2);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.user-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: var(--radius-xl);
    font-size: 12px;
    color: var(--text-on-accent);
    font-weight: 500;
}

.user-badge .status-dot {
    width: 6px;
    height: 6px;
    border-radius: var(--radius-full);
    background-color: currentColor;
    margin-right: 6px;
}

/* Notification dropdown styles */
/* All these previously had per-mode rgba pairs (rgba(0,0,0,…) for light,
 * rgba(255,255,255,…) for dark). The token `--bg-surface-2` already does
 * the right thing in both themes — slightly elevated above surface-1. */
.hover-bg-light:hover {
    background-color: var(--bg-surface-2) !important;
}

.notification-item {
    transition: background-color var(--duration-base) ease-in-out;
    border: 1px solid transparent;
}

.notification-item:hover {
    border-color: var(--border);
}

.notification-group {
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.75rem;
}

.notification-group:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

/* Make theme toggle icon larger to match avatar */
#theme-toggle i {
    font-size: var(--type-h2-size);
}

/* ============================================================================
   SECTION 2: CUSTOM CONFIRMATION MODAL
   Modal styling for confirmation dialogs
   ============================================================================ */

/* Custom Confirmation Modal Styling */
.custom-confirm-modal {
    border: none;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    background: var(--bg-surface-1);
    overflow: hidden;
}

.custom-confirm-modal .modal-header {
    background: var(--bg-base);
    border-bottom: 1px solid var(--border);
    padding: 1.25rem 1.5rem 1rem;
}

.custom-confirm-modal .modal-body {
    padding: 0 1.5rem 1rem;
    background: var(--bg-surface-1);
}

.custom-confirm-modal .modal-footer {
    padding: 1rem 1.5rem 1.25rem;
    background: var(--bg-surface-1);
    border-top: 1px solid var(--border);
    gap: 0.75rem;
}

.confirm-icon-container {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(220, 38, 38, 0.1);
    border: 2px solid rgba(220, 38, 38, 0.2);
}

.confirm-icon {
    font-size: 1.4rem;
    color: var(--status-error);
}

.confirm-icon-container.warning {
    background: rgba(217, 119, 6, 0.1);
    border-color: rgba(217, 119, 6, 0.2);
}

.confirm-icon-container.warning .confirm-icon {
    color: var(--status-warning);
}

.confirm-icon-container.info {
    background: rgba(123, 104, 238, 0.1);
    border-color: rgba(123, 104, 238, 0.2);
}

.confirm-icon-container.info .confirm-icon {
    color: var(--accent);
}

.confirm-message {
    font-size: 0.9375rem;
    line-height: 1.5;
    color: var(--text-primary);
}

.custom-confirm-modal .btn {
    border-radius: var(--radius-md);
    padding: 6px 18px;
    font-weight: 500;
    min-width: 90px;
    transition: all var(--transition);
}

.custom-confirm-modal .btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm, 0 2px 6px rgba(0,0,0,.12));
}

.custom-confirm-modal .btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--text-on-accent) !important;
}

/* Dark-scheme-only: Bootstrap close-icon is a dark SVG by default.
 * Inverting makes it readable on any dark surface. All other
 * custom-confirm-modal styling adapts per-theme through tokens. */
[data-bs-theme="dark"] .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* Animation */
.custom-confirm-modal {
    animation: slideInUp var(--duration-slower) ease-out;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) translateY(0) scale(1);
    }
}

/* Enhanced button icons */
.custom-confirm-modal .btn i {
    transition: transform var(--duration-slow) var(--ease-default);
}

.custom-confirm-modal .btn:hover i {
    transform: scale(1.1);
}

/* ============================================================================
   SECTION 3: ALERT TOAST STYLES
   Toast notification styles
   ============================================================================ */

.alert-toast {
    min-width: 300px;
    margin-bottom: 10px;
}

/* ============================================================================
   SECTION 4: CHAT WIDGET STYLES
   Complete chat widget component styling
   ============================================================================ */

/* Chat Widget Styles */
.chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.chat-widget.minimized .chat-widget-minimized {
    display: block;
}

.chat-widget.minimized .chat-widget-expanded {
    display: none !important;
}

.chat-widget-minimized {
    background: var(--border-emphasis);
    border-radius: 28px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
    transition: all var(--duration-slower) var(--ease-default);
}

.chat-widget-minimized:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23);
    background: var(--text-tertiary);
}

.chat-toggle-btn {
    background: none;
    border: none;
    color: var(--text-on-accent);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 28px;
}

.chat-toggle-btn i {
    font-size: 24px;
}

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

.chat-widget-expanded {
    width: 480px;
    height: 90vh; /* Increased to 90% of viewport height */
    min-width: 400px;
    min-height: 500px;
    max-width: 900px;
    max-height: calc(100vh - 40px);
    background: var(--bg-surface-1);
    border-radius: var(--radius-sm);
    box-shadow: 0 0 0 1px rgba(29, 28, 29, 0.13), 0 18px 48px -12px rgba(0, 0, 0, 0.56);
    display: flex;
    flex-direction: column;
    animation: slideUp var(--duration-slower) ease-out;
    border: 1px solid rgba(255, 255, 255, 0.08);
    resize: both;
    overflow: auto;
    position: relative;
}

/* Custom resize handle */
.resize-handle {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    cursor: ns-resize;
    background: transparent;
}

.resize-handle:hover {
    background: rgba(255, 255, 255, 0.1);
}

.resize-handle-corner {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 20px;
    height: 20px;
    cursor: nw-resize;
    z-index: 10;
}

.resize-handle-corner::after {
    content: '';
    position: absolute;
    bottom: 3px;
    left: 3px;
    width: 10px;
    height: 10px;
    border-left: 2px solid rgba(255, 255, 255, 0.2);
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
}

.resize-handle-side {
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    cursor: ew-resize;
    background: transparent;
}

.resize-handle-side:hover {
    background: rgba(255, 255, 255, 0.1);
}

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

.chat-header {
    background: var(--bg-base);
    color: var(--text-primary);
    padding: 10px 16px;
    border-radius: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    height: 48px;
    transition: all var(--duration-slower) var(--ease-default);
}

.chat-header.collapsed {
    height: 0;
    padding: 0;
    overflow: hidden;
    border-bottom: none;
}

.chat-title {
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-title::before {
    content: '#';
    color: var(--text-tertiary);
    font-weight: 400;
}

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

.btn-ghost {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--bg-surface-1);
}

.chat-online-users {
    padding: 6px 12px;
    background: rgba(26, 29, 33, 0.6);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 11px;
    color: rgba(171, 171, 173, 0.8);
    display: flex;
    align-items: center;
    gap: 12px;
    overflow-x: auto;
    transition: all var(--duration-slower) var(--ease-default);
    min-height: 32px;
}

.chat-header.collapsed + .chat-online-users {
    padding-top: 12px;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

/* When header is collapsed, hide online users too for maximum space */
.chat-header.collapsed + .chat-online-users {
    display: none;
}

/* Search bar styles */
.chat-search-bar {
    padding: 12px 16px;
    background: var(--bg-base);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

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

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

.search-input {
    width: 100%;
    padding: 8px 36px 8px 36px;
    background: var(--bg-surface-1);
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: border-color var(--duration-slow) var(--ease-default);
}

.search-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent);
}

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

.search-close-btn {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 4px;
    cursor: pointer;
    transition: color var(--transition);
}

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

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

/* Highlight search results */
.message-highlight {
    background: rgba(255, 235, 59, 0.2);
    padding: 0 2px;
    border-radius: 2px;
}

.online-user {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    font-size: 11px;
    opacity: 0.8;
    transition: opacity var(--duration-slow) var(--ease-default);
}

.online-user:hover {
    opacity: 1;
}

.online-indicator {
    width: 5px;
    height: 5px;
    background: var(--status-success);
    border-radius: var(--radius-full);
    box-shadow: 0 0 4px rgba(16, 185, 129, 0.5);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: var(--bg-base);
    position: relative;
}

/* When header is collapsed, messages take full height */
.chat-header.collapsed ~ .chat-online-users ~ .chat-messages {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    padding-top: 50px;
}

.chat-message {
    display: flex;
    gap: 8px;
    animation: fadeIn var(--duration-slower) ease-out;
    position: relative;
    padding: 4px 8px;
    border-radius: var(--radius-md);
    transition: background var(--transition);
}

.chat-message:hover {
    background: rgba(255, 255, 255, 0.04);
}

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

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: var(--accent);
    color: var(--text-on-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
}

.message-content {
    flex: 1;
}

.message-header {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 4px;
}

.message-author {
    font-weight: 700;
    font-size: 15px;
    color: var(--text-primary);
}

.message-time {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 400;
}

.message-text {
    font-size: 15px;
    line-height: 1.46668;
    color: var(--text-primary);
    word-wrap: break-word;
}

/* Read receipts */
.message-read-receipts {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-top: 4px;
    font-size: 11px;
    color: var(--text-tertiary);
}

.read-receipt-avatar {
    width: 16px;
    height: 16px;
    border-radius: var(--radius-full);
    background: var(--border-emphasis);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    color: var(--text-primary);
    border: 1px solid var(--bg-base);
    margin-left: -4px;
}

.read-receipt-avatar:first-child {
    margin-left: 0;
}

.read-receipt-count {
    margin-left: 4px;
    color: var(--text-tertiary);
}

/* Reply functionality */
.message-reply-button {
    opacity: 0;
    position: absolute;
    right: 8px;
    top: 4px;
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: var(--text-secondary);
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition);
}

.chat-message:hover .message-reply-button {
    opacity: 1;
}

.message-reply-button:hover {
    background: rgba(255, 255, 255, 0.12);
    color: var(--text-primary);
}

/* Reply preview */
.message-reply-preview {
    background: rgba(255, 255, 255, 0.04);
    border-left: 3px solid var(--accent);
    padding: 4px 8px;
    margin-bottom: 4px;
    font-size: 13px;
    border-radius: 0 4px 4px 0;
}

.reply-preview-author {
    font-weight: 600;
    color: var(--accent);
    font-size: 12px;
}

.reply-preview-text {
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 300px;
}

/* Reply input preview */
.reply-preview-container {
    display: none;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.04);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.reply-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

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

.reply-cancel-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 2px;
}

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

.message-text p {
    margin: 0 0 8px 0;
}

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

.message-text code {
    background: rgba(29, 155, 209, 0.1);
    padding: 2px 4px;
    border-radius: 3px;
    font-size: 13px;
    color: var(--status-error);
    border: 1px solid rgba(232, 230, 227, 0.11);
}

.message-text pre {
    background: var(--bg-base);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    overflow-x: auto;
    margin: 8px 0;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Mention styles */
.message-text .mention {
    color: var(--status-info);
    font-weight: 600;
    cursor: pointer;
    background: rgba(29, 155, 209, 0.1);
    padding: 2px 0;
    border-radius: 3px;
}

.message-text .mention:hover {
    background: rgba(29, 155, 209, 0.2);
    text-decoration: underline;
}

/* Mention autocomplete */
.mention-autocomplete {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    max-height: 200px;
    overflow-y: auto;
    background: var(--bg-surface-1);
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: var(--radius-md);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.05), 0 3px 12px rgba(0, 0, 0, 0.45);
    margin-bottom: 8px;
    display: none;
}

.mention-item {
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background var(--duration-slow) var(--ease-default);
}

.mention-item:hover,
.mention-item.active {
    background: var(--bg-base);
}

.mention-item img {
    width: 24px;
    height: 24px;
    border-radius: var(--radius-full);
}

.mention-item .username {
    font-weight: 500;
    font-size: 14px;
}

.message-edited {
    font-size: 11px;
    color: var(--text-secondary);
    font-style: italic;
}

.message-deleted {
    font-style: italic;
    color: var(--text-secondary);
}

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

.attachment {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-sm);
    font-size: 13px;
    transition: all var(--duration-slow) var(--ease-default);
    max-width: fit-content;
    color: var(--text-primary);
    text-decoration: none;
}

.attachment:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.13);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    color: var(--bg-surface-1);
    text-decoration: none;
}

.attachment i {
    font-size: 16px;
    color: var(--text-secondary);
}

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

.attachment a:hover {
    color: var(--accent);
    text-decoration: underline;
}

.attachment-size {
    color: var(--text-secondary);
    font-size: 11px;
}

/* File type specific icons colors */
.attachment .bi-file-pdf {
    color: var(--status-error);
}

.attachment .bi-file-word {
    color: var(--status-info);
}

.attachment .bi-file-image {
    color: var(--status-success);
}

.attachment .bi-file-code {
    color: var(--accent);
}

.attachment .bi-file-spreadsheet {
    color: var(--status-success);
}

.attachment .bi-file-zip {
    color: var(--status-warning);
}

/* Message attachments styles */
.message-attachments {
    margin-top: 8px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.message-attachments .attachment {
    margin-bottom: 4px;
}

.message-attachments .attachment:last-child {
    margin-bottom: 0;
}

.chat-typing-indicator {
    padding: 6px 16px;
    font-size: 12px;
    color: var(--text-secondary);
    font-style: italic;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: var(--bg-base);
}

.chat-input-container {
    padding: 12px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: var(--bg-surface-1);
    border-radius: 0 0 8px 8px;
}

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

.chat-input {
    flex: 1;
    border: 1px solid var(--text-tertiary);
    border-radius: var(--radius-lg);
    padding: 8px 12px;
    font-size: 15px;
    resize: none;
    outline: none;
    transition: border-color var(--duration-slow) var(--ease-default);
    max-height: 120px;
    background: var(--bg-surface-1);
    color: var(--text-primary);
}

.chat-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent), 0 0 0 5px rgba(29, 155, 209, 0.1);
}

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

.chat-input-actions {
    display: flex;
    gap: 4px;
}

.chat-input-actions .btn-primary {
    background: var(--accent);
    border: none;
    color: var(--text-on-accent);
    border-radius: var(--radius-sm);
    padding: 6px 12px;
    transition: background var(--transition);
}

.chat-input-actions .btn-primary:hover {
    background: var(--accent-active);
}

.chat-input-actions .btn-ghost {
    color: var(--text-secondary);
    background: transparent;
    border: none;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

.chat-input-actions .btn-ghost:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

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

.attachment-preview {
    position: relative;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-sm);
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.attachment-preview .remove-attachment {
    cursor: pointer;
    color: var(--text-secondary);
    transition: color var(--duration-slow) var(--ease-default);
}

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

/* Dark mode support - Complete theme */
[data-bs-theme="dark"] .chat-widget-expanded {
    background: var(--bg-base);
    color: var(--border);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 5px 40px rgba(0, 0, 0, 0.5);
}

/* Dark mode no longer needed - chat is always dark */
[data-bs-theme="dark"] .chat-header {
    /* Inherits dark theme by default */
}

[data-bs-theme="dark"] .btn-ghost {
    background: rgba(255, 255, 255, 0.1);
}

[data-bs-theme="dark"] .btn-ghost:hover {
    background: rgba(255, 255, 255, 0.2);
}

[data-bs-theme="dark"] .chat-online-users {
    background: rgba(30, 33, 41, 0.7);
    backdrop-filter: blur(10px);
    border-color: rgba(255, 255, 255, 0.06);
    color: rgba(148, 163, 184, 0.7);
}

[data-bs-theme="dark"] .online-indicator {
    background: var(--status-success);
}

[data-bs-theme="dark"] .chat-messages {
    background: var(--bg-base);
}

[data-bs-theme="dark"] .message-author {
    color: var(--bg-surface-1);
}

[data-bs-theme="dark"] .message-time {
    color: var(--text-secondary);
}

[data-bs-theme="dark"] .message-text {
    color: var(--border);
}

[data-bs-theme="dark"] .message-text code {
    background: var(--bg-base);
    color: var(--accent-hover);
    border: 1px solid rgba(167, 139, 250, 0.3);
}

[data-bs-theme="dark"] .message-text pre {
    background: var(--bg-base);
    color: var(--border);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

[data-bs-theme="dark"] .message-edited,
[data-bs-theme="dark"] .message-deleted {
    color: var(--text-secondary);
}

[data-bs-theme="dark"] .chat-typing-indicator {
    background: var(--bg-surface-2);
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
}

[data-bs-theme="dark"] .chat-input-container {
    background: var(--bg-surface-2);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-bs-theme="dark"] .chat-input {
    background: var(--bg-base);
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--border);
}

[data-bs-theme="dark"] .chat-input:focus {
    border-color: var(--status-info);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

[data-bs-theme="dark"] .chat-input::placeholder {
    color: var(--text-secondary);
}

[data-bs-theme="dark"] .btn-primary {
    background: var(--border-emphasis);
    border-color: var(--border-emphasis);
    color: var(--text-on-accent);
}

[data-bs-theme="dark"] .btn-primary:hover {
    background: var(--border-emphasis);
    border-color: var(--border-emphasis);
    color: var(--text-on-accent);
}

/* Dark mode attachment styles */
[data-bs-theme="dark"] .attachment {
    background: var(--bg-surface-2);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-bs-theme="dark"] .attachment:hover {
    background: var(--bg-base);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

[data-bs-theme="dark"] .attachment i {
    opacity: 0.9;
}

[data-bs-theme="dark"] .attachment a {
    color: var(--border);
}

[data-bs-theme="dark"] .attachment a:hover {
    color: var(--status-info);
}

[data-bs-theme="dark"] .attachment-size {
    color: var(--text-secondary);
}

[data-bs-theme="dark"] .attachment-preview {
    background: var(--bg-surface-2);
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--border);
}

[data-bs-theme="dark"] .attachment-preview .remove-attachment {
    color: var(--text-secondary);
}

[data-bs-theme="dark"] .attachment-preview .remove-attachment:hover {
    color: var(--status-error);
}

/* Dark mode mention styles */
[data-bs-theme="dark"] .message-text .mention {
    color: var(--status-info);
    background: rgba(96, 165, 250, 0.2);
}

[data-bs-theme="dark"] .message-text .mention:hover {
    background: rgba(96, 165, 250, 0.3);
}

[data-bs-theme="dark"] .mention-autocomplete {
    background: var(--bg-base);
    border-color: var(--border-emphasis);
}

[data-bs-theme="dark"] .mention-item:hover,
[data-bs-theme="dark"] .mention-item.active {
    background: var(--bg-base);
}

/* Dark mode attachment styles */
[data-bs-theme="dark"] .message-attachments {
    background: var(--bg-base);
    border-color: var(--border-emphasis);
}

/* Mobile responsive */
@media (max-width: 768px) {
    .chat-widget-expanded {
        width: 100vw !important;
        height: 100vh !important;
        max-height: 100vh;
        bottom: 0;
        right: 0;
        border-radius: 0;
        position: fixed;
        resize: none; /* Disable resizing on mobile */
    }

    .resize-handle,
    .resize-handle-side,
    .resize-handle-corner {
        display: none; /* Hide resize handles on mobile */
    }

    .chat-widget.minimized {
        bottom: 10px;
        right: 10px;
    }

    .chat-header {
        border-radius: 0;
    }

    .chat-input-container {
        border-radius: 0;
    }
}
