/**
 * Messaging System Styles
 * Facebook Clone - Messaging Interface
 */

/* Main Messaging Modal */
.messaging-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(3px);
}

.messaging-modal-content {
    width: 90%;
    max-width: 1200px;
    height: 90%;
    max-height: 800px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Messaging Header */
.messaging-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e4e6ea;
    background: #fff;
}

.messaging-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #1c1e21;
}

.messaging-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-messaging-search,
.btn-messaging-close {
    width: 36px;
    height: 36px;
    border: none;
    background: #f0f2f5;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #65676b;
    transition: background-color 0.2s;
}

.btn-messaging-search:hover,
.btn-messaging-close:hover {
    background: #e4e6ea;
}

/* Search Bar */
.messaging-search {
    padding: 16px 20px;
    border-bottom: 1px solid #e4e6ea;
}

.messaging-search input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #dddfe2;
    border-radius: 20px;
    font-size: 14px;
    background: #f0f2f5;
    outline: none;
}

.messaging-search input:focus {
    border-color: #1877f2;
    background: #fff;
}

.search-results {
    margin-top: 8px;
    max-height: 200px;
    overflow-y: auto;
}

/* Messaging Body */
.messaging-body {
    flex: 1;
    display: flex;
    min-height: 0;
}

/* Conversations Sidebar */
.conversations-sidebar {
    width: 360px;
    border-right: 1px solid #e4e6ea;
    display: flex;
    flex-direction: column;
    background: #fff;
}

.conversations-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e4e6ea;
}

.conversations-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #1c1e21;
}

.btn-new-message {
    width: 32px;
    height: 32px;
    border: none;
    background: #1877f2;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    transition: background-color 0.2s;
}

.btn-new-message:hover {
    background: #166fe5;
}

.conversations-list {
    flex: 1;
    overflow-y: auto;
}

.loading-conversations {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: #65676b;
    gap: 8px;
}

/* Conversation Item */
.conversation-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    cursor: pointer;
    border-bottom: 1px solid #f0f2f5;
    transition: background-color 0.2s;
    position: relative;
}

.conversation-item:hover {
    background: #f2f3f5;
}

.conversation-item.active {
    background: #e7f3ff;
    border-right: 3px solid #1877f2;
}

.conversation-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    margin-right: 12px;
    object-fit: cover;
}

.conversation-info {
    flex: 1;
    min-width: 0;
}

.conversation-name {
    font-weight: 600;
    font-size: 15px;
    color: #1c1e21;
    margin: 0 0 4px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conversation-preview {
    font-size: 13px;
    color: #65676b;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conversation-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.conversation-time {
    font-size: 12px;
    color: #65676b;
}

.unread-badge {
    background: #1877f2;
    color: white;
    border-radius: 50%;
    min-width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
}

/* Chat Window */
.chat-window {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #fff;
}

.chat-welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 40px;
    text-align: center;
}

.welcome-icon {
    width: 80px;
    height: 80px;
    background: #e7f3ff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    font-size: 32px;
    color: #1877f2;
}

.chat-welcome h3 {
    margin: 0 0 8px 0;
    font-size: 20px;
    color: #1c1e21;
}

.chat-welcome p {
    margin: 0 0 20px 0;
    color: #65676b;
    font-size: 14px;
}

.btn-start-conversation {
    padding: 8px 16px;
    background: #1877f2;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.2s;
}

.btn-start-conversation:hover {
    background: #166fe5;
}

/* Active Chat */
.active-chat {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e4e6ea;
    background: #fff;
}

.chat-participant-info {
    display: flex;
    align-items: center;
    flex: 1;
}

.participant-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 12px;
    object-fit: cover;
}

.participant-details h4 {
    margin: 0 0 2px 0;
    font-size: 16px;
    font-weight: 600;
    color: #1c1e21;
}

.participant-status {
    font-size: 12px;
    color: #65676b;
}

.chat-actions {
    display: flex;
    gap: 8px;
}

