/* ============================================================
   SPOTREALTY — Buyer Collaboration Stylesheet (Phase 3)
   Card Members, @Mentions, Notifications, and Resolver Modals
   Strictly Scoped — Zero Global Element Overrides
   ============================================================ */

/* ── Card Collaborator Avatar Stack ─────────────────────── */
.buyer-collab-wrap {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 6px;
  vertical-align: middle;
}

.buyer-collab-avatars {
  display: inline-flex;
  align-items: center;
  flex-direction: row-reverse;
  margin-right: 2px;
}

.buyer-collab-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid var(--bg, #fff);
  background: #6366f1;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: -6px;
  text-transform: uppercase;
  user-select: none;
  cursor: default;
  transition: transform 0.15s ease;
}

.buyer-collab-avatar:hover {
  transform: translateY(-2px) scale(1.1);
  z-index: 10;
}

.buyer-collab-avatar.collab-more {
  background: #94a3b8;
  font-size: 8px;
}

.buyer-collab-add-btn {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px dashed var(--border, #cbd5e1);
  background: transparent;
  color: var(--text3, #64748b);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  font-size: 13px;
  line-height: 1;
  transition: all 0.15s ease;
}

.buyer-collab-add-btn:hover {
  border-color: #6366f1;
  color: #6366f1;
  background: rgba(99, 102, 241, 0.08);
}

/* ── Collaborator Popover Picker ────────────────────────── */
.buyer-collab-popover {
  position: absolute;
  width: 240px;
  background: var(--bg, #fff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  z-index: 1100;
  padding: 10px;
  font-size: 12px;
  color: var(--text, #0f172a);
}

.buyer-collab-popover-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text3, #64748b);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border, #f1f5f9);
}

.buyer-collab-list {
  max-height: 180px;
  overflow-y: auto;
  margin: 0;
  padding: 0;
  list-style: none;
}

.buyer-collab-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.1s ease;
}

.buyer-collab-item:hover {
  background: var(--bg2, #f8fafc);
}

.buyer-collab-item-name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}

.buyer-collab-check {
  color: #6366f1;
  font-size: 14px;
  font-weight: 700;
}

.buyer-collab-self-btn {
  width: 100%;
  margin-top: 8px;
  padding: 6px 10px;
  background: #f1f5f9;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text, #334155);
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease;
}

.buyer-collab-self-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}

/* ── Modern Members Modal Popover (User Reference Design) ── */
.buyer-members-modal-popover {
  position: fixed;
  width: 280px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  padding: 12px;
  box-sizing: border-box;
  font-family: inherit;
  color: #0f172a;
}

.buyer-members-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: 8px;
  margin-bottom: 10px;
  border-bottom: 1px solid #f1f5f9;
}

.buyer-members-title {
  font-size: 14px;
  font-weight: 700;
  color: #1e293b;
  text-align: center;
}

.buyer-members-close-btn {
  position: absolute;
  right: 0;
  top: 0;
  background: transparent;
  border: none;
  font-size: 14px;
  color: #94a3b8;
  cursor: pointer;
  padding: 2px 6px;
  line-height: 1;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.buyer-members-close-btn:hover {
  color: #334155;
  background: #f1f5f9;
}

.buyer-members-search-wrap {
  margin-bottom: 10px;
}

.buyer-members-search-input {
  width: 100%;
  box-sizing: border-box;
  padding: 7px 10px;
  font-size: 13px;
  color: #1e293b;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  outline: none;
  background: #ffffff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.buyer-members-search-input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.buyer-members-search-input::placeholder {
  color: #94a3b8;
}

.buyer-members-section-title {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  padding-left: 2px;
}

.buyer-members-list {
  max-height: 240px;
  overflow-y: auto;
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.buyer-member-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.12s ease;
}

.buyer-member-item:hover {
  background: #f8fafc;
}

.buyer-member-item.selected {
  background: #eff6ff;
}

.buyer-member-item.selected:hover {
  background: #dbeafe;
}

.buyer-member-item-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.buyer-member-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #6366f1;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
  flex-shrink: 0;
}

