/* BidBuy Chat — Frontend Styles v1.0.0 */

/* ── App Layout ── */
.bidbuy-chat { display: flex; height: 600px; max-width: 1000px; margin: 0 auto; border-radius: 10px; overflow: hidden; box-shadow: 0 2px 12px rgba(0,0,0,0.08); background: #fff; }

/* ── Sidebar ── */
.bidbuy-chat__sidebar { width: 320px; border-right: 1px solid #e8e8e8; display: flex; flex-direction: column; flex-shrink: 0; background: #fafafa; }
.bidbuy-chat__sidebar-header { padding: 16px 20px; border-bottom: 1px solid #e8e8e8; background: #fff; }
.bidbuy-chat__sidebar-header h3 { margin: 0; font-size: 18px; font-weight: 700; color: #1a1a2e; }

/* ── Conversation List ── */
.bidbuy-chat__conv-list { flex: 1; overflow-y: auto; }
.bidbuy-chat__conv { display: flex; gap: 12px; padding: 14px 16px; cursor: pointer; transition: background 0.2s; border-bottom: 1px solid #f0f0f0; align-items: center; }
.bidbuy-chat__conv:hover { background: #f0f7f0; }
.bidbuy-chat__conv--active { background: #e8f5e9; border-left: 3px solid #1B5E20; }
.bidbuy-chat__conv-avatar { width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; }
.bidbuy-chat__conv-info { flex: 1; min-width: 0; }
.bidbuy-chat__conv-name { font-weight: 600; font-size: 14px; color: #333; display: flex; align-items: center; gap: 6px; }
.bidbuy-chat__conv-product { font-size: 12px; color: #888; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.bidbuy-chat__unread-badge { background: #1B5E20; color: #fff; font-size: 11px; font-weight: 700; min-width: 20px; height: 20px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; padding: 0 6px; }
.bidbuy-chat__empty { text-align: center; color: #999; padding: 40px 20px; font-size: 14px; }

/* ── Chat Main ── */
.bidbuy-chat__main { flex: 1; display: flex; flex-direction: column; min-width: 0; background: #fff; }

/* ── Chat Header ── */
.bidbuy-chat__header { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid #e8e8e8; background: #fff; }
.bidbuy-chat__back-btn { display: none; background: none; border: none; cursor: pointer; color: #666; padding: 4px; }
.bidbuy-chat__header-avatar { width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0; }
.bidbuy-chat__header-info { flex: 1; min-width: 0; }
.bidbuy-chat__header-info strong { display: block; font-size: 14px; color: #333; }
.bidbuy-chat__header-product { font-size: 12px; color: #4CAF50; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.bidbuy-chat__header-product:hover { text-decoration: underline; }

/* ── Messages Area ── */
.bidbuy-chat__messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 8px; background: #f8f9fa; }
.bidbuy-chat__msg-empty { text-align: center; color: #999; padding: 40px 20px; font-size: 14px; }

/* ── Message Bubble ── */
.bidbuy-chat__msg { display: flex; max-width: 75%; }
.bidbuy-chat__msg--mine { align-self: flex-end; }
.bidbuy-chat__msg--theirs { align-self: flex-start; }
.bidbuy-chat__msg-bubble { padding: 10px 14px; border-radius: 16px; max-width: 100%; word-wrap: break-word; }
.bidbuy-chat__msg--mine .bidbuy-chat__msg-bubble { background: #1B5E20; color: #fff; border-bottom-right-radius: 4px; }
.bidbuy-chat__msg--theirs .bidbuy-chat__msg-bubble { background: #fff; color: #333; border: 1px solid #e8e8e8; border-bottom-left-radius: 4px; }
.bidbuy-chat__msg-bubble p { margin: 0; font-size: 14px; line-height: 1.5; }
.bidbuy-chat__msg-time { display: block; font-size: 11px; margin-top: 4px; opacity: 0.7; }
.bidbuy-chat__msg--mine .bidbuy-chat__msg-time { text-align: right; color: rgba(255,255,255,0.7); }
.bidbuy-chat__msg--theirs .bidbuy-chat__msg-time { color: #999; }

/* ── Input Area ── */
.bidbuy-chat__input-area { padding: 12px 16px; border-top: 1px solid #e8e8e8; background: #fff; }
.bidbuy-chat__input-row { display: flex; gap: 8px; align-items: flex-end; }
.bidbuy-chat__input { flex: 1; padding: 10px 14px; border: 1px solid #ddd; border-radius: 20px; font-size: 14px; resize: none; min-height: 40px; max-height: 120px; line-height: 1.4; font-family: inherit; }
.bidbuy-chat__input:focus { border-color: #4CAF50; outline: none; box-shadow: 0 0 0 3px rgba(76,175,80,0.1); }
.bidbuy-chat__send-btn { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; padding: 0; flex-shrink: 0; }
.bidbuy-chat__send-btn .dashicons { font-size: 20px; width: 20px; height: 20px; }

/* ── Placeholder ── */
.bidbuy-chat__placeholder { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #ccc; }
.bidbuy-chat__placeholder .dashicons { font-size: 64px; width: 64px; height: 64px; margin-bottom: 16px; }
.bidbuy-chat__placeholder p { font-size: 16px; color: #999; }

/* ── Responsive ── */
@media (max-width: 768px) {
    .bidbuy-chat { height: calc(100vh - 120px); border-radius: 0; }
    .bidbuy-chat__sidebar { width: 100%; position: absolute; left: 0; right: 0; top: 0; bottom: 0; z-index: 2; }
    .bidbuy-chat__main { position: absolute; left: 0; right: 0; top: 0; bottom: 0; z-index: 1; display: none; }
    .bidbuy-chat { position: relative; }

    .bidbuy-chat--conv-open .bidbuy-chat__sidebar { display: none; }
    .bidbuy-chat--conv-open .bidbuy-chat__main { display: flex; }
    .bidbuy-chat__back-btn { display: block; }
    .bidbuy-chat__msg { max-width: 85%; }
}
