/* ============ MESSENGER STYLES ============ */
.messenger-page {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 9999;
    background: var(--dark-bg);
    animation: messengerSlideIn 0.3s ease;
}
.messenger-page.active { display: flex; }
@keyframes messengerSlideIn {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

.messenger-layout {
    display: flex;
    width: 100%;
    height: 100%;
}

/* Sidebar */
.msg-sidebar {
    width: 340px;
    min-width: 280px;
    border-right: 1px solid rgba(0,243,255,0.1);
    display: flex;
    flex-direction: column;
    background: rgba(4,6,16,0.95);
}
.msg-sidebar-header {
    padding: 16px 18px;
    border-bottom: 1px solid rgba(0,243,255,0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-shrink: 0;
}
.msg-sidebar-title {
    font-size: 1.15rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 8px;
}
.msg-sidebar-title i { -webkit-text-fill-color: var(--primary); }
.msg-back-btn {
    background: rgba(255,0,85,0.12);
    border: 1px solid rgba(255,0,85,0.25);
    color: var(--secondary);
    padding: 6px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.3s;
}
.msg-back-btn:hover { background: rgba(255,0,85,0.25); }

.msg-search-wrap {
    padding: 10px 14px;
    border-bottom: 1px solid rgba(0,243,255,0.05);
    flex-shrink: 0;
}
.msg-search-input {
    width: 100%;
    background: rgba(0,0,0,0.35);
    border: 1px solid rgba(0,243,255,0.12);
    color: #fff;
    padding: 9px 14px 9px 36px;
    border-radius: 10px;
    font-size: 0.85rem;
    outline: none;
    transition: border-color 0.3s;
}
.msg-search-input:focus { border-color: var(--primary); }
.msg-search-input::placeholder { color: var(--text-muted); }
.msg-search-wrap { position: relative; }
.msg-search-wrap i {
    position: absolute;
    left: 26px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.8rem;
}

.msg-new-btn {
    background: linear-gradient(135deg, var(--primary), rgba(0,200,255,0.8));
    color: var(--dark-bg);
    border: none;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 700;
    transition: all 0.3s;
}
.msg-new-btn:hover { transform: scale(1.05); box-shadow: 0 0 15px rgba(0,243,255,0.3); }

/* Conversation list */
.msg-convo-list {
    flex: 1;
    overflow-y: auto;
    padding: 6px 0;
}
.msg-convo-list::-webkit-scrollbar { width: 4px; }
.msg-convo-list::-webkit-scrollbar-thumb { background: rgba(0,243,255,0.15); border-radius: 2px; }

.msg-convo-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    cursor: pointer;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}
.msg-convo-item:hover { background: rgba(0,243,255,0.04); }
.msg-convo-item.active {
    background: rgba(0,243,255,0.08);
    border-left-color: var(--primary);
}
.msg-convo-item.has-unread { background: rgba(0,243,255,0.03); }

.msg-convo-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(0,243,255,0.15), rgba(255,0,85,0.1));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--primary);
    font-size: 0.85rem;
    flex-shrink: 0;
    position: relative;
    overflow: visible;
}
.msg-convo-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}
.msg-online-dot {
    position: absolute;
    bottom: 0px;
    right: 0px;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: #00e676;
    border: 2px solid var(--dark-bg);
    z-index: 2;
}

.msg-convo-info { flex: 1; min-width: 0; }
.msg-convo-name {
    font-size: 0.88rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.msg-convo-preview {
    font-size: 0.77rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

.msg-convo-meta {
    text-align: right;
    flex-shrink: 0;
}
.msg-convo-time {
    font-size: 0.68rem;
    color: var(--text-muted);
}
.msg-unread-badge {
    background: var(--primary);
    color: var(--dark-bg);
    font-size: 0.65rem;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 10px;
    margin-top: 4px;
    display: inline-block;
}

/* Chat area */
.msg-chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: rgb(2,2,8);
}

.msg-chat-header {
    padding: 14px 20px;
    border-bottom: 1px solid rgba(0,243,255,0.08);
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    background: rgba(4,6,16,0.8);
    backdrop-filter: blur(10px);
}
.msg-chat-back-mobile {
    display: none;
    background: none;
    border: none;
    color: var(--primary);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 4px;
}
.msg-chat-header-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(0,243,255,0.15), rgba(255,0,85,0.1));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--primary);
    font-size: 0.8rem;
    overflow: hidden;
    cursor: pointer;
}
.msg-chat-header-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.msg-chat-header-info { flex: 1; }
.msg-chat-header-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
}
.msg-chat-header-name:hover { color: var(--primary); }
.msg-chat-header-status {
    font-size: 0.72rem;
    color: var(--text-muted);
}
.msg-chat-actions {
    display: flex;
    gap: 8px;
}
.msg-chat-action-btn {
    background: rgba(0,243,255,0.08);
    border: 1px solid rgba(0,243,255,0.12);
    color: var(--text-muted);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.8rem;
}
.msg-chat-action-btn:hover { background: rgba(0,243,255,0.15); color: var(--primary); }

