/* =============================================
   FLOATING GLOBAL CHAT - Persistent Across Pages
   ============================================= */

/* Floating Chat Button */
.floating-chat-btn {
    position: fixed;
    /* Default position removed - JS applies position before adding to DOM */
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f5c211 0%, #ff9500 100%);
    border: none;
    cursor: pointer;
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(245, 194, 17, 0.4), 0 0 0 0 rgba(245, 194, 17, 0.4);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
    animation: chatBtnPulse 3s ease-in-out infinite;
    /* Start invisible - JS will fade in after positioning */
    opacity: 0;
}

/* Show button after JS has positioned it */
.floating-chat-btn.positioned {
    opacity: 1;
    transition: opacity 0.15s ease, transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
}

/* Legacy class for backwards compatibility */
.floating-chat-btn.position-loading {
    opacity: 0 !important;
}

/* Prevent position transition on initial load */
.floating-chat-btn.no-transition {
    transition: none !important;
}

.floating-chat-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(245, 194, 17, 0.5);
}

.floating-chat-btn:active {
    transform: scale(0.95);
}

.floating-chat-btn svg {
    width: 28px;
    height: 28px;
    color: #000;
    transition: transform 0.3s ease;
}

.floating-chat-btn.open svg {
    transform: rotate(90deg);
}

/* Unread badge on floating button */
.floating-chat-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 22px;
    height: 22px;
    background: #f44336;
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    box-shadow: 0 2px 8px rgba(244, 67, 54, 0.5);
    animation: badgePop 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes chatBtnPulse {
    0%, 100% { box-shadow: 0 4px 20px rgba(245, 194, 17, 0.4), 0 0 0 0 rgba(245, 194, 17, 0.4); }
    50% { box-shadow: 0 4px 20px rgba(245, 194, 17, 0.4), 0 0 0 8px rgba(245, 194, 17, 0); }
}

@keyframes badgePop {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Floating Chat Panel */
.floating-chat-panel {
    position: fixed;
    bottom: 100px;
    right: 24px;
    width: 500px;
    height: 650px;
    max-height: calc(100vh - 140px);
    background: #0d0d0d;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    z-index: 9997;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05);
    opacity: 0;
    visibility: hidden;
    /* Use animation instead of transform for open/close to avoid breaking fixed positioning */
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.3s;
}

.floating-chat-panel.open {
    opacity: 1;
    visibility: visible;
}

/* Overlay for expanded mode */
.floating-chat-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9996;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
}

.floating-chat-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Chat Panel Header */
.floating-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(245, 194, 17, 0.08) 0%, rgba(255, 149, 0, 0.05) 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.floating-chat-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.floating-chat-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, #f5c211 0%, #ff9500 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
}

.floating-chat-icon svg {
    width: 20px;
    height: 20px;
}

.floating-chat-info h3 {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
}

.floating-chat-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.7rem;
    color: #888;
}

.floating-chat-status .status-dot {
    width: 6px;
    height: 6px;
    background: #4ade80;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.floating-chat-header-actions {
    display: flex;
    gap: 8px;
}

.floating-chat-header-btn {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
    cursor: pointer;
    transition: all 0.2s ease;
}

.floating-chat-header-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* Floating Chat Body (wrapper for messages + sidebar) */
.floating-chat-body {
    flex: 1;
    display: flex;
    overflow: hidden;
    min-height: 0; /* Important for flex children scrolling */
}

