/* HUB-D Messenger Styles */
.hubd-messenger-layout { display: grid; grid-template-columns: 360px 1fr; height: calc(100vh - var(--hubd-nav-h)); overflow: hidden; padding-top: var(--hubd-nav-h); }
.hubd-messenger-sidebar { background: var(--hubd-surface); border-right: 1px solid var(--hubd-border); display: flex; flex-direction: column; overflow: hidden; }
.hubd-messenger-header { padding: 16px; border-bottom: 1px solid var(--hubd-border); }
.hubd-messenger-header h2 { font-size: 24px; font-weight: 700; margin-bottom: 12px; }
.hubd-messenger-search { display: flex; align-items: center; gap: 8px; background: var(--hubd-bg); border-radius: 999px; padding: 8px 14px; }
.hubd-messenger-search input { border: none; outline: none; background: transparent; font-size: 15px; flex: 1; font-family: inherit; }
.hubd-conv-list { flex: 1; overflow-y: auto; }
.hubd-conv-item { display: flex; align-items: center; gap: 12px; padding: 12px 16px; cursor: pointer; transition: background var(--hubd-transition); position: relative; }
.hubd-conv-item:hover { background: var(--hubd-bg); }
.hubd-conv-item.active { background: var(--hubd-primary-light); }
.hubd-conv-item.unread .hubd-conv-name { font-weight: 700; }
.hubd-conv-avatar { position: relative; flex-shrink: 0; }
.hubd-conv-info { flex: 1; min-width: 0; }
.hubd-conv-top { display: flex; align-items: center; justify-content: space-between; }
.hubd-conv-name { font-size: 15px; font-weight: 600; }
.hubd-conv-time { font-size: 12px; color: var(--hubd-text-secondary); }
.hubd-conv-preview { font-size: 13px; color: var(--hubd-text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hubd-conv-unread-dot { width: 10px; height: 10px; background: var(--hubd-primary); border-radius: 50%; flex-shrink: 0; }

.hubd-chat-area { display: flex; flex-direction: column; background: var(--hubd-surface); }
.hubd-chat-header { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; border-bottom: 1px solid var(--hubd-border); }
.hubd-chat-header-user { display: flex; align-items: center; gap: 10px; }
.hubd-chat-header-name { font-size: 16px; font-weight: 700; }
.hubd-chat-header-status { font-size: 13px; color: var(--hubd-text-secondary); }
.hubd-chat-header-actions { display: flex; gap: 4px; }
.hubd-chat-header-actions button { width: 36px; height: 36px; border-radius: 50%; background: var(--hubd-bg); display: flex; align-items: center; justify-content: center; color: var(--hubd-primary); font-size: 18px; transition: background var(--hubd-transition); }
.hubd-chat-header-actions button:hover { background: var(--hubd-primary-light); }
.hubd-chat-messages-area { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 6px; background: #f0f2f5; }
.hubd-msg-row { display: flex; align-items: flex-end; gap: 6px; }
.hubd-msg-row.out { justify-content: flex-end; }
.hubd-msg-row.in { justify-content: flex-start; }
.hubd-msg-row .hubd-avatar { flex-shrink: 0; }
.hubd-msg { max-width: 65%; padding: 8px 14px; border-radius: 18px; font-size: 15px; line-height: 1.4; word-break: break-word; position: relative; }
.hubd-msg-out { background: var(--hubd-primary); color: #fff; border-bottom-right-radius: 4px; }
.hubd-msg-in { background: #fff; color: var(--hubd-text-primary); border-bottom-left-radius: 4px; box-shadow: 0 1px 2px rgba(0,0,0,.1); }
.hubd-msg-deleted { font-style: italic; opacity: 0.6; }
.hubd-msg-media { max-width: 240px; border-radius: 12px; overflow: hidden; }
.hubd-msg-media img, .hubd-msg-media video { width: 100%; }
.hubd-msg-time { font-size: 11px; opacity: .7; margin-top: 2px; text-align: right; }
.hubd-msg-reaction { position: absolute; bottom: -10px; right: 6px; font-size: 16px; background: #fff; border-radius: 12px; padding: 1px 4px; box-shadow: var(--hubd-shadow); }
.hubd-msg-reply-preview { background: rgba(0,0,0,.1); border-left: 3px solid rgba(255,255,255,.5); border-radius: 6px; padding: 4px 8px; margin-bottom: 4px; font-size: 12px; }
.hubd-msg-in .hubd-msg-reply-preview { background: var(--hubd-bg); border-left-color: var(--hubd-primary); }
.hubd-msg-date-divider { text-align: center; font-size: 12px; color: var(--hubd-text-secondary); background: var(--hubd-bg); border-radius: 12px; padding: 4px 12px; align-self: center; margin: 8px 0; }

.hubd-chat-input-bar { border-top: 1px solid var(--hubd-border); padding: 10px 16px; display: flex; align-items: flex-end; gap: 8px; background: var(--hubd-surface); }
.hubd-chat-input-actions { display: flex; gap: 2px; flex-shrink: 0; }
.hubd-chat-input-actions button { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 20px; color: var(--hubd-primary); transition: background var(--hubd-transition); }
.hubd-chat-input-actions button:hover { background: var(--hubd-bg); }
.hubd-chat-text-input { flex: 1; background: var(--hubd-bg); border: none; outline: none; border-radius: 999px; padding: 10px 16px; font-size: 15px; font-family: inherit; max-height: 120px; overflow-y: auto; resize: none; }
.hubd-chat-send-btn { width: 36px; height: 36px; border-radius: 50%; background: var(--hubd-primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; transition: background var(--hubd-transition); }
.hubd-chat-send-btn:hover { background: var(--hubd-primary-dark); }
.hubd-typing-indicator { display: flex; align-items: center; gap: 4px; padding: 8px 12px; background: #fff; border-radius: 18px; border-bottom-left-radius: 4px; width: fit-content; }
.hubd-typing-dot { width: 8px; height: 8px; background: var(--hubd-text-secondary); border-radius: 50%; animation: hubdTyping 1.4s infinite both; }
.hubd-typing-dot:nth-child(2) { animation-delay: .2s; }
.hubd-typing-dot:nth-child(3) { animation-delay: .4s; }
@keyframes hubdTyping { 0%,60%,100% { transform: translateY(0); opacity: .4; } 30% { transform: translateY(-6px); opacity: 1; } }
.hubd-chat-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--hubd-text-secondary); }
.hubd-chat-empty i { font-size: 72px; margin-bottom: 16px; color: var(--hubd-border); }
.hubd-chat-empty h3 { font-size: 20px; font-weight: 700; color: var(--hubd-text-primary); }
.hubd-chat-empty p { font-size: 15px; }
@media (max-width: 768px) { .hubd-messenger-layout { grid-template-columns: 1fr; } .hubd-messenger-sidebar { display: none; } .hubd-messenger-sidebar.visible { display: flex; } }