/* Messages */
.msg-messages-area {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.msg-messages-area::-webkit-scrollbar { width: 5px; }
.msg-messages-area::-webkit-scrollbar-thumb { background: rgba(0,243,255,0.12); border-radius: 3px; }

.msg-bubble-row {
    display: flex;
    max-width: 70%;
    gap: 8px;
    align-items: center;
}
.msg-bubble-row.sent { align-self: flex-end; flex-direction: row-reverse; }
.msg-bubble-row.received { align-self: flex-start; }

.msg-avatar-mini {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(0,243,255,0.15), rgba(0,100,200,0.2));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--primary);
    overflow: visible;
    flex-shrink: 0;
    position: relative;
}
.msg-avatar-mini img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}
.msg-avatar-mini .msg-mini-online-dot {
    position: absolute;
    bottom: -1px;
    right: -1px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #00e676;
    border: 2px solid var(--dark-bg);
    z-index: 2;
}
.msg-bubble-row.sent .msg-avatar-mini {
    background: linear-gradient(135deg, rgba(0,243,255,0.2), rgba(0,180,255,0.15));
}

.msg-sender-name {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 2px;
    padding-left: 4px;
}
.msg-bubble-row.sent .msg-sender-name {
    text-align: right;
    padding-right: 4px;
    padding-left: 0;
    color: rgba(0,243,255,0.6);
}

.msg-bubble {
    padding: 10px 16px;
    border-radius: 18px;
    font-size: 0.88rem;
    line-height: 1.45;
    word-break: break-word;
    position: relative;
}
.msg-bubble-row.sent .msg-bubble {
    background: linear-gradient(135deg, rgba(0,243,255,0.2), rgba(0,180,255,0.15));
    color: #e8f4ff;
    border-bottom-right-radius: 4px;
}
.msg-bubble-row.received .msg-bubble {
    background: rgba(255,255,255,0.06);
    color: #ccd;
    border-bottom-left-radius: 4px;
}
.msg-bubble-time {
    font-size: 0.62rem;
    color: rgba(136,153,187,0.5);
    margin-top: 3px;
    text-align: right;
}
.msg-bubble-row.received .msg-bubble-time { text-align: left; }

.msg-read-indicator {
    font-size: 0.6rem;
    color: var(--primary);
    display: inline-block;
    margin-left: 4px;
}

.msg-date-divider {
    text-align: center;
    margin: 16px 0;
    font-size: 0.7rem;
    color: var(--text-muted);
    position: relative;
}
.msg-date-divider::before, .msg-date-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: calc(50% - 50px);
    height: 1px;
    background: rgba(0,243,255,0.06);
}
.msg-date-divider::before { left: 0; }
.msg-date-divider::after { right: 0; }

/* Input */
.msg-input-area {
    padding: 12px 16px;
    border-top: 1px solid rgba(0,243,255,0.08);
    display: flex;
    align-items: flex-end;
    gap: 10px;
    flex-shrink: 0;
    background: rgba(4,6,16,0.9);
}
.msg-text-input {
    flex: 1;
    background: rgba(0,0,0,0.35);
    border: 1px solid rgba(0,243,255,0.12);
    color: #fff;
    padding: 10px 16px;
    border-radius: 22px;
    font-size: 0.88rem;
    outline: none;
    resize: none;
    min-height: 42px;
    max-height: 120px;
    line-height: 1.4;
    transition: border-color 0.3s;
    font-family: inherit;
}
.msg-text-input:focus { border-color: var(--primary); }
.msg-text-input::placeholder { color: var(--text-muted); }
.msg-bubble {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    text-transform: none;
    font-variant: normal;
    letter-spacing: normal;
}
.msg-text-input {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif !important;
    text-transform: none;
    font-variant: normal;
    letter-spacing: normal;
}

