/* chat.css — trade chat dock, chatboxes, notification bell (Trade v1) */

/* ---- Header bell ---- */
.gp-bell {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  border-radius: 0.55rem;
  background: #1E293B;
  border: 1px solid #334155;
  cursor: pointer;
  font-size: 1rem;
  color: #E2E8F0;
  text-decoration: none;
  vertical-align: middle;
  margin-left: 8px;
}
.gp-bell:hover { background: #253449; }
.gp-badge {
  position: absolute;
  top: -6px; right: -6px;
  min-width: 17px; height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: #EF4444;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 17px;
  text-align: center;
  display: none;
}

/* ---- Floating dock ---- */
.gp-dock {
  position: fixed;
  right: 16px; bottom: 16px;
  z-index: 9000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  font-family: 'Inter', sans-serif;
}
.gp-dock-btn {
  position: relative;
  display: flex; align-items: center; gap: 8px;
  background: #2563EB;
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 10px 18px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0,0,0,0.45);
}
.gp-dock-btn:hover { background: #1D4ED8; }

/* ---- Conversation list panel ---- */
.gp-panel {
  width: 320px;
  max-height: 420px;
  background: #0F172A;
  border: 1px solid #334155;
  border-radius: 0.9rem;
  box-shadow: 0 10px 34px rgba(0,0,0,0.5);
  overflow: hidden;
  display: none;
  flex-direction: column;
}
.gp-panel--open { display: flex; }
.gp-panel-head {
  padding: 10px 14px;
  font-weight: 700;
  color: #E2E8F0;
  border-bottom: 1px solid #1E293B;
  display: flex; justify-content: space-between; align-items: center;
}
.gp-panel-list { overflow-y: auto; }
.gp-convo-row {
  display: flex; flex-direction: column; gap: 2px;
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid #14213A;
}
.gp-convo-row:hover { background: #16233D; }
.gp-convo-top { display: flex; justify-content: space-between; gap: 8px; }
.gp-convo-item { font-weight: 600; color: #E2E8F0; font-size: 0.86rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gp-convo-time { color: #64748B; font-size: 0.72rem; flex-shrink: 0; }
.gp-convo-sub { color: #94A3B8; font-size: 0.78rem; display: flex; align-items: center; gap: 6px; }
.gp-convo-unread { width: 8px; height: 8px; border-radius: 50%; background: #3B82F6; flex-shrink: 0; }
.gp-convo-status { font-size: 0.68rem; padding: 1px 7px; border-radius: 999px; }
.gp-convo-status--completed { background: rgba(16,185,129,0.15); color: #34D399; }
.gp-convo-status--closed { background: rgba(148,163,184,0.15); color: #94A3B8; }
.gp-empty { padding: 22px 14px; color: #64748B; font-size: 0.85rem; text-align: center; }

/* ---- Chatboxes ---- */
.gp-boxes {
  position: fixed;
  right: 16px; bottom: 76px;
  z-index: 8999;
  display: flex;
  flex-direction: row-reverse;
  gap: 12px;
  align-items: flex-end;
}
.gp-box {
  width: 300px;
  height: 400px;
  background: #0F172A;
  border: 1px solid #334155;
  border-radius: 0.9rem;
  box-shadow: 0 10px 34px rgba(0,0,0,0.5);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: 'Inter', sans-serif;
}
.gp-box-head {
  padding: 8px 10px;
  background: #16233D;
  border-bottom: 1px solid #1E293B;
  display: flex; align-items: center; gap: 8px;
}
.gp-box-title { flex: 1; min-width: 0; }
.gp-box-item { font-weight: 700; color: #E2E8F0; font-size: 0.8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gp-box-partner { color: #94A3B8; font-size: 0.72rem; }
.gp-box-x { background: none; border: none; color: #94A3B8; font-size: 1rem; cursor: pointer; padding: 2px 6px; }
.gp-box-x:hover { color: #fff; }

.gp-scamline {
  padding: 4px 10px;
  background: rgba(245,158,11,0.08);
  color: #FBBF24;
  font-size: 0.66rem;
  border-bottom: 1px solid rgba(245,158,11,0.2);
}

.gp-msgs {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.gp-msg { max-width: 82%; padding: 6px 10px; border-radius: 0.8rem; font-size: 0.82rem; line-height: 1.35; word-wrap: break-word; }
.gp-msg--mine { align-self: flex-end; background: #2563EB; color: #fff; border-bottom-right-radius: 0.25rem; }
.gp-msg--theirs { align-self: flex-start; background: #1E293B; color: #E2E8F0; border-bottom-left-radius: 0.25rem; }
.gp-msg--system { align-self: center; background: none; color: #64748B; font-size: 0.7rem; text-align: center; max-width: 95%; }
.gp-msg-offer {
  align-self: stretch;
  background: #14233F;
  border: 1px solid #2C4A7A;
  border-radius: 0.7rem;
  padding: 8px 10px;
  font-size: 0.8rem;
  color: #E2E8F0;
}
.gp-msg-offer--mine { border-color: #2563EB; }
.gp-offer-price { font-weight: 700; color: #FBBF24; font-size: 0.95rem; }
.gp-offer-state { font-size: 0.7rem; color: #94A3B8; margin-top: 2px; }
.gp-offer-actions { display: flex; gap: 6px; margin-top: 6px; }

.gp-dealbar {
  padding: 8px 10px;
  background: rgba(16,185,129,0.1);
  border-top: 1px solid rgba(16,185,129,0.3);
  color: #34D399;
  font-size: 0.76rem;
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}

.gp-actions {
  display: flex; gap: 4px;
  padding: 6px 8px;
  border-top: 1px solid #1E293B;
  flex-wrap: wrap;
}
.gp-chip {
  background: #1E293B;
  color: #CBD5E1;
  border: 1px solid #334155;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 0.7rem;
  cursor: pointer;
  white-space: nowrap;
}
.gp-chip:hover { background: #253449; }
.gp-chip--good { border-color: rgba(16,185,129,0.5); color: #34D399; }
.gp-chip--bad { border-color: rgba(239,68,68,0.4); color: #F87171; }

.gp-inputrow {
  display: flex; gap: 6px;
  padding: 8px;
  border-top: 1px solid #1E293B;
}
.gp-input {
  flex: 1;
  background: #1E293B;
  border: 1px solid #334155;
  border-radius: 0.6rem;
  color: #E2E8F0;
  padding: 7px 10px;
  font-size: 0.82rem;
  outline: none;
}
.gp-input:focus { border-color: #2563EB; }
.gp-send {
  background: #2563EB; color: #fff; border: none;
  border-radius: 0.6rem; padding: 0 12px;
  font-weight: 700; cursor: pointer; font-size: 0.82rem;
}
.gp-send:disabled { opacity: 0.5; cursor: default; }
.gp-boxnote { padding: 4px 10px; font-size: 0.68rem; color: #F87171; min-height: 16px; }

.gp-menu {
  position: absolute;
  bottom: 100%;
  left: 8px;
  background: #16233D;
  border: 1px solid #334155;
  border-radius: 0.6rem;
  overflow: hidden;
  box-shadow: 0 8px 22px rgba(0,0,0,0.5);
  z-index: 10;
  display: none;
}
.gp-menu--open { display: block; }
.gp-menu button {
  display: block; width: 100%; text-align: left;
  background: none; border: none;
  color: #CBD5E1; padding: 7px 12px;
  font-size: 0.78rem; cursor: pointer; white-space: nowrap;
}
.gp-menu button:hover { background: #1E293B; }

@media (max-width: 760px) {
  .gp-boxes { right: 8px; left: 8px; bottom: 70px; }
  .gp-box { width: 100%; height: 380px; }
  .gp-box:not(:first-child) { display: none; } /* one chat at a time on mobile */
  .gp-panel { width: calc(100vw - 32px); }
}