.btn-chat-action {
    width: 36px;
    height: 36px;
    border: none;
    background: #f0f2f5;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #1877f2;
    transition: background-color 0.2s;
}

.btn-chat-action:hover {
    background: #e4e6ea;
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #fff;
    scroll-behavior: smooth;
}

.loading-messages {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #65676b;
    gap: 8px;
}

.message {
    margin-bottom: 16px;
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.message.own {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
}

.message.own .message-avatar {
    display: none;
}

.message-content {
    max-width: 60%;
    position: relative;
}

.message.own .message-content {
    align-self: flex-end;
}

.message-bubble {
    padding: 8px 12px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
    position: relative;
    cursor: pointer;
}

.message:not(.own) .message-bubble {
    background: #f0f2f5;
    color: #1c1e21;
    border-bottom-left-radius: 4px;
}

.message.own .message-bubble {
    background: #1877f2;
    color: white;
    border-bottom-right-radius: 4px;
}

.message-bubble:hover {
    opacity: 0.9;
}

.message-time {
    font-size: 11px;
    color: #65676b;
    margin-top: 4px;
    padding: 0 12px;
}

.message.own .message-time {
    text-align: right;
}

.message-reply-to {
    background: rgba(0, 0, 0, 0.1);
    padding: 6px 8px;
    border-radius: 8px;
    margin-bottom: 4px;
    font-size: 12px;
    border-left: 3px solid rgba(255, 255, 255, 0.3);
}

.message:not(.own) .message-reply-to {
    border-left-color: #1877f2;
}

/* Chat Input */
.chat-input-container {
    padding: 16px 20px;
    border-top: 1px solid #e4e6ea;
    background: #fff;
}

.chat-input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    background: #f0f2f5;
    border-radius: 20px;
    padding: 8px 12px;
}

.btn-emoji {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 16px;
    color: #1877f2;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.btn-emoji:hover {
    background: rgba(24, 119, 242, 0.1);
}

#message-input {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    resize: none;
    font-size: 14px;
    line-height: 1.4;
    max-height: 100px;
    padding: 6px 0;
    font-family: inherit;
}

.input-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-attach,
.btn-image {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 16px;
    color: #1877f2;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.btn-attach:hover,
.btn-image:hover {
    background: rgba(24, 119, 242, 0.1);
}

.btn-send {
    width: 32px;
    height: 32px;
    border: none;
    background: #1877f2;
    color: white;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.btn-send:hover:not(:disabled) {
    background: #166fe5;
    transform: scale(1.05);
}

.btn-send:disabled {
    background: #bcc0c4;
    cursor: not-allowed;
    transform: none;
}

/* Reply Preview */
.reply-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #f0f2f5;
    border-radius: 8px;
    margin-bottom: 8px;
}

.reply-content {
    flex: 1;
}

.reply-to {
    font-size: 12px;
    color: #1877f2;
    margin-bottom: 2px;
}

.reply-preview p {
    margin: 0;
    font-size: 13px;
    color: #65676b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-cancel-reply {
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 12px;
    color: #65676b;
    border-radius: 50%;
}

.btn-cancel-reply:hover {
    background: #e4e6ea;
}

/* New Message Dialog */
.new-message-dialog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
}

.dialog-content {
    width: 90%;
    max-width: 500px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e4e6ea;
}

.dialog-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1c1e21;
}

.btn-close-dialog {
    width: 32px;
    height: 32px;
    border: none;
    background: #f0f2f5;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #65676b;
}

.btn-close-dialog:hover {
    background: #e4e6ea;
}

.dialog-body {
    padding: 20px;
}

.recipient-search {
    margin-bottom: 16px;
}

.recipient-search label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #1c1e21;
}

.recipient-search input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #dddfe2;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
}

.recipient-search input:focus {
    border-color: #1877f2;
}

.recipient-suggestions {
    margin-top: 8px;
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #e4e6ea;
    border-radius: 8px;
    background: #fff;
    display: none;
}

.recipient-suggestions.show {
    display: block;
}

