/* chat-unified.css - Unified chat styles for LINE, Facebook, Instagram */

/* ── LINE Chat Styles ─────────────────────────────────────────────────────── */

.chat-container {
  display: flex;
  height: calc(100vh - 320px);
  min-height: 480px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  overflow: hidden;
}
.chat-sidebar {
  width: 340px;
  min-width: 280px;
  border-right: 1px solid #e9ecef;
  display: flex;
  flex-direction: column;
  background: #fafbfc;
}
.chat-sidebar-header {
  padding: 16px;
  border-bottom: 1px solid #e9ecef;
}
.chat-sidebar-header .form-control {
  border-radius: 20px;
  background: #f1f3f5;
  border: none;
  padding-left: 36px;
  font-size: 14px;
}
.chat-sidebar-header .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #adb5bd;
  font-size: 14px;
}
.chat-list { flex: 1; overflow-y: auto; }
.chat-list-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid #f0f0f0;
}
.chat-list-item:hover { background: #f0f4f8; }
.chat-list-item.active {
  background: #e8f4fd;
  border-left: 3px solid #EB6753;
}
.chat-list-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: #e5e7eb; display: flex; align-items: center;
  justify-content: center; flex-shrink: 0; font-size: 18px;
  color: #6b7280; overflow: hidden;
}
.chat-list-avatar img { width: 100%; height: 100%; object-fit: cover; }
.chat-list-info { flex: 1; min-width: 0; margin-left: 12px; }
.chat-list-name {
  font-weight: 600; font-size: 14px; color: #181A20;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.chat-list-preview {
  font-size: 12px; color: #717171; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; margin-top: 2px;
}
.chat-list-meta { text-align: right; flex-shrink: 0; margin-left: 8px; }
.chat-list-time { font-size: 11px; color: #adb5bd; }
.chat-list-delete-btn {
  display: none; background: none; border: none; color: #dc3545;
  padding: 2px 4px; margin-top: 2px; cursor: pointer; font-size: 11px;
  opacity: 0.7; line-height: 1;
}
.chat-list-delete-btn:hover { opacity: 1; }
.chat-list-item:hover .chat-list-delete-btn { display: block; }
.chat-list-item:hover .chat-list-unread-badge { display: none; }
.chat-list-unread-badge {
  background: #EB6753; color: #fff; font-size: 10px; font-weight: 700;
  min-width: 18px; height: 18px; border-radius: 9px; padding: 0 5px;
  display: flex; align-items: center; justify-content: center;
  margin-top: 3px; line-height: 1;
}
.chat-list-unread {
  width: 8px; height: 8px; border-radius: 50%;
  background: #EB6753; margin-left: auto; margin-top: 6px;
}
.chat-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.chat-header {
  padding: 14px 20px; border-bottom: 1px solid #e9ecef;
  display: flex; align-items: center; justify-content: space-between;
  background: #fff;
}
.chat-header-info { display: flex; align-items: center; }
.chat-header-avatar {
  width: 38px; height: 38px; border-radius: 50%; background: #e5e7eb;
  display: flex; align-items: center; justify-content: center;
  margin-right: 12px; overflow: hidden;
}
.chat-header-avatar img { width: 100%; height: 100%; object-fit: cover; }
.chat-header-name { font-weight: 600; font-size: 15px; color: #181A20; }
.chat-header-status { font-size: 12px; color: #717171; }
.chat-messages {
  flex: 1; overflow-y: auto; padding: 20px; background: #f8f9fa;
  display: flex; flex-direction: column;
}
.chat-msg { display: flex; margin-bottom: 16px; max-width: 75%; }
.chat-msg.incoming { align-self: flex-start; }
.chat-msg.outgoing, .chat-msg.agent {
  align-self: flex-end; margin-left: auto; flex-direction: row-reverse;
}
.chat-msg-bubble {
  padding: 10px 14px; border-radius: 16px;
  font-size: 14px; line-height: 1.45; word-break: break-word;
}
.chat-msg.incoming .chat-msg-bubble {
  background: #fff; color: #181A20; border: 1px solid #e9ecef; border-top-left-radius: 4px;
}
.chat-msg.outgoing .chat-msg-bubble { background: #e8f4e8; color: #181A20; border-top-right-radius: 4px; }
.chat-msg.agent .chat-msg-bubble { background: #EB6753; color: #fff; border-top-right-radius: 4px; }
.chat-msg-time { font-size: 11px; color: #adb5bd; margin-top: 4px; padding: 0 4px; }
.chat-msg.outgoing .chat-msg-time, .chat-msg.agent .chat-msg-time { text-align: right; }
.chat-msg-label {
  font-size: 10px; font-weight: 600; text-transform: uppercase;
  margin-bottom: 2px; padding: 0 4px;
}
.chat-msg.incoming .chat-msg-label { color: #00B900; }
.chat-msg.outgoing .chat-msg-label { color: #6b7280; }
.chat-msg.agent .chat-msg-label { color: #EB6753; }

/* Property card in LINE chat */
.chat-property-card {
  width: 220px; border-radius: 12px; overflow: hidden;
  background: #fff; box-shadow: 0px 1px 4px rgba(24,26,32,0.07);
  cursor: pointer; transition: all 0.4s ease;
}
.chat-property-card:hover { box-shadow: 0 4px 12px rgba(24,26,32,0.12); }
.chat-property-img {
  width: 100%; height: 130px; object-fit: cover; display: block; transition: all 0.4s ease;
}
.chat-property-card:hover .chat-property-img { transform: scale(1.05); }
.chat-property-body { padding: 12px 14px; position: relative; }
.chat-property-badge {
  display: inline-block; font-size: 10px; font-weight: 600; color: #fff;
  padding: 2px 8px; border-radius: 6px; margin-right: 4px; margin-bottom: 4px;
}
.chat-property-title {
  font-size: 13px; font-weight: 600; color: #181A20; margin-top: 4px;
  line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.chat-property-price { font-size: 14px; font-weight: 600; color: #EB6753; margin-top: 6px; }
.chat-property-loc, .chat-property-detail { font-size: 12px; color: #717171; margin-top: 3px; }
.chat-property-more { font-size: 12px; color: #EB6753; margin-top: 8px; font-weight: 600; }
.chat-msg-bubble:has(.chat-property-card), .chat-msg-bubble:has(.chat-booking-card) {
  padding: 0; background: transparent !important; border: none !important;
}

/* Booking card in LINE chat */
.chat-booking-card {
  width: 240px; border-radius: 12px; overflow: hidden;
  background: #fff; box-shadow: 0px 1px 4px rgba(24,26,32,0.07);
}
.chat-booking-card.confirmed { box-shadow: 0px 1px 6px rgba(0,185,0,0.15); }
.chat-booking-header {
  padding: 10px 14px; font-size: 13px; font-weight: 600; color: #fff; background: #EB6753;
}
.chat-booking-card.confirmed .chat-booking-header { background: #00B900; }
.chat-booking-body { padding: 12px 14px; }
.chat-booking-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; padding: 5px 0; border-bottom: 1px solid #DDDDDD; color: #181A20;
}
.chat-booking-row:last-child { border-bottom: none; }
.chat-booking-label { color: #717171; font-weight: 400; min-width: 65px; font-size: 12px; }
.chat-booking-prop { font-size: 14px; font-weight: 600; color: #181A20; margin-bottom: 8px; }
.chat-booking-prompt { font-size: 12px; color: #717171; margin-top: 4px; line-height: 1.5; }
.chat-booking-footer {
  padding: 8px 14px; font-size: 12px; color: #00B900; background: #f8f8f8;
  text-align: center; font-weight: 600; border-top: 1px solid #DDDDDD;
}

/* Chat Input (LINE) */
.chat-input { padding: 14px 20px; border-top: 1px solid #e9ecef; background: #fff; }
.chat-input-form { display: flex; align-items: center; gap: 10px; }
.chat-input-form .form-control {
  border-radius: 20px; padding: 10px 18px; font-size: 14px; border: 1px solid #dee2e6;
}
.chat-input-form .form-control:focus {
  border-color: #EB6753; box-shadow: 0 0 0 0.2rem rgba(235,103,83,0.15);
}
.btn-send {
  background: #EB6753; color: #fff; border: none; border-radius: 50%;
  width: 42px; height: 42px; display: flex; align-items: center;
  justify-content: center; flex-shrink: 0; transition: background 0.2s;
}
.btn-send:hover { background: #d9553f; color: #fff; }
.btn-share-property {
  background: #5BBB7B; color: #fff; border: none; border-radius: 50%;
  width: 42px; height: 42px; display: flex; align-items: center;
  justify-content: center; flex-shrink: 0; font-size: 16px;
}
.btn-share-property:hover { background: #4aa069; color: #fff; }

/* Empty state (LINE) */
.chat-empty {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; height: 100%; color: #adb5bd; text-align: center; padding: 40px;
}
.chat-empty i { font-size: 56px; margin-bottom: 16px; opacity: 0.4; }
.chat-empty p { font-size: 15px; margin-bottom: 4px; }

/* Property share list (LINE) */
.property-share-list { max-height: 400px; overflow-y: auto; }
.property-share-item {
  display: flex; align-items: center; padding: 10px 12px;
  border-bottom: 1px solid #f0f0f0; cursor: pointer; transition: background 0.15s;
}
.property-share-item:hover { background: #f8f9fa; }
.property-share-thumb {
  width: 60px; height: 45px; border-radius: 6px; object-fit: cover;
  background: #e5e7eb; flex-shrink: 0;
}
.property-share-info { flex: 1; margin-left: 12px; min-width: 0; }
.property-share-title {
  font-weight: 600; font-size: 13px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.property-share-price { font-size: 12px; color: #EB6753; font-weight: 600; }

@media (max-width: 991px) {
  .chat-container { flex-direction: column; height: auto; min-height: auto; }
  .chat-sidebar { width: 100%; min-width: 100%; max-height: 300px; border-right: none; border-bottom: 1px solid #e9ecef; }
  .chat-main { min-height: 400px; }
}


/* ── Facebook Chat Styles ──────────────────────────────────────────────────── */

.fb-chat-container {
  display: flex;
  height: calc(100vh - 320px);
  min-height: 480px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  overflow: hidden;
}
.fb-chat-sidebar {
  width: 320px; min-width: 260px; border-right: 1px solid #e9ecef;
  display: flex; flex-direction: column; background: #fafbfc;
}
.fb-chat-sidebar-header { padding: 16px; border-bottom: 1px solid #e9ecef; }
.fb-chat-sidebar-header .form-control {
  border-radius: 20px; background: #f1f3f5; border: none; padding-left: 36px; font-size: 14px;
}
.fb-chat-sidebar-header .search-icon {
  position: absolute; left: 28px; top: 50%; transform: translateY(-50%); color: #adb5bd; font-size: 14px;
}
.fb-chat-list { flex: 1; overflow-y: auto; }
.fb-chat-list-item {
  display: flex; align-items: center; padding: 12px 16px;
  cursor: pointer; transition: background 0.15s; border-bottom: 1px solid #f0f0f0;
}
.fb-chat-list-item:hover { background: #f0f4f8; }
.fb-chat-list-item.active { background: #e8f1fd; border-left: 3px solid #1877f2; }
.fb-chat-list-avatar {
  width: 44px; height: 44px; border-radius: 50%; background: #e5e7eb;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 18px; color: #1877f2; overflow: hidden;
}
.fb-chat-list-avatar img { width: 100%; height: 100%; object-fit: cover; }
.fb-chat-list-info { flex: 1; min-width: 0; margin-left: 12px; }
.fb-chat-list-name {
  font-weight: 600; font-size: 14px; color: #181A20;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.fb-chat-list-preview {
  font-size: 12px; color: #717171; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; margin-top: 2px;
}
.fb-chat-list-meta { text-align: right; flex-shrink: 0; margin-left: 8px; }
.fb-chat-list-time { font-size: 11px; color: #adb5bd; }
.fb-chat-list-delete-btn {
  display: none; background: none; border: none; color: #dc3545;
  padding: 2px 4px; margin-top: 2px; cursor: pointer; font-size: 11px; opacity: 0.7; line-height: 1;
}
.fb-chat-list-delete-btn:hover { opacity: 1; }
.fb-chat-list-item:hover .fb-chat-list-delete-btn { display: block; }
.fb-chat-list-item:hover .fb-chat-list-unread-badge { display: none; }
.fb-chat-list-unread-badge {
  background: #1877f2; color: #fff; font-size: 10px; font-weight: 700;
  min-width: 18px; height: 18px; border-radius: 9px; padding: 0 5px;
  display: flex; align-items: center; justify-content: center; margin-top: 3px; line-height: 1;
}
.fb-chat-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.fb-chat-header {
  padding: 14px 20px; border-bottom: 1px solid #e9ecef;
  display: flex; align-items: center; justify-content: space-between; background: #fff;
}
.fb-chat-header-info { display: flex; align-items: center; }
.fb-chat-header-avatar {
  width: 38px; height: 38px; border-radius: 50%; background: #e5e7eb;
  display: flex; align-items: center; justify-content: center;
  margin-right: 12px; overflow: hidden; color: #1877f2;
}
.fb-chat-header-avatar img { width: 100%; height: 100%; object-fit: cover; }
.fb-chat-header-name { font-weight: 600; font-size: 15px; color: #181A20; }
.fb-chat-header-status { font-size: 12px; color: #717171; }
.fb-chat-messages {
  flex: 1; overflow-y: auto; padding: 20px; background: #f8f9fa; display: flex; flex-direction: column;
}
.fb-chat-msg { display: flex; margin-bottom: 16px; max-width: 75%; }
.fb-chat-msg.incoming { align-self: flex-start; }
.fb-chat-msg.outgoing, .fb-chat-msg.agent {
  align-self: flex-end; margin-left: auto; flex-direction: row-reverse;
}
.fb-chat-msg-bubble {
  padding: 10px 14px; border-radius: 16px; font-size: 14px; line-height: 1.45; word-break: break-word;
}
.fb-chat-msg.incoming .fb-chat-msg-bubble {
  background: #fff; color: #181A20; border: 1px solid #e9ecef; border-top-left-radius: 4px;
}
.fb-chat-msg.outgoing .fb-chat-msg-bubble { background: #e7f0fe; color: #181A20; border-top-right-radius: 4px; }
.fb-chat-msg.agent .fb-chat-msg-bubble { background: #1877f2; color: #fff; border-top-right-radius: 4px; }
.fb-chat-msg-time { font-size: 11px; color: #adb5bd; margin-top: 4px; padding: 0 4px; }
.fb-chat-msg.outgoing .fb-chat-msg-time, .fb-chat-msg.agent .fb-chat-msg-time { text-align: right; }
.fb-chat-msg-label {
  font-size: 10px; font-weight: 600; text-transform: uppercase; margin-bottom: 2px; padding: 0 4px;
}
.fb-chat-msg.incoming .fb-chat-msg-label { color: #1877f2; }
.fb-chat-msg.outgoing .fb-chat-msg-label { color: #6b7280; }
.fb-chat-msg.agent .fb-chat-msg-label { color: #1877f2; }
.fb-chat-msg-bubble:has(.fb-chat-property-card) { padding: 0; background: transparent !important; border: none !important; }
.fb-chat-property-card {
  width: 220px; border-radius: 12px; overflow: hidden; background: #fff;
  box-shadow: 0px 1px 4px rgba(24,26,32,0.07); cursor: pointer;
  transition: all 0.3s ease; text-decoration: none; color: inherit; display: block;
}
.fb-chat-property-card:hover { box-shadow: 0 4px 12px rgba(24,26,32,0.12); }
.fb-chat-property-img { width: 100%; height: 130px; object-fit: cover; display: block; }
.fb-chat-property-body { padding: 12px 14px; }
.fb-chat-property-badge {
  display: inline-block; font-size: 10px; font-weight: 600; color: #fff;
  padding: 2px 8px; border-radius: 6px; margin-right: 4px; margin-bottom: 4px;
}
.fb-chat-property-title {
  font-size: 13px; font-weight: 600; color: #181A20; margin-top: 4px;
  line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.fb-chat-property-price { font-size: 14px; font-weight: 600; color: #1877f2; margin-top: 6px; }
.fb-chat-property-loc { font-size: 12px; color: #717171; margin-top: 3px; }
.fb-chat-msg-image { max-width: 220px; max-height: 220px; border-radius: 12px; display: block; cursor: pointer; object-fit: cover; }
.fb-chat-msg-avatar-wrap { width: 32px; min-width: 32px; margin-right: 8px; display: flex; align-items: flex-end; }
.fb-chat-msg-avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.fb-chat-input { padding: 14px 20px; border-top: 1px solid #e9ecef; background: #fff; }
.fb-chat-input-form { display: flex; align-items: center; gap: 10px; }
.fb-chat-input-form .form-control { border-radius: 20px; padding: 10px 18px; font-size: 14px; border: 1px solid #dee2e6; }
.fb-chat-input-form .form-control:focus { border-color: #1877f2; box-shadow: 0 0 0 0.2rem rgba(24,119,242,0.15); }
.fb-btn-send {
  background: #1877f2; color: #fff; border: none; border-radius: 50%;
  width: 42px; height: 42px; display: flex; align-items: center;
  justify-content: center; flex-shrink: 0; transition: background 0.2s;
}
.fb-btn-send:hover { background: #0d5bbf; color: #fff; }
.fb-btn-share-property {
  background: #5BBB7B; color: #fff; border: none; border-radius: 50%;
  width: 42px; height: 42px; display: flex; align-items: center;
  justify-content: center; flex-shrink: 0; font-size: 16px;
}
.fb-btn-share-property:hover { background: #4aa069; color: #fff; }
.fb-chat-empty {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; height: 100%; color: #adb5bd; text-align: center; padding: 40px;
}
.fb-chat-empty i { font-size: 56px; margin-bottom: 16px; opacity: 0.4; }
.fb-chat-empty p { font-size: 15px; margin-bottom: 4px; }
.fb-property-share-list { max-height: 400px; overflow-y: auto; }
.fb-property-share-item {
  display: flex; align-items: center; padding: 10px 12px;
  border-bottom: 1px solid #f0f0f0; cursor: pointer; transition: background 0.15s;
}
.fb-property-share-item:hover { background: #f8f9fa; }
.fb-property-share-thumb {
  width: 60px; height: 45px; border-radius: 6px; object-fit: cover; background: #e5e7eb; flex-shrink: 0;
}
.fb-property-share-info { flex: 1; margin-left: 12px; min-width: 0; }
.fb-property-share-title { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fb-property-share-price { font-size: 12px; color: #1877f2; font-weight: 600; }

@media (max-width: 991px) {
  .fb-chat-container { flex-direction: column; height: auto; }
  .fb-chat-sidebar { width: 100%; min-width: unset; border-right: none; border-bottom: 1px solid #e9ecef; max-height: 300px; }
}


/* ── Instagram Chat Styles ─────────────────────────────────────────────────── */

.ig-chat-container {
  display: flex;
  height: calc(100vh - 320px);
  min-height: 480px;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.ig-chat-sidebar {
  width: 320px; min-width: 260px; border-right: 1px solid #e9ecef;
  display: flex; flex-direction: column; background: #fafbfc;
}
.ig-chat-sidebar-header { padding: 16px; border-bottom: 1px solid #e9ecef; }
.ig-chat-list { flex: 1; overflow-y: auto; }
.ig-chat-list-item {
  display: flex; align-items: center; padding: 12px 16px;
  cursor: pointer; transition: background 0.15s; border-bottom: 1px solid #f8f9fa;
}
.ig-chat-list-item:hover { background: #f0f4f8; }
.ig-chat-list-item.active {
  background: linear-gradient(135deg,rgba(240,148,51,0.08),rgba(188,24,136,0.08));
  border-left: 3px solid #e6683c;
}
.ig-chat-list-avatar {
  width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0; overflow: hidden;
  background: linear-gradient(45deg,#f09433,#e6683c,#dc2743,#cc2366,#bc1888);
  display: flex; align-items: center; justify-content: center; color: #fff; font-size: 18px;
}
.ig-chat-list-avatar img { width: 100%; height: 100%; object-fit: cover; }
.ig-chat-list-info { flex: 1; min-width: 0; margin-left: 12px; }
.ig-chat-list-name { font-size: 14px; font-weight: 600; color: #181A20; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ig-chat-list-preview { font-size: 12px; color: #717171; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ig-chat-list-meta { text-align: right; flex-shrink: 0; margin-left: 8px; }
.ig-chat-list-time { font-size: 11px; color: #adb5bd; }
.ig-chat-list-delete-btn {
  display: none; background: none; border: none; color: #dc3545; padding: 2px 4px; cursor: pointer; opacity: 0.6;
}
.ig-chat-list-delete-btn:hover { opacity: 1; }
.ig-chat-list-item:hover .ig-chat-list-delete-btn { display: block; }
.ig-chat-list-item:hover .ig-chat-list-unread-badge { display: none; }
.ig-chat-list-unread-badge {
  background: #e6683c; color: #fff; border-radius: 10px;
  font-size: 10px; padding: 1px 6px; font-weight: 600; min-width: 18px; text-align: center;
}
.ig-chat-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.ig-chat-header {
  padding: 14px 20px; border-bottom: 1px solid #e9ecef;
  background: #fff; display: flex; align-items: center; justify-content: space-between;
}
.ig-chat-header-info { display: flex; align-items: center; }
.ig-chat-header-avatar {
  width: 40px; height: 40px; border-radius: 50%; overflow: hidden; flex-shrink: 0;
  background: linear-gradient(45deg,#f09433,#e6683c,#dc2743,#cc2366,#bc1888);
  display: flex; align-items: center; justify-content: center; color: #fff; font-size: 18px;
}
.ig-chat-header-avatar img { width: 100%; height: 100%; object-fit: cover; }
.ig-chat-header-name { font-weight: 600; font-size: 15px; color: #181A20; margin-left: 12px; }
.ig-chat-header-status { font-size: 12px; color: #717171; margin-left: 12px; }
.ig-chat-messages {
  flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; background: #f8f9fa;
}
.ig-chat-msg { display: flex; margin-bottom: 16px; max-width: 75%; }
.ig-chat-msg.incoming { align-self: flex-start; }
.ig-chat-msg.outgoing, .ig-chat-msg.agent { align-self: flex-end; flex-direction: row-reverse; }
.ig-chat-msg-bubble { padding: 10px 14px; border-radius: 18px; font-size: 14px; line-height: 1.5; word-break: break-word; }
.ig-chat-msg.incoming .ig-chat-msg-bubble { background: #fff; color: #181A20; border-radius: 4px 18px 18px 18px; }
.ig-chat-msg.outgoing .ig-chat-msg-bubble,
.ig-chat-msg.agent .ig-chat-msg-bubble {
  background: linear-gradient(135deg,#f09433,#e6683c,#dc2743,#bc1888); color: #fff; border-radius: 18px 4px 18px 18px;
}
.ig-chat-msg-time { font-size: 11px; color: #adb5bd; margin-top: 4px; padding: 0 4px; }
.ig-chat-msg.outgoing .ig-chat-msg-time, .ig-chat-msg.agent .ig-chat-msg-time { text-align: right; }
.ig-chat-msg-label { font-size: 11px; color: #adb5bd; margin-bottom: 4px; padding: 0 4px; }
.ig-chat-msg.incoming .ig-chat-msg-label { color: #e6683c; }
.ig-chat-msg.agent .ig-chat-msg-label { color: #e6683c; }
.ig-chat-property-card {
  display: block; text-decoration: none; color: inherit; background: #fff;
  border-radius: 12px; overflow: hidden; border: 1px solid #e5e7eb; width: 220px; transition: box-shadow 0.2s;
}
.ig-chat-property-card:hover { box-shadow: 0 4px 12px rgba(24,26,32,0.12); }
.ig-chat-property-img { width: 100%; height: 130px; object-fit: cover; display: block; }
.ig-chat-property-body { padding: 12px 14px; }
.ig-chat-property-badge {
  display: inline-block; color: #fff; font-size: 10px; font-weight: 600;
  padding: 2px 8px; border-radius: 6px; margin-right: 4px; margin-bottom: 4px;
}
.ig-chat-property-title {
  font-size: 13px; font-weight: 600; color: #181A20; margin-top: 4px;
  line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.ig-chat-property-price { font-size: 14px; font-weight: 600; color: #e6683c; margin-top: 6px; }
.ig-chat-property-loc { font-size: 12px; color: #717171; margin-top: 3px; }
.ig-chat-msg-image { max-width: 220px; max-height: 220px; border-radius: 12px; display: block; cursor: pointer; object-fit: cover; }
.ig-chat-msg-avatar-wrap { width: 32px; min-width: 32px; margin-right: 8px; display: flex; align-items: flex-end; }
.ig-chat-msg-avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.ig-chat-input { padding: 14px 20px; border-top: 1px solid #e9ecef; background: #fff; }
.ig-chat-input-form { display: flex; align-items: center; gap: 10px; }
.ig-chat-input-form .form-control { border-radius: 20px; padding: 10px 18px; font-size: 14px; border: 1px solid #dee2e6; }
.ig-chat-input-form .form-control:focus { border-color: #e6683c; box-shadow: 0 0 0 0.2rem rgba(230,104,60,0.15); }
.ig-btn-send {
  background: linear-gradient(135deg,#f09433,#e6683c,#dc2743,#bc1888); color: #fff; border: none;
  border-radius: 50%; width: 42px; height: 42px; display: flex; align-items: center;
  justify-content: center; flex-shrink: 0; transition: opacity 0.2s;
}
.ig-btn-send:hover { opacity: 0.85; color: #fff; }
.ig-btn-share-property {
  background: #5BBB7B; color: #fff; border: none; border-radius: 50%;
  width: 42px; height: 42px; display: flex; align-items: center;
  justify-content: center; flex-shrink: 0; font-size: 16px;
}
.ig-btn-share-property:hover { background: #4aa069; color: #fff; }
.ig-chat-empty {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; height: 100%; color: #adb5bd; text-align: center; padding: 40px;
}
.ig-chat-empty i { font-size: 56px; margin-bottom: 16px; opacity: 0.4; }
.ig-chat-empty p { font-size: 15px; margin-bottom: 4px; }
.ig-property-share-list { max-height: 400px; overflow-y: auto; }
.ig-property-share-item {
  display: flex; align-items: center; padding: 10px 12px;
  border-bottom: 1px solid #f0f0f0; cursor: pointer; transition: background 0.15s;
}
.ig-property-share-item:hover { background: #f8f9fa; }
.ig-property-share-thumb {
  width: 60px; height: 45px; border-radius: 6px; object-fit: cover; background: #e5e7eb; flex-shrink: 0;
}
.ig-property-share-info { flex: 1; margin-left: 12px; min-width: 0; }
.ig-property-share-title { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ig-property-share-price { font-size: 12px; color: #e6683c; font-weight: 600; }

@media (max-width: 991px) {
  .ig-chat-container { flex-direction: column; height: auto; }
  .ig-chat-sidebar { width: 100%; min-width: unset; border-right: none; border-bottom: 1px solid #e9ecef; max-height: 300px; }
}

/* ── Tab nav brand icon colours (force override Bootstrap nav-link colour) ── */
#lineChatTabBtn .fab { color: #00B900 !important; }
#fbChatTabBtn .fab  { color: #1877f2 !important; }
#igChatTabBtn .fab  { color: #e6683c !important; }
#waChatTabBtn .fab  { color: #25D366 !important; }

/* ── Unified "All" Tab ──────────────────────────────────────────────────── */
.all-conversations-list { max-height: calc(100vh - 360px); min-height: 300px; overflow-y: auto; }
.all-chat-search-bar { padding-bottom: 4px; }
.all-chat-empty {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 60px 20px; color: #adb5bd; text-align: center;
}
.all-chat-empty i { font-size: 52px; margin-bottom: 16px; opacity: 0.35; }
.all-chat-empty p { font-size: 15px; margin: 0 0 4px; }
.all-chat-empty small { font-size: 13px; }

.all-convo-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid #f0f0f0;
  cursor: pointer; transition: background 0.15s; border-radius: 8px; margin-bottom: 2px;
}
.all-convo-item:hover { background: #f8f9fa; }
.all-convo-item:last-child { border-bottom: none; }

.all-convo-avatar {
  position: relative; width: 46px; height: 46px; border-radius: 50%;
  background: #f1f3f5; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; overflow: visible;
}
.all-convo-avatar img {
  width: 46px; height: 46px; border-radius: 50%; object-fit: cover;
}
.all-convo-source-dot {
  position: absolute; bottom: -2px; right: -4px;
  width: 18px; height: 18px; border-radius: 50%; border: 2px solid #fff;
  display: flex; align-items: center; justify-content: center; font-size: 9px; color: #fff;
}

.all-convo-info { flex: 1; min-width: 0; }
.all-convo-name { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #212529; }
.all-convo-preview { font-size: 13px; color: #6c757d; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }

.all-convo-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.all-convo-time { font-size: 11px; color: #adb5bd; white-space: nowrap; }
.all-convo-unread-badge {
  background: #eb3b5a; color: #fff; border-radius: 10px;
  font-size: 11px; font-weight: 600; padding: 1px 6px; min-width: 18px; text-align: center;
}

/* ── WhatsApp Chat Styles ─────────────────────────────────────────────────── */

.wa-chat-container {
  display: flex; height: calc(100vh - 320px); min-height: 480px;
  border-radius: 12px; overflow: hidden; background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.wa-chat-sidebar {
  width: 320px; min-width: 260px; border-right: 1px solid #e9ecef;
  display: flex; flex-direction: column; background: #fafbfc;
}
.wa-chat-sidebar-header { padding: 16px; border-bottom: 1px solid #e9ecef; }
.wa-chat-sidebar-header .form-control {
  border-radius: 20px; background: #f1f3f5; border: none; padding-left: 36px; font-size: 14px;
}
.wa-chat-list { flex: 1; overflow-y: auto; }
.wa-chat-list-item {
  display: flex; align-items: center; padding: 12px 16px;
  cursor: pointer; transition: background 0.15s; border-bottom: 1px solid #f0f0f0;
}
.wa-chat-list-item:hover { background: #f0f4f8; }
.wa-chat-list-item.active { background: #e8f8ee; border-left: 3px solid #25D366; }
.wa-chat-list-avatar {
  width: 44px; height: 44px; border-radius: 50%; background: #dcf8c6;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 20px; color: #25D366; overflow: hidden;
}
.wa-chat-list-avatar img { width: 100%; height: 100%; object-fit: cover; }
.wa-chat-list-info { flex: 1; min-width: 0; margin-left: 12px; }
.wa-chat-list-name {
  font-weight: 600; font-size: 14px; color: #181A20;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wa-chat-list-preview {
  font-size: 12px; color: #717171; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; margin-top: 2px;
}
.wa-chat-list-meta { text-align: right; flex-shrink: 0; margin-left: 8px; }
.wa-chat-list-time { font-size: 11px; color: #adb5bd; }
.wa-chat-list-delete-btn {
  display: none; background: none; border: none; color: #dc3545;
  padding: 2px 4px; margin-top: 2px; cursor: pointer; font-size: 11px; opacity: 0.7; line-height: 1;
}
.wa-chat-list-delete-btn:hover { opacity: 1; }
.wa-chat-list-item:hover .wa-chat-list-delete-btn { display: block; }
.wa-chat-list-item:hover .wa-chat-list-unread-badge { display: none; }
.wa-chat-list-unread-badge {
  background: #25D366; color: #fff; font-size: 10px; font-weight: 700;
  min-width: 18px; height: 18px; border-radius: 9px; padding: 0 5px;
  display: flex; align-items: center; justify-content: center; margin-top: 3px; line-height: 1;
}
.wa-chat-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.wa-chat-header {
  padding: 14px 20px; border-bottom: 1px solid #e9ecef;
  display: flex; align-items: center; justify-content: space-between; background: #fff;
}
.wa-chat-header-info { display: flex; align-items: center; }
.wa-chat-header-avatar {
  width: 38px; height: 38px; border-radius: 50%; background: #dcf8c6;
  display: flex; align-items: center; justify-content: center;
  margin-right: 12px; overflow: hidden; color: #25D366; font-size: 20px;
}
.wa-chat-header-avatar img { width: 100%; height: 100%; object-fit: cover; }
.wa-chat-header-name { font-weight: 600; font-size: 15px; color: #181A20; }
.wa-chat-header-status { font-size: 12px; color: #717171; }
.wa-chat-messages {
  flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; background: #e5ddd5;
}
.wa-chat-msg { display: flex; margin-bottom: 16px; max-width: 75%; }
.wa-chat-msg.incoming { align-self: flex-start; }
.wa-chat-msg.outgoing, .wa-chat-msg.agent { align-self: flex-end; flex-direction: row-reverse; }
.wa-chat-msg-bubble { padding: 10px 14px; border-radius: 18px; font-size: 14px; line-height: 1.5; word-break: break-word; }
.wa-chat-msg.incoming .wa-chat-msg-bubble { background: #fff; color: #181A20; border-radius: 4px 18px 18px 18px; }
.wa-chat-msg.outgoing .wa-chat-msg-bubble,
.wa-chat-msg.agent .wa-chat-msg-bubble { background: #dcf8c6; color: #181A20; border-radius: 18px 4px 18px 18px; }
.wa-chat-msg-time { font-size: 11px; color: #adb5bd; margin-top: 4px; padding: 0 4px; }
.wa-chat-msg.outgoing .wa-chat-msg-time, .wa-chat-msg.agent .wa-chat-msg-time { text-align: right; }
.wa-chat-msg-label { font-size: 11px; color: #adb5bd; margin-bottom: 4px; padding: 0 4px; }
.wa-chat-msg.incoming .wa-chat-msg-label { color: #25D366; }
.wa-chat-msg.agent .wa-chat-msg-label { color: #128C7E; }
.wa-chat-property-card {
  display: block; text-decoration: none; color: inherit; background: #fff;
  border-radius: 12px; overflow: hidden; border: 1px solid #e5e7eb; width: 220px; transition: box-shadow 0.2s;
}
.wa-chat-property-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.12); }
.wa-chat-property-img { width: 100%; height: 130px; object-fit: cover; display: block; }
.wa-chat-property-body { padding: 12px 14px; }
.wa-chat-property-badge {
  display: inline-block; color: #fff; font-size: 10px; font-weight: 600;
  padding: 2px 8px; border-radius: 6px; margin-right: 4px; margin-bottom: 4px;
}
.wa-chat-property-title {
  font-size: 13px; font-weight: 600; color: #181A20; margin-top: 4px;
  line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.wa-chat-property-price { font-size: 14px; font-weight: 600; color: #25D366; margin-top: 6px; }
.wa-chat-property-loc { font-size: 12px; color: #717171; margin-top: 3px; }
.wa-chat-msg-image { max-width: 220px; max-height: 220px; border-radius: 12px; display: block; cursor: pointer; object-fit: cover; }
.wa-chat-input { padding: 14px 20px; border-top: 1px solid #e9ecef; background: #f0f0f0; }
.wa-chat-input-form { display: flex; align-items: center; gap: 10px; }
.wa-chat-input-form .form-control { border-radius: 20px; padding: 10px 18px; font-size: 14px; border: 1px solid #dee2e6; background: #fff; }
.wa-chat-input-form .form-control:focus { border-color: #25D366; box-shadow: 0 0 0 0.2rem rgba(37,211,102,0.15); }
.wa-btn-send {
  background: #25D366; color: #fff; border: none;
  border-radius: 50%; width: 42px; height: 42px; display: flex; align-items: center;
  justify-content: center; flex-shrink: 0; transition: background 0.2s;
}
.wa-btn-send:hover { background: #128C7E; color: #fff; }
.wa-btn-share-property {
  background: #5BBB7B; color: #fff; border: none; border-radius: 50%;
  width: 42px; height: 42px; display: flex; align-items: center;
  justify-content: center; flex-shrink: 0; font-size: 16px;
}
.wa-btn-share-property:hover { background: #4aa069; color: #fff; }
.wa-chat-empty {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; height: 100%; color: #adb5bd; text-align: center; padding: 40px;
}
.wa-chat-empty i { font-size: 56px; margin-bottom: 16px; opacity: 0.4; }
.wa-chat-empty p { font-size: 15px; margin-bottom: 4px; }
.wa-property-share-list { max-height: 400px; overflow-y: auto; }
.wa-property-share-item {
  display: flex; align-items: center; padding: 10px 12px;
  border-bottom: 1px solid #f0f0f0; cursor: pointer; transition: background 0.15s;
}
.wa-property-share-item:hover { background: #f8f9fa; }
.wa-property-share-thumb {
  width: 60px; height: 45px; border-radius: 6px; object-fit: cover; background: #e5e7eb; flex-shrink: 0;
}
.wa-property-share-info { flex: 1; margin-left: 12px; min-width: 0; }
.wa-property-share-title { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wa-property-share-price { font-size: 12px; color: #25D366; font-weight: 600; }

@media (max-width: 991px) {
  .wa-chat-container { flex-direction: column; height: auto; }
  .wa-chat-sidebar { width: 100%; min-width: unset; border-right: none; border-bottom: 1px solid #e9ecef; max-height: 300px; }
}