.buyer-member-name {
  font-size: 13px;
  font-weight: 500;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.buyer-member-you {
  font-size: 11px;
  color: #64748b;
  font-weight: 400;
}

.buyer-member-check {
  font-size: 14px;
  font-weight: 700;
  color: #2563eb;
  padding-left: 8px;
  flex-shrink: 0;
}

/* ── @Mention Pill & Dropdown ───────────────────────────── */
.mention-pill {
  display: inline-flex;
  align-items: center;
  background: #e0e7ff;
  color: #3730a3;
  padding: 1px 6px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.9em;
  user-select: none;
  cursor: default;
}

.mention-autocomplete-menu {
  position: absolute;
  background: var(--bg, #fff);
  border: 1px solid var(--border, #cbd5e1);
  border-radius: 8px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15);
  z-index: 1200;
  max-height: 200px;
  width: 250px;
  overflow-y: auto;
  list-style: none;
  margin: 0;
  padding: 4px;
}

.mention-autocomplete-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
}

.mention-autocomplete-item:hover,
.mention-autocomplete-item.active {
  background: #e0e7ff;
  color: #3730a3;
}

.mention-autocomplete-name {
  font-weight: 600;
}

.mention-autocomplete-hint {
  font-size: 10px;
  color: var(--text3, #64748b);
}

/* ── Notification Bell & Badge ──────────────────────────── */
.notif-bell-btn {
  position: relative;
  background: none;
  border: none;
  color: var(--text, #334155);
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}

.notif-bell-btn:hover {
  background: rgba(0, 0, 0, 0.05);
}

.notif-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  line-height: 1;
}

/* ── Notification Dropdown Panel ────────────────────────── */
.notif-dropdown-panel {
  position: fixed;
  width: 460px;
  max-width: calc(100vw - 24px);
  height: 460px;
  max-height: calc(100vh - 24px);
  background: var(--bg, #fff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  z-index: 1250;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.notif-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border, #f1f5f9);
  background: var(--bg2, #f8fafc);
  flex-shrink: 0;
}

.notif-panel-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text, #0f172a);
}

.notif-mark-all-btn {
  background: none;
  border: none;
  color: #6366f1;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}

.notif-mark-all-btn:hover {
  background: rgba(99, 102, 241, 0.1);
}

.notif-panel-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  margin: 0;
  padding: 0;
  list-style: none;
}

.notif-item {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border, #f8fafc);
  cursor: pointer;
  transition: background 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.notif-item:hover {
  background: var(--bg2, #f8fafc);
}

.notif-item.unread {
  background: #f0fdf4;
}

.notif-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
  color: var(--text, #1e293b);
}

.notif-item-time {
  font-size: 10px;
  color: var(--text3, #94a3b8);
}

.notif-item-body {
  font-size: 11px;
  color: var(--text2, #475569);
  line-height: 1.35;
}

.notif-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 200px;
  padding: 24px;
  text-align: center;
  color: var(--text3, #94a3b8);
  font-size: 12px;
  box-sizing: border-box;
}

/* ── Notification Tabs & Action Badges ─────────────────── */
.notif-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--bg2, #f8fafc);
  border-bottom: 1px solid var(--border, #e2e8f0);
  overflow-x: auto;
  scrollbar-width: none;
  flex-shrink: 0;
}

.notif-tabs::-webkit-scrollbar {
  display: none;
}

.notif-tab-btn {
  background: transparent;
  border: none;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text2, #64748b);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
}

.notif-tab-btn:hover {
  background: var(--border, #e2e8f0);
  color: var(--text, #0f172a);
}

.notif-tab-btn.active {
  background: #6366f1;
  color: #ffffff;
}

.notif-tab-count {
  background: #ef4444;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 10px;
  line-height: 1;
}

.notif-tab-btn.active .notif-tab-count {
  background: #ffffff;
  color: #6366f1;
}

.notif-action-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

.notif-resolved-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  background: #f1f5f9;
  color: #64748b;
}

/* ── Access Revoked / Safe Modals ───────────────────────── */
.collab-dialog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(2px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.collab-dialog-card {
  background: var(--bg, #fff);
  border-radius: 12px;
  padding: 20px 24px;
  width: 90%;
  max-width: 380px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
  text-align: center;
}

.collab-dialog-icon {
  font-size: 36px;
  margin-bottom: 8px;
}

.collab-dialog-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text, #0f172a);
  margin-bottom: 6px;
}

.collab-dialog-msg {
  font-size: 13px;
  color: var(--text2, #64748b);
  line-height: 1.4;
  margin-bottom: 16px;
}

.collab-dialog-btn {
  background: #6366f1;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

/* ── Access Revoked / Not Navigable Modal ─────────────────── */
.buyer-revoked-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
  z-index: 2500;
  display: flex;
  align-items: center;
  justify-content: center;
}

.buyer-revoked-modal {
  background: var(--bg, #fff);
  border-radius: 12px;
  padding: 20px 24px;
  width: 90%;
  max-width: 420px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border, #e2e8f0);
}

.buyer-revoked-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border, #f1f5f9);
}

.buyer-revoked-modal-body {
  margin-bottom: 16px;
}

.buyer-revoked-modal-footer {
  display: flex;
  justify-content: flex-end;
}