.recipient-suggestion {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f0f2f5;
}

.recipient-suggestion:last-child {
    border-bottom: none;
}

.recipient-suggestion:hover {
    background: #f2f3f5;
}

.recipient-suggestion img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 12px;
    object-fit: cover;
}

.recipient-suggestion .name {
    font-weight: 600;
    color: #1c1e21;
}

.selected-recipients {
    margin-bottom: 16px;
}

.selected-recipients h4 {
    margin: 0 0 8px 0;
    font-size: 14px;
    font-weight: 600;
    color: #1c1e21;
}

.recipients-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.selected-recipient {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: #e7f3ff;
    border-radius: 20px;
    font-size: 14px;
}

.selected-recipient img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

.btn-remove-recipient {
    width: 20px;
    height: 20px;
    border: none;
    background: #1877f2;
    color: white;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.message-preview textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #dddfe2;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
}

.message-preview textarea:focus {
    border-color: #1877f2;
}

.dialog-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid #e4e6ea;
    background: #f8f9fa;
}

.btn-cancel {
    padding: 8px 16px;
    border: 1px solid #dddfe2;
    background: #fff;
    color: #1c1e21;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.2s;
}

.btn-cancel:hover {
    background: #f2f3f5;
}

.btn-send-new-message {
    padding: 8px 16px;
    border: none;
    background: #1877f2;
    color: white;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.2s;
}

.btn-send-new-message:hover:not(:disabled) {
    background: #166fe5;
}

.btn-send-new-message:disabled {
    background: #bcc0c4;
    cursor: not-allowed;
}

/* Context Menu */
.context-menu {
    position: fixed;
    background: #fff;
    border: 1px solid #e4e6ea;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    z-index: 10001;
    min-width: 150px;
    overflow: hidden;
}

.context-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f0f2f5;
    font-size: 14px;
    color: #1c1e21;
}

.context-menu-item:last-child {
    border-bottom: none;
}

.context-menu-item:hover {
    background: #f2f3f5;
}

.context-menu-item i {
    width: 16px;
    color: #65676b;
}

/* Media Messages */
.message-media {
    max-width: 100%;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 4px;
}

.message-media img {
    width: 100%;
    height: auto;
    display: block;
}

.message-media video {
    width: 100%;
    height: auto;
    display: block;
}

/* Responsive Design */
@media (max-width: 768px) {
    .messaging-modal-content {
        width: 100%;
        height: 100%;
        max-width: none;
        max-height: none;
        border-radius: 0;
    }
    
    .conversations-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #e4e6ea;
    }
    
    .messaging-body {
        flex-direction: column;
    }
    
    .chat-window {
        display: none;
    }
    
    .chat-window.mobile-active {
        display: flex;
    }
    
    .conversations-sidebar.mobile-hidden {
        display: none;
    }
    
    .message-content {
        max-width: 80%;
    }
}

@media (max-width: 480px) {
    .messaging-modal-content {
        padding: 0;
    }
    
    .messaging-header,
    .conversations-header,
    .chat-header {
        padding: 12px 16px;
    }
    
    .chat-messages {
        padding: 16px;
    }
    
    .chat-input-container {
        padding: 12px 16px;
    }
    
    .message-content {
        max-width: 85%;
    }
}

/* Animation */
@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.messaging-modal-content {
    animation: fadeIn 0.2s ease-out;
}

/* Scrollbar Styling */
.conversations-list::-webkit-scrollbar,
.chat-messages::-webkit-scrollbar,
.recipient-suggestions::-webkit-scrollbar {
    width: 6px;
}

.conversations-list::-webkit-scrollbar-track,
.chat-messages::-webkit-scrollbar-track,
.recipient-suggestions::-webkit-scrollbar-track {
    background: #f0f2f5;
}

.conversations-list::-webkit-scrollbar-thumb,
.chat-messages::-webkit-scrollbar-thumb,
.recipient-suggestions::-webkit-scrollbar-thumb {
    background: #bcc0c4;
    border-radius: 3px;
}

