/* ==========================================================================
   JOXX HUNGARY MARKETPLACE — OLX-STYLE INTERNAL AI CHAT & AUTO-TRANSLATION
   Strict 2 Fonts: Unbounded + Geologica | 100% Light Editorial Theme
   ========================================================================== */

.joxx-unread-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #059669;
  color: #ffffff;
  font-family: 'Geologica', sans-serif;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}

.joxx-chat-sheet {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 24px 24px 0 0;
  width: 100%;
  max-width: 880px;
  height: 88vh;
  max-height: 760px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 48px -12px rgba(15, 23, 42, 0.22);
  font-family: 'Geologica', sans-serif;
}

@media (min-width: 640px) {
  .joxx-chat-sheet {
    border-radius: 24px;
    height: 82vh;
  }
}

.joxx-chat-topbar {
  padding: 12px 16px;
  border-bottom: 1px solid #e2e8f0;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-shrink: 0;
}

.joxx-chat-topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.joxx-chat-title {
  font-family: 'Unbounded', sans-serif;
  font-size: 13.5px;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 480px) {
  .joxx-chat-mode-pill {
    display: none;
  }
}

.joxx-chat-mode-pill {
  padding: 3px 9px;
  border-radius: 999px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #047857;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap !important;
  flex-shrink: 0;
}

.joxx-chat-body {
  flex: 1;
  min-height: 0;
  display: flex;
  background: #faf8f5;
}

/* Left Sidebar: Inbox Threads */
.joxx-chat-sidebar {
  width: 100%;
  background: #ffffff;
  border-right: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

@media (min-width: 768px) {
  .joxx-chat-sidebar {
    width: 270px;
    flex-shrink: 0;
  }
}

.joxx-chat-sidebar-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.joxx-thread-item {
  width: 100%;
  text-align: left;
  padding: 10px;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
  white-space: normal !important;
}

.joxx-thread-item:hover {
  background: #f8fafc;
}

.joxx-thread-item.is-active {
  background: #ecfdf5;
  border-color: #6ee7b7;
}

.joxx-thread-thumb {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  object-fit: cover;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  flex-shrink: 0;
}

.joxx-thread-meta {
  min-width: 0;
  flex: 1;
}

.joxx-thread-title {
  font-size: 12px;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.joxx-thread-preview {
  font-size: 11px;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

/* Right Active Conversation Pane */
.joxx-chat-pane {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #faf8f5;
}

.joxx-chat-active-wrap {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.joxx-chat-active-wrap.hidden,
.joxx-chat-scam-alert.hidden,
.joxx-chat-bridge-bar.hidden,
.joxx-chat-offer-bar.hidden,
.joxx-unread-badge.hidden {
  display: none !important;
}

.joxx-chat-mobile-hidden {
  display: none !important;
}

@media (min-width: 768px) {
  .joxx-chat-mobile-hidden {
    display: flex !important;
  }
}

.joxx-chat-context-bar {
  padding: 10px 14px;
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-shrink: 0;
}

.joxx-chat-ctx-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.joxx-chat-back-btn {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #0f172a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

@media (min-width: 768px) {
  .joxx-chat-back-btn {
    display: none;
  }
}

.joxx-chat-ctx-price {
  font-family: 'Unbounded', sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: #059669;
  white-space: nowrap;
}

.joxx-translate-pill {
  height: 30px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #0f172a;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap !important;
}

.joxx-translate-pill.is-on {
  background: #0f172a;
  border-color: #0f172a;
  color: #ffffff;
}

/* Anti-Scam Safety Alert */
.joxx-chat-scam-alert {
  margin: 8px 14px 0;
  padding: 10px 12px;
  border-radius: 14px;
  background: #fff1f2;
  border: 1px solid #fecdd3;
  color: #9f1239;
  font-size: 11.5px;
  font-weight: 600;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.4;
}

/* Messages Stream */
.joxx-chat-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.joxx-msg-row {
  display: flex;
  flex-direction: column;
  max-width: 86%;
}

.joxx-msg-row.is-out {
  align-self: flex-end;
  align-items: flex-end;
}

.joxx-msg-row.is-in {
  align-self: flex-start;
  align-items: flex-start;
}

.joxx-msg-out {
  background: #0f172a;
  color: #ffffff;
  padding: 10px 14px;
  border-radius: 18px 18px 4px 18px;
  font-size: 13px;
  line-height: 1.45;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
}

.joxx-msg-in {
  background: #ffffff;
  color: #0f172a;
  border: 1px solid #e2e8f0;
  padding: 10px 14px;
  border-radius: 18px 18px 18px 4px;
  font-size: 13px;
  line-height: 1.45;
}

.joxx-msg-trans {
  margin-top: 4px;
  padding: 6px 10px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  color: #334155;
  font-size: 11.5px;
  line-height: 1.4;
}

.joxx-msg-trans-tag {
  font-weight: 800;
  color: #059669;
  margin-right: 4px;
}

.joxx-msg-time {
  font-size: 10px;
  color: #94a3b8;
  margin-top: 3px;
  padding: 0 4px;
}

/* Bridge Helper Bar (Beta Sync to Telegram / Copy HU) */
.joxx-chat-bridge-bar {
  margin: 0 14px 8px;
  padding: 8px 12px;
  border-radius: 14px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 11.5px;
  color: #065f46;
}

/* Quick Chips + Offer Input */
.joxx-chat-chips {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding: 8px 14px 4px;
  border-top: 1px solid #e2e8f0;
  background: #ffffff;
  flex-shrink: 0;
}

.joxx-chat-chip {
  height: 30px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #0f172a;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap !important;
  flex-shrink: 0;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.joxx-chat-chip:hover {
  background: #ecfdf5;
  border-color: #6ee7b7;
  color: #047857;
}

.joxx-chat-offer-bar {
  padding: 8px 14px;
  background: #faf8f5;
  border-top: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Composer Input Bar */
.joxx-chat-composer {
  padding: 10px 14px 12px;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

.joxx-chat-input-wrap {
  flex: 1;
  position: relative;
  border-radius: 16px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  display: flex;
  align-items: center;
}

.joxx-chat-input-wrap:focus-within {
  border-color: #0f172a;
  background: #ffffff;
}

.joxx-chat-textarea {
  width: 100%;
  border: none;
  background: transparent;
  padding: 9px 40px 9px 12px;
  font-family: 'Geologica', sans-serif;
  font-size: 13px;
  color: #0f172a;
  resize: none;
  outline: none;
  line-height: 1.35;
}

.joxx-chat-mic-btn {
  position: absolute;
  right: 6px;
  bottom: 5px;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  border: none;
  background: #e2e8f0;
  color: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.joxx-chat-mic-btn.is-recording {
  background: #e11d48;
  color: #ffffff;
}

.joxx-chat-empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 28px;
  color: #64748b;
  font-size: 13px;
}