.msg-send-btn {
    background: linear-gradient(135deg, var(--primary), rgba(0,200,255,0.8));
    color: var(--dark-bg);
    border: none;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s;
    flex-shrink: 0;
}
.msg-send-btn:hover { transform: scale(1.08); box-shadow: 0 0 18px rgba(0,243,255,0.35); }
.msg-send-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }

/* Attachment Buttons */
.msg-attach-buttons {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}
.msg-attach-btn {
    background: rgba(0,243,255,0.08);
    border: 1px solid rgba(0,243,255,0.12);
    color: var(--primary);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.25s;
    flex-shrink: 0;
}
.msg-attach-btn:hover {
    background: rgba(0,243,255,0.18);
    border-color: var(--primary);
    transform: scale(1.08);
}
.msg-attach-btn:active { transform: scale(0.95); }
/* Camera button hidden on desktop, shown on mobile/tablet */
.msg-camera-btn { display: none !important; }
@media (max-width: 1024px) and (hover: none) and (pointer: coarse) {
    .msg-camera-btn { display: flex !important; }
}
@media (max-width: 768px) {
    .msg-camera-btn { display: flex !important; }
    .msg-attach-btn { width: 32px; height: 32px; font-size: 0.78rem; }
    .msg-attach-buttons { gap: 3px; }
}

/* Attachment Preview */
.msg-attach-preview {
    padding: 8px 16px;
    border-top: 1px solid rgba(0,243,255,0.08);
    background: rgba(4,6,16,0.95);
    position: relative;
    flex-shrink: 0;
}
.msg-attach-preview-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: rgba(0,243,255,0.06);
    border: 1px solid rgba(0,243,255,0.12);
    border-radius: 12px;
    max-height: 200px;
    overflow: hidden;
}
.msg-attach-preview-inner img {
    max-height: 140px;
    max-width: 200px;
    border-radius: 8px;
    object-fit: cover;
}
.msg-attach-preview-inner video {
    max-height: 140px;
    max-width: 200px;
    border-radius: 8px;
}
#msgAttachPreviewFile {
    color: var(--primary);
    font-size: 0.85rem;
    align-items: center;
    gap: 8px;
}
#msgAttachPreviewFile i { font-size: 1.5rem; }
.msg-attach-preview-close {
    position: absolute;
    top: 4px;
    right: 20px;
    background: rgba(255,0,80,0.85);
    border: none;
    color: #fff;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.2s;
}
.msg-attach-preview-close:hover { background: rgba(255,0,80,1); transform: scale(1.1); }

/* Attachment mobile sizing */
@media (max-width: 768px) {
    .msg-attachment-content img { max-width: 200px; max-height: 220px; }
    .msg-attachment-content video { max-width: 200px; max-height: 220px; }
    .msg-attachment-file { max-width: 190px; }
    .msg-attach-preview-inner img { max-width: 150px; max-height: 100px; }
    .msg-attach-preview-inner video { max-width: 150px; max-height: 100px; }
}

/* Attachment in message bubble */
.msg-attachment-content { margin-bottom: 4px; }
.msg-attachment-content img {
    max-width: 260px;
    max-height: 300px;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.2s;
    display: block;
}
.msg-attachment-content img:hover { transform: scale(1.02); }
.msg-attachment-content video {
    max-width: 260px;
    max-height: 300px;
    border-radius: 10px;
    display: block;
}
.msg-attachment-content audio {
    max-width: 240px;
    height: 38px;
}
.msg-attachment-file {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: rgba(0,243,255,0.06);
    border: 1px solid rgba(0,243,255,0.12);
    border-radius: 10px;
    color: var(--primary);
    text-decoration: none;
    transition: all 0.2s;
    max-width: 240px;
}
.msg-attachment-file:hover { background: rgba(0,243,255,0.12); color: #fff; }
.msg-attachment-file i { font-size: 1.4rem; flex-shrink: 0; }
.msg-attachment-file-info { overflow: hidden; }
.msg-attachment-file-name {
    font-size: 0.82rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}
.msg-attachment-file-dl { font-size: 0.7rem; opacity: 0.7; }

/* Image lightbox */
.msg-lightbox {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.92);
    z-index: 100020;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.msg-lightbox img {
    max-width: 92vw;
    max-height: 92vh;
    border-radius: 8px;
    box-shadow: 0 0 40px rgba(0,243,255,0.2);
}
.msg-lightbox-close {
    position: absolute;
    top: 16px;
    right: 20px;
    background: rgba(255,255,255,0.1);
    border: none;
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
}

/* Upload progress */
.msg-upload-progress {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 3px;
    background: rgba(0,243,255,0.1);
}
.msg-upload-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), rgba(0,200,255,0.8));
    width: 0%;
    transition: width 0.3s;
}