.conversations-list::-webkit-scrollbar-thumb:hover,
.chat-messages::-webkit-scrollbar-thumb:hover,
.recipient-suggestions::-webkit-scrollbar-thumb:hover {
    background: #8a8d91;
}

/* Online Status Indicators */
.participant-avatar.online::after,
.conversation-avatar.online::after {
    content: '';
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    background: #42b883;
    border: 2px solid #fff;
    border-radius: 50%;
}

.conversation-item {
    position: relative;
}

.conversation-avatar {
    position: relative;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    color: #65676b;
    font-size: 13px;
    font-style: italic;
}

.typing-dots {
    display: flex;
    gap: 2px;
}

.typing-dot {
    width: 4px;
    height: 4px;
    background: #65676b;
    border-radius: 50%;
    animation: typingDot 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingDot {
    0%, 80%, 100% { opacity: 0.3; }
    40% { opacity: 1; }
}

/* Message Status Icons */
.message-status {
    font-size: 12px;
    margin-left: 4px;
    opacity: 0.7;
}

.message-status.sent { color: #65676b; }
.message-status.delivered { color: #1877f2; }
.message-status.read { color: #42b883; }

/* Floating Messaging Box (Facebook Style) */
.floating-messaging-box {
    position: fixed;
    bottom: 0;
    right: 20px;
    width: 360px;
    height: 500px;
    background: #fff;
    border: 1px solid #e4e6ea;
    border-radius: 12px 12px 0 0;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.15);
    z-index: 9998;
    display: flex;
    flex-direction: column;
    font-family: inherit;
    transition: height 0.3s ease;
}

.floating-messaging-box.minimized {
    height: 56px;
}

.floating-box-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #fff;
    border-radius: 12px 12px 0 0;
    border-bottom: 1px solid #e4e6ea;
    cursor: pointer;
    min-height: 32px;
}

.floating-messaging-box.minimized .floating-box-header {
    border-bottom: none;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.header-content i {
    color: #1877f2;
    font-size: 16px;
}

.header-title {
    font-weight: 600;
    color: #1c1e21;
    font-size: 14px;
}

.unread-count {
    background: #ff3040;
    color: white;
    border-radius: 10px;
    min-width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    margin-left: 4px;
}

.header-actions {
    display: flex;
    gap: 4px;
}

.btn-minimize,
.btn-close {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #65676b;
    transition: background-color 0.2s;
}

.btn-minimize:hover,
.btn-close:hover {
    background: #f0f2f5;
}

.floating-box-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.floating-messaging-box.minimized .floating-box-content {
    display: none;
}

.floating-conversations {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.floating-conversations-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-bottom: 1px solid #f0f2f5;
}

.floating-search-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #dddfe2;
    border-radius: 16px;
    background: #f0f2f5;
    font-size: 13px;
    outline: none;
}

.floating-search-input:focus {
    border-color: #1877f2;
    background: #fff;
}

.btn-new-floating-message {
    width: 32px;
    height: 32px;
    border: none;
    background: #1877f2;
    color: white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: background-color 0.2s;
}

.btn-new-floating-message:hover {
    background: #166fe5;
}

.floating-conversations-list {
    flex: 1;
    overflow-y: auto;
}

.floating-conversation-item {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f8f9fa;
    transition: background-color 0.2s;
    position: relative;
}

.floating-conversation-item:hover {
    background: #f2f3f5;
}

.floating-conversation-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 10px;
    object-fit: cover;
}

.floating-conversation-info {
    flex: 1;
    min-width: 0;
}

.floating-conversation-info h5 {
    margin: 0 0 2px 0;
    font-size: 13px;
    font-weight: 600;
    color: #1c1e21;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.floating-conversation-info p {
    margin: 0;
    font-size: 12px;
    color: #65676b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.floating-unread-badge {
    background: #1877f2;
    color: white;
    border-radius: 50%;
    min-width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    position: absolute;
    top: 8px;
    right: 16px;
}

.no-conversations {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    text-align: center;
    color: #65676b;
    font-size: 13px;
}

.no-conversations i {
    font-size: 24px;
    margin-bottom: 8px;
    opacity: 0.5;
}

/**
 * ================================
 * EMOJI PICKER STYLES
 * ================================
 */

.emoji-picker {
    position: absolute;
    bottom: 60px;
    left: 10px;
    width: 320px;
    height: 350px;
    background: #fff;
    border: 1px solid #e4e6ea;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.emoji-picker-header {
    padding: 12px;
    border-bottom: 1px solid #e4e6ea;
    background: #f8f9fa;
}

.emoji-search-container {
    position: relative;
}

.emoji-search-container input {
    width: 100%;
    padding: 8px 12px 8px 32px;
    border: 1px solid #e4e6ea;
    border-radius: 20px;
    font-size: 14px;
    outline: none;
    background: #fff;
}

.emoji-search-container input:focus {
    border-color: #1877f2;
}

.emoji-search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #8a8d91;
    font-size: 12px;
}