/* Floating Chat Messages */
.floating-chat-messages {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px;
    padding-top: 20px; /* Extra padding for 'Replying to' labels */
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: linear-gradient(180deg, #0a0a0a 0%, #0d0d0d 100%);
}

.floating-chat-messages::-webkit-scrollbar {
    width: 5px;
}

.floating-chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.floating-chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

/* Welcome message for floating chat */
.floating-chat-welcome {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.floating-chat-welcome svg {
    width: 48px;
    height: 48px;
    color: #444;
    margin-bottom: 16px;
}

.floating-chat-welcome h4 {
    font-size: 1rem;
    color: #888;
    margin: 0 0 8px 0;
}

.floating-chat-welcome p {
    font-size: 0.8rem;
    margin: 0;
}

/* Floating Chat Typing Indicator */
.floating-chat-typing {
    padding: 0 16px;
    min-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.floating-chat-typing.active {
    padding: 8px 16px;
    min-height: 28px;
}

.floating-typing-indicator-inner {
    display: flex;
    align-items: center;
    gap: 8px;
    animation: floatingTypingSlideIn 0.3s ease;
}

@keyframes floatingTypingSlideIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

.floating-typing-dots {
    display: flex;
    gap: 3px;
}

.floating-typing-dots span {
    width: 5px;
    height: 5px;
    background: var(--chat-accent, #f5c211);
    border-radius: 50%;
    animation: floatingTypingBounce 1.4s infinite ease-in-out both;
}

.floating-typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.floating-typing-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes floatingTypingBounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

.floating-typing-text {
    font-size: 0.7rem;
    color: #888;
    font-style: italic;
}

/* Reply Preview */
.floating-chat-reply-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: rgba(245, 194, 17, 0.08);
    border-top: 1px solid rgba(245, 194, 17, 0.15);
}

.floating-chat-reply-preview .reply-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.floating-chat-reply-preview .reply-info svg {
    width: 14px;
    height: 14px;
    color: #f5c211;
    flex-shrink: 0;
}

.floating-chat-reply-preview .reply-username {
    font-weight: 600;
    color: #f5c211;
    font-size: 0.8rem;
}

.floating-chat-reply-preview .reply-text {
    color: #888;
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.floating-chat-reply-preview .reply-cancel {
    width: 24px;
    height: 24px;
    background: transparent;
    border: none;
    color: #666;
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.floating-chat-reply-preview .reply-cancel:hover {
    color: #f44336;
    background: rgba(244, 67, 54, 0.1);
}

/* Floating Chat Input Area */
.floating-chat-input-area {
    padding: 12px 16px;
    background: rgba(20, 20, 20, 0.95);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.floating-chat-auth-guard {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px;
    color: #888;
    font-size: 0.85rem;
}

.floating-chat-auth-guard svg {
    width: 20px;
    height: 20px;
    color: #666;
}

.floating-chat-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(30, 30, 30, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 8px 12px;
    transition: border-color 0.2s ease;
}

.floating-chat-input-wrapper:focus-within {
    border-color: rgba(245, 194, 17, 0.4);
}

.floating-chat-toolbar {
    display: flex;
    gap: 4px;
    align-items: center;
}

.floating-chat-toolbar-btn {
    width: 34px;
    height: 34px;
    background: transparent;
    border: none;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    cursor: pointer;
    transition: all 0.15s ease;
}

.floating-chat-toolbar-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.floating-chat-toolbar-btn svg {
    width: 20px;
    height: 20px;
}

.floating-chat-textarea {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    font-size: 0.9rem;
    resize: none;
    max-height: 100px;
    min-height: 36px;
    line-height: 20px;
    font-family: inherit;
    padding: 8px 0;
    margin: 0;
}

.floating-chat-textarea::placeholder {
    color: #555;
}

.floating-chat-send-btn {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #f5c211 0%, #ff9500 100%);
    border: none;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.floating-chat-send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(245, 194, 17, 0.4);
}

.floating-chat-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.floating-chat-send-btn svg {
    width: 18px;
    height: 18px;
}

.floating-chat-char-count {
    font-size: 0.65rem;
    color: #555;
    text-align: right;
    padding-top: 4px;
}

/* Message Styles for Floating Chat (compact version) */
.floating-chat-messages .chat-message-group {
    padding: 8px 10px;
    margin: 4px 0;
}

/* Avatar styles - allow custom border effects from avatar-style classes */
.floating-chat-messages .chat-avatar-v2 {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    flex-shrink: 0;
}

/* Don't override custom avatar styles */
.floating-chat-messages .chat-avatar-v2[class*="avatar-style-"] {
    border-radius: 12px !important;
}

/* Avatar wrap styling */
.floating-chat-messages .avatar-wrap {
    position: relative;
    flex-shrink: 0;
}

.floating-chat-messages .avatar-wrap img {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    object-fit: cover;
}

.floating-chat-messages .chat-username {
    font-size: 0.8rem;
}

.floating-chat-messages .chat-message-item {
    padding: 8px 12px;
    margin: 2px 0;
    overflow: visible; /* Allow reply label to show */
    border-radius: 12px;
    /* Force transparent base; inline styles set the real bubble background */
    background: transparent !important;
    border: none;
    box-shadow: none;
    transition: background 0.2s ease;
}

/* Chat bubble style overrides - most styles set via inline styles from JS */
.floating-chat-messages .chat-message-item.bubble-style-gradient {
    border: 2px solid transparent;
    background-clip: padding-box;
}

.floating-chat-messages .chat-message-item.bubble-style-neon {
    /* Styles are set via inline styles from JS */
}

.floating-chat-messages .chat-message-item.bubble-style-glossy {
    /* Styles are set via inline styles from JS */
}

.floating-chat-messages .chat-message-item.bubble-style-glass {
    /* Styles are set via inline styles from JS */
}

/* Ensure message groups don't clip content */
.floating-chat-messages .chat-message-group {
    overflow: visible;
    padding-top: 8px; /* Space for reply label */
}

.floating-chat-messages .chat-text {
    font-size: 0.85rem;
    line-height: 1.4;
    word-wrap: break-word;
}

.floating-chat-messages .msg-time {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.4);
}

.floating-chat-messages .chat-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.floating-chat-messages .chat-content {
    flex: 1;
    min-width: 0;
}

/* Chat images */
.floating-chat-messages .chat-image {
    margin-top: 8px;
}

.floating-chat-messages .chat-image img {
    max-width: 250px;
    max-height: 200px;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.2s;
}

.floating-chat-messages .chat-image img:hover {
    transform: scale(1.02);
}

/* Mentions */
.floating-chat-messages .mention {
    color: #f5c211;
    font-weight: 600;
    background: rgba(245, 194, 17, 0.15);
    padding: 1px 4px;
    border-radius: 4px;
}

/* Message actions (reply button) */
.chat-message-actions {
    display: flex;
    gap: 4px;
    margin-top: 4px;
    opacity: 0;
    transition: opacity 0.15s;
}

.chat-message-item:hover .chat-message-actions {
    opacity: 1;
}

.floating-reply-btn,
.floating-action-btn {
    background: transparent;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    transition: all 0.15s;
}

.floating-reply-btn:hover {
    color: #f5c211;
    background: rgba(245, 194, 17, 0.1);
}

.floating-action-btn:hover {
    background: rgba(255, 255, 255, 0.08);
}

.floating-action-btn.warn-btn:hover {
    color: #ff9800;
    background: rgba(255, 152, 0, 0.1);
}

.floating-action-btn.mute-btn:hover {
    color: #f44336;
    background: rgba(244, 67, 54, 0.1);
}

.floating-action-btn.delete-btn:hover {
    color: #f44336;
    background: rgba(244, 67, 54, 0.1);
}

.floating-reply-btn svg,
.floating-action-btn svg {
    width: 14px;
    height: 14px;
}

/* Avatar button styling for floating chat */
.floating-avatar-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    flex-shrink: 0;
    border-radius: 50%;
    transition: transform 0.2s ease;
}

.floating-avatar-btn:hover {
    transform: scale(1.1);
}

/* Username button styling for floating chat */
.floating-username-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font: inherit;
    text-align: left;
}

.floating-username-btn:hover {
    text-decoration: underline;
}

/* Reaction row */
.floating-reaction-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 4px;
}

/* Reaction bar */
.floating-reaction-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.floating-reaction-pill {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.15s;
}

.floating-reaction-pill:hover {
    background: rgba(255, 255, 255, 0.15);
}

.floating-reaction-pill.active {
    background: rgba(245, 194, 17, 0.2);
    border-color: rgba(245, 194, 17, 0.4);
}

.floating-reaction-pill .reaction-count {
    font-size: 0.7rem;
    color: #aaa;
}

/* Reaction picker */
.floating-reaction-picker {
    display: none;
    position: fixed;
    background: #1a1a1a;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 8px;
    gap: 6px;
    flex-wrap: wrap;
    width: max-content;
    max-width: 240px;
    z-index: 2147483647; /* Maximum z-index to ensure it's always on top */
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(245, 194, 17, 0.1);
    pointer-events: auto;
}

.floating-reaction-picker.show {
    display: flex;
}

.floating-reaction-picker .picker-emoji {
    font-size: 1.2rem;
    padding: 4px 6px;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.15s;
}

.floating-reaction-picker .picker-emoji:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Reaction anchor positioning */
.floating-chat-messages .reaction-anchor {
    position: relative;
}

/* Reaction button styling */
.floating-action-btn.reaction-btn:hover {
    color: #f5c211;
    background: rgba(245, 194, 17, 0.1);
}

/* Emoji/GIF picker positioning for floating chat */
.floating-chat-panel .emoji-picker-v2,
.floating-chat-panel .gif-picker {
    position: absolute;
    bottom: 100%;
    left: 16px;
    right: 16px;
    max-height: 280px;
    margin-bottom: 8px;
}

/* Floating GIF Picker */
.floating-gif-picker {
    position: absolute;
    bottom: 70px;
    left: 16px;
    width: 320px;
    max-height: 350px;
    background: #1a1a1a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.floating-gif-picker .gif-picker-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
}

.floating-gif-picker .gif-picker-header input {
    flex: 1;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 8px 12px;
    color: #fff;
    font-size: 0.9rem;
}

.floating-gif-picker .gif-picker-header input:focus {
    outline: none;
    border-color: var(--accent);
}

.floating-gif-picker .gif-picker-close {
    background: none;
    border: none;
    color: #888;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0 8px;
    line-height: 1;
}

.floating-gif-picker .gif-picker-close:hover {
    color: #fff;
}

.floating-gif-picker .gif-picker-grid {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    min-height: 200px;
    max-height: 250px;
}

.floating-gif-picker .gif-picker-grid img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.15s ease, opacity 0.15s ease;
}

.floating-gif-picker .gif-picker-grid img:hover {
    transform: scale(1.03);
    opacity: 0.9;
}

.floating-gif-picker .gif-placeholder {
    grid-column: 1 / -1;
    text-align: center;
    color: #666;
    padding: 40px 20px;
    font-size: 0.9rem;
}

.floating-gif-picker .gif-picker-footer {
    padding: 8px 12px;
    text-align: center;
    font-size: 0.7rem;
    color: #555;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
}

/* Responsive styles */
@media (max-width: 500px) {
    .floating-chat-btn {
        bottom: 16px;
        right: 16px;
        width: 54px;
        height: 54px;
    }
    
    .floating-chat-panel {
        bottom: 80px;
        right: 8px;
        left: 8px;
        width: auto;
        height: calc(100vh - 100px);
        max-height: none;
        border-radius: 12px;
    }
    
    .floating-chat-panel.expanded {
        top: 8px !important;
        left: 8px !important;
        right: 8px !important;
        bottom: 8px !important;
        width: auto;
        height: auto;
        max-height: none;
        transform: none !important;
    }
    
    .floating-chat-panel.expanded.open {
        transform: none !important;
    }
    
    /* Hide sidebar on mobile */
    .floating-chat-panel.expanded .floating-chat-sidebar {
        display: none;
    }
    
    .floating-chat-panel .emoji-picker-v2,
    .floating-chat-panel .gif-picker {
        left: 8px;
        right: 8px;
    }
}

/* Draggable button styles */
.floating-chat-btn {
    touch-action: none;
    user-select: none;
}

.floating-chat-btn.dragging {
    animation: none !important;
    cursor: grabbing;
    transform: scale(1.1);
    box-shadow: 0 8px 40px rgba(245, 194, 17, 0.6);
}

/* Expanded chat panel styles */
.floating-chat-panel.expanded {
    width: 1400px;
    max-width: 95vw;
    height: 98vh;
    max-height: none;
    /* Center in viewport without transform (transform breaks fixed positioning) */
    top: 1vh !important;
    left: 50% !important;
    right: auto !important;
    bottom: auto !important;
    margin-left: -700px; /* Half of width */
    border-radius: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s;
}

/* Adjust margin for smaller screens */
@media (max-width: 1450px) {
    .floating-chat-panel.expanded {
        margin-left: -47.5vw; /* Half of 95vw */
    }
}

.floating-chat-panel.expanded.open {
    opacity: 1;
    visibility: visible;
}

/* Expanded panel has a flex layout with sidebar */
.floating-chat-panel.expanded .floating-chat-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.floating-chat-panel.expanded .floating-chat-messages {
    font-size: 1rem;
    flex: 1;
}

.floating-chat-panel.expanded .floating-chat-message {
    padding: 16px 24px;
}

.floating-chat-panel.expanded .floating-chat-textarea {
    font-size: 1rem;
    min-height: 44px;
    line-height: 24px;
    padding: 10px 0;
}

/* Larger avatars and text in expanded mode */
.floating-chat-panel.expanded .chat-avatar-v2,
.floating-chat-panel.expanded .avatar-wrap img {
    width: 48px;
    height: 48px;
}

.floating-chat-panel.expanded .chat-username {
    font-size: 0.95rem;
}

.floating-chat-panel.expanded .chat-text {
    font-size: 1rem;
    line-height: 1.5;
}

.floating-chat-panel.expanded .msg-time {
    font-size: 0.75rem;
}

.floating-chat-panel.expanded .chat-message-actions {
    gap: 8px;
}

.floating-chat-panel.expanded .floating-reply-btn,
.floating-chat-panel.expanded .floating-action-btn {
    padding: 6px 10px;
}

.floating-chat-panel.expanded .floating-reply-btn svg,
.floating-chat-panel.expanded .floating-action-btn svg {
    width: 16px;
    height: 16px;
}

/* Larger toolbar in expanded mode */
.floating-chat-panel.expanded .floating-chat-toolbar-btn {
    width: 36px;
    height: 36px;
}

.floating-chat-panel.expanded .floating-chat-toolbar-btn svg {
    width: 20px;
    height: 20px;
}

.floating-chat-panel.expanded .floating-chat-input-wrapper {
    padding: 12px 16px;
}

/* Larger sidebar for expanded mode */
.floating-chat-panel.expanded .floating-chat-sidebar {
    width: 280px;
}

/* Online Users Sidebar (expanded mode) */
.floating-chat-sidebar {
    display: none;
    width: 200px;
    background: rgba(15, 15, 15, 0.95);
    border-left: 1px solid rgba(255, 255, 255, 0.06);
    overflow-y: auto;
    flex-shrink: 0;
}

.floating-chat-panel.expanded .floating-chat-sidebar {
    display: flex;
    flex-direction: column;
}

.floating-chat-sidebar-header {
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #888;
    display: flex;
    align-items: center;
    gap: 8px;
}

.floating-chat-sidebar-header .online-dot {
    width: 8px;
    height: 8px;
    background: #4caf50;
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.floating-chat-online-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.floating-chat-online-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    transition: background 0.15s;
}

.floating-chat-online-user:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* Online user avatar button */
.floating-online-avatar-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    flex-shrink: 0;
    border-radius: 8px;
    transition: transform 0.2s ease;
}