/* Context Menu */
.msg-ctx-menu {
    position: fixed;
    z-index: 100010;
    background: rgba(12,16,36,0.97);
    border: 1px solid rgba(0,243,255,0.15);
    border-radius: 14px;
    padding: 6px 0;
    min-width: 180px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.6), 0 0 12px rgba(0,243,255,0.08);
    backdrop-filter: blur(20px);
    animation: msgCtxIn 0.15s ease-out;
    display: none;
}
@keyframes msgCtxIn { from { opacity: 0; transform: scale(0.92); } to { opacity: 1; transform: scale(1); } }
.msg-ctx-menu.show { display: block; }
.msg-ctx-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: #e0e6f0;
    font-size: 0.82rem;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
}
.msg-ctx-item:hover { background: rgba(0,243,255,0.08); }
.msg-ctx-item i { width: 16px; text-align: center; font-size: 0.78rem; color: rgba(0,243,255,0.6); }
.msg-ctx-item.danger { color: #ff4757; }
.msg-ctx-item.danger i { color: #ff4757; }
.msg-ctx-sep { height: 1px; background: rgba(0,243,255,0.08); margin: 4px 0; }

/* 3-dot action button on messages */
.msg-actions-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    border: none;
    background: rgba(12,16,36,0.85);
    border: 1px solid rgba(0,243,255,0.12);
    border-radius: 50%;
    color: rgba(0,243,255,0.5);
    cursor: pointer;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 5;
}
.msg-bubble-row.sent .msg-actions-btn { left: -32px; }
.msg-bubble-row.received .msg-actions-btn { right: -32px; }
.msg-actions-btn:hover { background: rgba(0,243,255,0.12); color: var(--primary); }

/* Reply preview in input area */
.msg-reply-preview {
    display: none;
    padding: 8px 16px;
    border-top: 1px solid rgba(0,243,255,0.08);
    background: rgba(4,6,16,0.7);
    align-items: center;
    gap: 10px;
    font-size: 0.78rem;
}
.msg-reply-preview.show { display: flex; }
.msg-reply-bar {
    width: 3px;
    height: 30px;
    background: var(--primary);
    border-radius: 2px;
    flex-shrink: 0;
}
.msg-reply-info { flex: 1; overflow: hidden; }
.msg-reply-name { color: var(--primary); font-weight: 600; font-size: 0.72rem; }
.msg-reply-text { color: rgba(136,153,187,0.7); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 250px; }
.msg-reply-close {
    width: 24px;
    height: 24px;
    border: none;
    background: none;
    color: rgba(136,153,187,0.5);
    cursor: pointer;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}
.msg-reply-close:hover { background: rgba(255,71,87,0.15); color: #ff4757; }

/* Reply bubble inside message */
.msg-reply-ref {
    background: rgba(0,0,0,0.25);
    border-left: 3px solid var(--primary);
    border-radius: 6px;
    padding: 5px 10px;
    margin-bottom: 5px;
    font-size: 0.72rem;
    cursor: pointer;
}
.msg-reply-ref-name { color: var(--primary); font-weight: 600; font-size: 0.68rem; }
.msg-reply-ref-text { color: rgba(136,153,187,0.7); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }

/* Pinned message indicator */
.msg-pinned-icon { color: var(--accent); font-size: 0.6rem; margin-left: 4px; }
.msg-unsent-text { font-style: italic; color: rgba(136,153,187,0.4); }

/* Forward modal */
.msg-forward-modal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 100011;
    background: rgba(0,0,0,0.6);
    align-items: center;
    justify-content: center;
}
.msg-forward-modal.show { display: flex; }
.msg-forward-box {
    background: rgba(12,16,36,0.98);
    border: 1px solid rgba(0,243,255,0.15);
    border-radius: 16px;
    width: 320px;
    max-height: 400px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.msg-forward-header {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(0,243,255,0.08);
    font-size: 0.88rem;
    font-weight: 600;
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.msg-forward-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}
.msg-forward-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    cursor: pointer;
    transition: background 0.15s;
}
.msg-forward-item:hover { background: rgba(0,243,255,0.08); }
.msg-forward-item img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}
.msg-forward-item span { color: #e0e6f0; font-size: 0.82rem; }

/* Chat Info Panel */
.msg-info-panel {
    display: none;
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 360px;
    max-height: 80vh;
    background: rgba(6,8,20,0.98);
    border: 1px solid rgba(0,243,255,0.12);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5), 0 0 12px rgba(0,243,255,0.06);
    z-index: 100020;
    flex-direction: column;
    overflow-y: auto;
    animation: msgInfoIn 0.2s ease-out;
}
@media (min-width: 768px) {
    .msg-info-panel { max-width: 400px; max-height: 75vh; }
}
@media (min-width: 1200px) {
    .msg-info-panel { max-width: 440px; max-height: 70vh; }
}
@keyframes msgInfoIn { from { opacity: 0; transform: translate(-50%, -50%) scale(0.95); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
.msg-info-panel.show { display: flex; }
.msg-info-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 100019;
}
.msg-info-overlay.show { display: block; }
.msg-info-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid rgba(0,243,255,0.08);
}
.msg-info-header button {
    width: 32px; height: 32px; border: none; background: none;
    color: #e0e6f0; cursor: pointer; font-size: 1rem;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    transition: background 0.2s;
}
.msg-info-header button:hover { background: rgba(0,243,255,0.1); }
.msg-info-header span { font-size: 0.92rem; font-weight: 600; color: #fff; }

.msg-info-profile {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 28px 16px 20px;
    gap: 10px;
}
.msg-info-avatar {
    width: 80px; height: 80px; border-radius: 50%;
    border: 2px solid rgba(0,243,255,0.25);
    overflow: hidden; display: flex;
    align-items: center; justify-content: center;
    font-size: 1.6rem; font-weight: 700;
    color: var(--primary); background: rgba(0,243,255,0.08);
}
.msg-info-avatar img { width: 100%; height: 100%; object-fit: cover; }
.msg-info-name { font-size: 1.05rem; font-weight: 700; color: #fff; }
.msg-info-uid { font-size: 0.7rem; color: var(--text-muted); }
.msg-info-status {
    font-size: 0.72rem; padding: 3px 10px;
    border-radius: 12px; background: rgba(0,230,118,0.12);
    color: #00e676;
}
.msg-info-status.offline { background: rgba(136,153,187,0.12); color: var(--text-muted); }
.msg-info-stats {
    display: flex; gap: 12px; margin-top: 6px;
}
.msg-info-stat {
    text-align: center; font-size: 0.68rem; color: var(--text-muted);
}
.msg-info-stat-num { font-size: 1rem; font-weight: 700; color: #fff; }

.msg-info-section {
    padding: 8px 0;
    border-top: 1px solid rgba(0,243,255,0.06);
}
.msg-info-section-title {
    padding: 8px 16px 4px;
    font-size: 0.68rem;
    letter-spacing: 1px;
    color: var(--text-muted);
    text-transform: uppercase;
}
.msg-info-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 16px;
    border: none;
    background: none;
    color: #e0e6f0;
    font-size: 0.82rem;
    cursor: pointer;
    transition: background 0.15s;
    text-align: left;
}
.msg-info-btn:hover { background: rgba(0,243,255,0.06); }
.msg-info-btn i { width: 20px; text-align: center; font-size: 0.85rem; color: rgba(0,243,255,0.5); }
.msg-info-btn.active i { color: var(--primary); }
.msg-info-btn.danger { color: #ff4757; }
.msg-info-btn.danger i { color: #ff4757; }
.msg-info-btn .msg-info-badge {
    margin-left: auto;
    font-size: 0.65rem;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(0,243,255,0.1);
    color: var(--primary);
}
.msg-info-btn.active .msg-info-badge {
    background: rgba(0,230,118,0.12);
    color: #00e676;
}

/* Report modal */
.msg-report-modal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 100012;
    background: rgba(0,0,0,0.6);
    align-items: center; justify-content: center;
}
.msg-report-modal.show { display: flex; }
.msg-report-box {
    background: rgba(12,16,36,0.98);
    border: 1px solid rgba(0,243,255,0.15);
    border-radius: 16px;
    width: 320px; padding: 20px;
}
.msg-report-box h4 { color: #fff; font-size: 0.92rem; margin-bottom: 12px; }
.msg-report-box textarea {
    width: 100%; min-height: 80px;
    background: rgba(0,0,0,0.35);
    border: 1px solid rgba(0,243,255,0.12);
    color: #fff; padding: 10px 12px;
    border-radius: 10px; font-size: 0.82rem;
    outline: none; resize: vertical; font-family: inherit;
}
.msg-report-box textarea:focus { border-color: var(--primary); }
.msg-report-actions {
    display: flex; gap: 8px; margin-top: 12px; justify-content: flex-end;
}
.msg-report-actions button {
    padding: 8px 18px; border-radius: 8px;
    border: none; font-size: 0.78rem; cursor: pointer;
    transition: all 0.2s;
}
.msg-report-cancel {
    background: rgba(255,255,255,0.06); color: #e0e6f0;
}
.msg-report-submit {
    background: #ff4757; color: #fff; font-weight: 600;
}
.msg-report-submit:hover { background: #ff6b81; }

/* Empty states */
.msg-empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    gap: 12px;
    padding: 40px;
}
.msg-empty-state i { font-size: 3.5rem; opacity: 0.2; }
.msg-empty-state p { font-size: 0.9rem; text-align: center; }

/* New message modal */
.msg-new-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.65);
    z-index: 10001;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.msg-new-overlay.active { display: flex; }
.msg-new-card {
    background: var(--card-bg);
    border: 1px solid rgba(0,243,255,0.2);
    border-radius: 16px;
    padding: 24px;
    width: 420px;
    max-width: 100%;
    animation: messengerSlideIn 0.3s;
}
.msg-new-card h3 {
    color: #fff;
    margin-bottom: 16px;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    gap: 8px;
}
.msg-new-card h3 i { color: var(--primary); }
.msg-new-search {
    width: 100%;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(0,243,255,0.15);
    color: #fff;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.88rem;
    outline: none;
    margin-bottom: 12px;
}
.msg-new-search:focus { border-color: var(--primary); }
.msg-new-search::placeholder { color: var(--text-muted); }
.msg-new-results {
    max-height: 280px;
    overflow-y: auto;
}
.msg-new-user-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}
.msg-new-user-item:hover { background: rgba(0,243,255,0.08); }
.msg-new-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(0,243,255,0.15), rgba(255,0,85,0.1));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--primary);
    font-size: 0.8rem;
    overflow: hidden;
}
.msg-new-user-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.msg-new-user-name { font-size: 0.88rem; font-weight: 600; color: #fff; }
.msg-new-user-uid { font-size: 0.72rem; color: var(--text-muted); }

/* Navbar messenger icon */
.msg-nav-icon {
    position: relative;
    cursor: pointer;
}
.msg-nav-badge {
    position: absolute;
    top: -6px;
    right: -8px;
    background: var(--secondary);
    color: #fff;
    font-size: 0.58rem;
    font-weight: 800;
    padding: 1px 5px;
    border-radius: 8px;
    display: none;
}
.msg-nav-badge.show { display: block; }

/* Typing indicator */
.msg-typing {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 14px;
    font-size: 0.75rem;
    color: var(--text-muted);
}
.msg-typing-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--text-muted);
    animation: typingBounce 1.4s infinite;
}
.msg-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.msg-typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-4px); opacity: 1; }
}

/* Mobile responsive */
@media (max-width: 768px) {
    .msg-sidebar { width: 100%; min-width: 100%; }
    .msg-chat-area { position: absolute; top: 0; left: 0; right: 0; bottom: 0; z-index: 2; display: none; background: rgb(2,2,8); }
    .msg-chat-area.mobile-active { display: flex; }
    .msg-chat-back-mobile { display: block; }
    .msg-bubble-row { max-width: 85%; }
    .msg-convo-item { padding: 10px 14px; }
    .msg-input-area { padding: 8px 10px; gap: 6px; }
}