.emoji-categories {
    display: flex;
    padding: 8px 4px;
    border-bottom: 1px solid #e4e6ea;
    background: #f8f9fa;
    overflow-x: auto;
}

.emoji-category {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s;
    margin: 0 2px;
}

.emoji-category:hover {
    background: #e4e6ea;
}

.emoji-category.active {
    background: #1877f2;
    color: #fff;
}

.emoji-category.active .emoji-icon {
    filter: brightness(0) invert(1);
}

.emoji-icon {
    font-size: 16px;
    line-height: 1;
}

.emoji-content {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 4px;
}

.emoji-item {
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
    transition: background-color 0.2s;
}

.emoji-item:hover {
    background: #f0f2f5;
    transform: scale(1.1);
}

.emoji-item:active {
    transform: scale(0.95);
}

/**
 * ================================
 * FILE ATTACHMENT STYLES
 * ================================
 */

.file-preview-container {
    position: absolute;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    width: 400px;
    max-height: 300px;
    background: #fff;
    border: 1px solid #e4e6ea;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    overflow: hidden;
}

.file-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid #e4e6ea;
    background: #f8f9fa;
}

.file-preview-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #1c1e21;
}

.btn-close-preview {
    width: 28px;
    height: 28px;
    border: none;
    background: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8a8d91;
    transition: all 0.2s;
}

.btn-close-preview:hover {
    background: #e4e6ea;
    color: #1c1e21;
}

.file-preview-list {
    max-height: 240px;
    overflow-y: auto;
    padding: 8px;
}

.file-preview-item {
    display: flex;
    align-items: center;
    padding: 8px;
    border: 1px solid #e4e6ea;
    border-radius: 8px;
    margin-bottom: 8px;
    background: #f8f9fa;
    position: relative;
}

.file-preview-item:last-child {
    margin-bottom: 0;
}

.file-preview-icon {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    font-size: 16px;
    color: #fff;
    flex-shrink: 0;
}

.file-preview-icon.image {
    background: #42b883;
}

.file-preview-icon.video {
    background: #e74c3c;
}

.file-preview-icon.document {
    background: #3498db;
}

.file-preview-icon.archive {
    background: #f39c12;
}

.file-preview-icon.other {
    background: #95a5a6;
}

.file-preview-info {
    flex: 1;
    min-width: 0;
}

.file-preview-name {
    font-weight: 500;
    color: #1c1e21;
    margin-bottom: 2px;
    word-break: break-word;
}

.file-preview-size {
    font-size: 12px;
    color: #8a8d91;
}

.file-preview-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    border: none;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    transition: background-color 0.2s;
}

.file-preview-remove:hover {
    background: rgba(0, 0, 0, 0.8);
}

.file-preview-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 8px;
}

.file-preview-video {
    width: 100%;
    height: 200px;
    border-radius: 6px;
    margin-bottom: 8px;
}

/**
 * ================================
 * MESSAGE ATTACHMENT DISPLAY
 * ================================
 */