.floating-online-avatar-btn:hover {
    transform: scale(1.1);
}

/* Online user avatar styles */
.floating-chat-online-user .online-user-avatar,
.floating-chat-online-user .avatar-wrap img {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    object-fit: cover;
}

/* Legacy img fallback */
.floating-chat-online-user > img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.floating-chat-online-user .user-info {
    flex: 1;
    min-width: 0;
}

/* Online user name button */
.floating-online-name-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font: inherit;
    text-align: left;
    display: block;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.floating-online-name-btn:hover {
    text-decoration: underline;
}

.floating-chat-online-user .username {
    font-size: 0.8rem;
    font-weight: 600;
    color: #ddd;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.floating-chat-online-user .status {
    font-size: 0.65rem;
    color: #4caf50;
}

.floating-chat-online-user.idle .status {
    color: #ff9800;
}

/* Online users search input */
.floating-chat-search-wrapper {
    padding: 8px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.floating-online-search-input {
    width: 100%;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #fff;
    font-size: 0.8rem;
    outline: none;
    transition: border-color 0.2s, background 0.2s;
}

.floating-online-search-input::placeholder {
    color: #666;
}

.floating-online-search-input:focus {
    border-color: #f5c211;
    background: rgba(0, 0, 0, 0.4);
}

/* Online list categories */
.online-list-category {
    margin-bottom: 8px;
}

.online-list-category-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    font-size: 0.7rem;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.online-list-category-header .category-icon {
    font-size: 0.75rem;
}

.online-list-category-header .category-count {
    margin-left: auto;
    background: rgba(255, 255, 255, 0.1);
    padding: 1px 6px;
    border-radius: 10px;
    font-size: 0.65rem;
}

.online-list-category-users {
    padding-left: 4px;
}

/* Deleted/retracted message styles */
.deleted-message {
    background: rgba(80, 80, 80, 0.2) !important;
    border: 1px dashed rgba(255, 255, 255, 0.15) !important;
    opacity: 0.7;
}

.deleted-message-content {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    color: #888;
    font-size: 0.8rem;
    font-style: italic;
}

.deleted-message-content svg {
    opacity: 0.5;
    flex-shrink: 0;
}

.deleted-message-text {
    color: #777;
}

/* Sidebar collapse button */
.sidebar-collapse-btn {
    background: transparent;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    transition: all 0.15s;
}

.sidebar-collapse-btn:hover {
    color: #f5c211;
    background: rgba(245, 194, 17, 0.1);
}

.sidebar-collapse-btn svg {
    width: 16px;
    height: 16px;
}

/* Collapsed sidebar */
.floating-chat-sidebar.collapsed {
    display: none !important;
}

/* Sidebar expand button (shown when collapsed) */
.floating-sidebar-expand-btn {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 40px;
    background: rgba(15, 15, 15, 0.95);
    border: none;
    border-left: 1px solid rgba(255, 255, 255, 0.06);
    color: #888;
    cursor: pointer;
    padding: 12px 8px;
    transition: all 0.15s;
}

.floating-sidebar-expand-btn:hover {
    color: #f5c211;
    background: rgba(245, 194, 17, 0.05);
}

.floating-sidebar-expand-btn svg {
    width: 16px;
    height: 16px;
}

.floating-sidebar-expand-btn .expand-user-count {
    font-size: 0.7rem;
    font-weight: 700;
    background: rgba(76, 175, 80, 0.2);
    color: #4caf50;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

/* Sent/Received Message Alignment */
.floating-chat-messages .chat-message-group {
    padding: 8px 10px;
    margin: 4px 0;
    display: flex;
    gap: 10px;
    max-width: 85%;
    animation: messageSlideIn 0.2s ease;
}

@keyframes messageSlideIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Received messages (left aligned) */
.floating-chat-messages .chat-message-group {
    align-self: flex-start;
}

.floating-chat-messages .chat-message-group .chat-content {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0; /* Remove padding so bubbles align correctly */
}

/* Sent messages (right aligned) */
.floating-chat-messages .chat-message-group.own-message {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.floating-chat-messages .chat-message-group.own-message .chat-content {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

.floating-chat-messages .chat-message-group.own-message .chat-meta {
    justify-content: flex-end;
}

/* Received messages (left aligned) */
.floating-chat-messages .chat-message-group:not(.own-message) .chat-meta {
    justify-content: flex-start;
}

.floating-chat-reply-line {
    width: 3px;
    background: var(--accent, #f5c211);
    border-radius: 2px;
    flex-shrink: 0;
    display: none; /* Hidden since we're using border-left */
}

.floating-chat-reply-username {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent, #f5c211);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.floating-chat-reply-username svg {
    width: 12px;
    height: 12px;
    opacity: 0.7;
}

.floating-chat-reply-text {
    font-size: 0.8rem;
    color: #999;
    font-style: italic;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Image in reply */
.floating-chat-reply-block .reply-image-preview {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
}

/* Expanded mode reply styling */
.floating-chat-panel.expanded .floating-chat-reply-block {
    padding: 14px 18px;
    border-radius: 12px;
    border-left-width: 5px;
}

.floating-chat-panel.expanded .floating-chat-reply-block::before {
    top: -9px;
    font-size: 0.65rem;
    padding: 2px 8px;
}

.floating-chat-panel.expanded .floating-chat-reply-username {
    font-size: 0.8rem;
}

.floating-chat-panel.expanded .floating-chat-reply-text {
    font-size: 0.85rem;
}

/* Expand button in header */
.floating-chat-expand-btn {
    background: transparent;
    border: none;
    color: #888;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.floating-chat-expand-btn:hover {
    color: #f5c211;
    background: rgba(245, 194, 17, 0.1);
}

.floating-chat-expand-btn svg {
    width: 18px;
    height: 18px;
}

/* Mention autocomplete for floating chat */
.floating-chat-panel .mention-popup {
    bottom: 100%;
    left: 16px;
    right: 16px;
    margin-bottom: 8px;
    max-height: 200px;
}

/* Image preview for floating chat */
.floating-chat-image-preview {
    padding: 8px 16px;
    background: rgba(245, 194, 17, 0.05);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    gap: 10px;
}

.floating-chat-image-preview img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.floating-chat-image-preview .remove-image {
    width: 24px;
    height: 24px;
    background: rgba(244, 67, 54, 0.2);
    border: none;
    border-radius: 50%;
    color: #f44336;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
}

.floating-chat-image-preview .remove-image:hover {
    background: rgba(244, 67, 54, 0.3);
}

/* Ensure floating chat is above other elements */
.floating-chat-btn,
.floating-chat-panel {
    z-index: 9998;
}

/* Popout button to go to full community page */
.floating-chat-popout-btn {
    color: #888;
    font-size: 0.7rem;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.15s;
}

.floating-chat-popout-btn:hover {
    color: #f5c211;
    background: rgba(245, 194, 17, 0.1);
}

.floating-chat-popout-btn svg {
    width: 12px;
    height: 12px;
}

/* =============================================
   FLOATING MODAL STYLES
   (For confirm/alert/prompt dialogs)
   ============================================= */

.floating-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    animation: floatingModalFadeIn 0.2s ease;
}

@keyframes floatingModalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.floating-modal-content {
    background: linear-gradient(145deg, #1a1a1a, #0d0d0d);
    border: 1px solid rgba(245, 194, 17, 0.3);
    border-radius: 16px;
    width: 90%;
    max-width: 420px;
    box-shadow: 
        0 0 40px rgba(0, 0, 0, 0.8),
        0 0 20px rgba(245, 194, 17, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    overflow: hidden;
    animation: floatingModalSlideIn 0.25s ease;
}

@keyframes floatingModalSlideIn {
    from {
        transform: scale(0.9) translateY(-20px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.floating-modal-header {
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(245, 194, 17, 0.15), rgba(255, 149, 0, 0.1));
    border-bottom: 1px solid rgba(245, 194, 17, 0.2);
    font-size: 1.1rem;
    font-weight: 600;
    color: #f5c211;
    display: flex;
    align-items: center;
    gap: 8px;
}

.floating-modal-body {
    padding: 20px;
    color: #e0e0e0;
    font-size: 0.95rem;
    line-height: 1.6;
}

.floating-modal-body p {
    margin: 0 0 12px 0;
}

.floating-modal-input {
    width: 100%;
    padding: 12px 14px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.floating-modal-input:focus {
    border-color: rgba(245, 194, 17, 0.5);
    box-shadow: 0 0 0 3px rgba(245, 194, 17, 0.1);
}

.floating-modal-footer {
    padding: 16px 20px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.floating-modal-btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.floating-modal-btn-primary {
    background: linear-gradient(135deg, #f5c211 0%, #ff9500 100%);
    color: #000;
}

.floating-modal-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 194, 17, 0.3);
}

.floating-modal-btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #e0e0e0;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.floating-modal-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.2);
}

/* =============================================
   SETTINGS PANEL STYLES
   ============================================= */

.floating-chat-settings-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    color: #888;
}

.floating-chat-settings-btn:hover {
    background: rgba(245, 194, 17, 0.15);
    color: #f5c211;
}

.floating-chat-settings-btn svg {
    width: 16px;
    height: 16px;
}

.floating-chat-settings-panel {
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    background: linear-gradient(145deg, #1a1a1a, #0d0d0d);
    border-bottom: 1px solid rgba(245, 194, 17, 0.2);
    z-index: 10;
    animation: settingsSlideIn 0.2s ease;
}

@keyframes settingsSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.settings-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.settings-panel-header h4 {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: #f5c211;
}

.settings-close-btn {
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
    border-radius: 4px;
    transition: all 0.15s;
}

.settings-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.settings-close-btn svg {
    width: 14px;
    height: 14px;
}

.settings-panel-body {
    padding: 16px;
}

.settings-option {
    margin-bottom: 16px;
}

.settings-option:last-child {
    margin-bottom: 0;
}

.settings-option label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: #e0e0e0;
    margin-bottom: 10px;
}

.settings-toggle-group {
    display: flex;
    gap: 8px;
}

.settings-toggle-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #888;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.settings-toggle-btn svg {
    width: 16px;
    height: 16px;
}

.settings-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    color: #bbb;
}

.settings-toggle-btn.active {
    background: linear-gradient(135deg, rgba(245, 194, 17, 0.2), rgba(255, 149, 0, 0.15));
    border-color: rgba(245, 194, 17, 0.4);
    color: #f5c211;
}

.settings-hint {
    font-size: 0.7rem;
    color: #666;
    margin: 8px 0 0 0;
    font-style: italic;
}

/* =============================================
   ENHANCED REPLY/QUOTE BLOCK STYLING
   ============================================= */

/* Override for better quote appearance in messages */
.floating-chat-reply-block {
    display: flex;
    gap: 12px;
    margin-top: 14px; /* Space for the 'Replying to' label */
    margin-bottom: 10px;
    padding: 10px 14px;
    background: linear-gradient(135deg, rgba(245, 194, 17, 0.1) 0%, rgba(255, 149, 0, 0.05) 100%);
    border-radius: 10px;
    border-left: 3px solid var(--accent, #f5c211);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    box-shadow: 
        inset 0 1px 0 rgba(255, 255, 255, 0.03),
        0 2px 8px rgba(0, 0, 0, 0.2);
}

.floating-chat-reply-block::before {
    content: '↩ Reply';
    position: absolute;
    top: -9px;
    left: 8px;
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #f5c211;
    background: #0d0d0d;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid rgba(245, 194, 17, 0.25);
    line-height: 1;
}

.floating-chat-reply-block:hover {
    background: linear-gradient(135deg, rgba(245, 194, 17, 0.12) 0%, rgba(255, 149, 0, 0.08) 100%);
    border-left-color: #ffb700;
    transform: translateX(2px);
}

.floating-chat-reply-content {
    flex: 1;
    min-width: 0;
    padding-top: 4px;
}

.floating-chat-reply-username {
    font-size: 0.8rem;
    font-weight: 700;
    color: #f5c211;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.floating-chat-reply-username svg {
    width: 14px;
    height: 14px;
    opacity: 0.8;
}

.floating-chat-reply-text {
    font-size: 0.82rem;
    color: #aaa;
    font-style: italic;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    padding: 6px 10px;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 8px;
    border-left: 2px solid rgba(245, 194, 17, 0.3);
}

/* Image in reply - enhanced */
.floating-chat-reply-block .reply-image-preview {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid rgba(245, 194, 17, 0.2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    margin-top: 4px;
}

/* =============================================
   LOAD MORE MESSAGES BUTTON
   ============================================= */
.floating-chat-load-more {
    display: none;
    justify-content: center;
    padding: 12px 16px;
    background: linear-gradient(180deg, rgba(20, 20, 20, 0.98) 0%, rgba(20, 20, 20, 0.9) 100%);
    position: sticky;
    top: 0;
    z-index: 10;
}

.floating-chat-load-more .load-more-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: linear-gradient(135deg, rgba(245, 194, 17, 0.15) 0%, rgba(255, 149, 0, 0.1) 100%);
    border: 1px solid rgba(245, 194, 17, 0.3);
    border-radius: 20px;
    color: #f5c211;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.floating-chat-load-more .load-more-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, rgba(245, 194, 17, 0.25) 0%, rgba(255, 149, 0, 0.2) 100%);
    border-color: rgba(245, 194, 17, 0.5);
    transform: translateY(-1px);
}

.floating-chat-load-more .load-more-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.floating-chat-load-more .load-more-btn svg {
    width: 16px;
    height: 16px;
}

.floating-chat-load-more .load-more-btn .loading-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* =============================================
   MENTION AUTOCOMPLETE
   ============================================= */
.mention-autocomplete {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 60px;
    max-height: 280px;
    background: linear-gradient(135deg, #1a1a1a 0%, #141414 100%);
    border: 1px solid rgba(245, 194, 17, 0.3);
    border-radius: 12px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(245, 194, 17, 0.1);
    overflow: hidden;
    z-index: 1000;
    margin-bottom: 8px;
}

.mention-autocomplete-list {
    max-height: 280px;
    overflow-y: auto;
    padding: 8px;
}

.mention-autocomplete-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.mention-autocomplete-item:hover,
.mention-autocomplete-item.selected {
    background: linear-gradient(135deg, rgba(245, 194, 17, 0.15) 0%, rgba(255, 149, 0, 0.1) 100%);
}

.mention-autocomplete-item.selected {
    border-left: 3px solid #f5c211;
}

.mention-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(245, 194, 17, 0.3);
}

.mention-username {
    flex: 1;
    font-weight: 500;
    color: #e0e0e0;
}

.mention-status {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
    text-transform: uppercase;
    font-weight: 600;
}

.mention-status.online {
    background: rgba(76, 175, 80, 0.2);
    color: #4caf50;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.mention-status.idle {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
    border: 1px solid rgba(255, 193, 7, 0.3);
}

/* @everyone option styling */
.mention-autocomplete-item.everyone-option {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.15) 0%, rgba(56, 142, 60, 0.1) 100%);
}

.mention-autocomplete-item.everyone-option:hover,
.mention-autocomplete-item.everyone-option.selected {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.25) 0%, rgba(56, 142, 60, 0.2) 100%);
}

.mention-autocomplete-item.everyone-option.selected {
    border-left: 3px solid #4caf50;
}

.everyone-hint {
    font-size: 0.7rem;
    color: rgba(76, 175, 80, 0.9);
    font-weight: 400;
    margin-left: 4px;
}

/* =============================================
   OLD MESSAGE NOTICE (when navigating to archived message)
   ============================================= */
.old-message-notice {
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%) !important;
    border-radius: 8px;
    margin: 8px;
}

.old-message-header {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #f5c211;
    font-weight: 600;
    margin-bottom: 8px;
}

.old-message-icon {
    font-size: 16px;
}

.old-message-preview {
    background: rgba(0, 0, 0, 0.3);
    padding: 10px 12px;
    border-radius: 8px;
    border-left: 3px solid #f5c211;
}

.old-message-preview strong {
    color: #f5c211;
}

.old-message-time {
    color: #888;
    font-size: 0.75rem;
    margin-left: 8px;
}

.old-message-text {
    margin-top: 6px;
    color: #ccc;
    line-height: 1.4;
}

.old-message-has-image {
    margin-top: 6px;
    color: #888;
    font-size: 0.8rem;
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: translateY(-10px); }
    10% { opacity: 1; transform: translateY(0); }
    80% { opacity: 1; }
    100% { opacity: 0; }
}