.message-attachments {
    margin-top: 8px;
}

.message-attachment {
    margin-bottom: 8px;
}

.message-attachment:last-child {
    margin-bottom: 0;
}

.attachment-image {
    max-width: 100%;
    max-height: 300px;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s;
}

.attachment-image:hover {
    transform: scale(1.02);
}

.attachment-video {
    width: 100%;
    max-height: 300px;
    border-radius: 8px;
}

.attachment-file {
    display: flex;
    align-items: center;
    padding: 12px;
    background: #f0f2f5;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    border: 1px solid #e4e6ea;
    transition: background-color 0.2s;
}

.attachment-file:hover {
    background: #e4e6ea;
    text-decoration: none;
    color: inherit;
}

.attachment-file-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    font-size: 14px;
    color: #fff;
}

.attachment-file-info {
    flex: 1;
    min-width: 0;
}

.attachment-file-name {
    font-weight: 500;
    color: #1c1e21;
    margin-bottom: 2px;
    word-break: break-word;
}

.attachment-file-size {
    font-size: 12px;
    color: #8a8d91;
}

.attachment-download {
    width: 32px;
    height: 32px;
    border: none;
    background: #1877f2;
    color: #fff;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.attachment-download:hover {
    background: #166fe5;
}

/**
 * ================================
 * DRAG AND DROP STYLES
 * ================================
 */

.chat-input-wrapper.drag-over {
    border: 2px dashed #1877f2;
    background: rgba(24, 119, 242, 0.05);
}

.drag-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(24, 119, 242, 0.1);
    border: 2px dashed #1877f2;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    z-index: 1000;
    pointer-events: none;
}

.drag-overlay-content {
    text-align: center;
    color: #1877f2;
}

.drag-overlay-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.drag-overlay-text {
    font-size: 16px;
    font-weight: 600;
}

/**
 * ================================
 * ENHANCED INPUT CONTROLS
 * ================================
 */

.input-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: 8px;
}

.btn-emoji,
.btn-attach,
.btn-image {
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8a8d91;
    transition: all 0.2s;
}

.btn-emoji:hover,
.btn-attach:hover,
.btn-image:hover {
    background: #f0f2f5;
    color: #1877f2;
}

.btn-emoji.active {
    background: #1877f2;
    color: #fff;
}

.btn-send {
    width: 32px;
    height: 32px;
    border: none;
    background: #1877f2;
    color: #fff;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    margin-left: 4px;
}

.btn-send:hover:not(:disabled) {
    background: #166fe5;
    transform: scale(1.05);
}

.btn-send:disabled {
    background: #e4e6ea;
    color: #8a8d91;
    cursor: not-allowed;
    transform: none;
}

/**
 * ================================
 * LOADING AND PROGRESS INDICATORS
 * ================================
 */

.upload-progress {
    margin-top: 8px;
}

.progress-bar {
    width: 100%;
    height: 4px;
    background: #e4e6ea;
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: #1877f2;
    transition: width 0.3s ease;
}

.upload-status {
    display: flex;
    align-items: center;
    margin-top: 4px;
    font-size: 12px;
    color: #8a8d91;
}

.upload-status .fas {
    margin-right: 4px;
}

.upload-status.success {
    color: #42b883;
}

.upload-status.error {
    color: #e74c3c;
}

/* Floating Messaging Box Responsive */
@media (max-width: 768px) {
    .floating-messaging-box {
        right: 10px;
        width: 320px;
    }
    
    .emoji-picker {
        width: 280px;
        height: 300px;
    }
    
    .file-preview-container {
        width: 320px;
    }
}

@media (max-width: 480px) {
    .floating-messaging-box {
        right: 5px;
        left: 5px;
        width: auto;
    }
    
    .emoji-picker {
        left: 5px;
        right: 5px;
        width: auto;
        height: 280px;
    }
    
    .file-preview-container {
        left: 5px;
        right: 5px;
        width: auto;
        transform: none;
    }
    
    .emoji-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}