/*
 * The public site's support chat, styled from the reference panel
 * (`components/chat/panel.blade.php` plus `vendor/reverb-chat/panel.css`): the
 * gold launcher sits in the bottom-right corner of every page and the panel
 * opens above it.
 */
.ba-chat {
  bottom: 1rem;
  position: fixed;
  right: 1rem;
  z-index: 200;
}

.ba-chat-launcher {
  align-items: center;
  background: var(--customPrimary, #b9a074);
  border: 0;
  border-radius: 9999px;
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);
  color: #000;
  cursor: pointer;
  display: flex;
  height: 4rem;
  justify-content: center;
  position: relative;
  width: 4rem;
}

.ba-chat-launcher:hover { background: var(--customGold, #9b8256); }
.ba-chat-launcher svg { height: 2.5rem; width: 2.5rem; }
/* The reference's open state swaps in a 2rem cross (`h-8 w-8`). */
.ba-chat-launcher .ba-chat-close-icon { height: 2rem; width: 2rem; }

.ba-chat-unread {
  align-items: center;
  background: #dc2626;
  border-radius: 9999px;
  color: #fff;
  display: flex;
  font-size: 12px;
  height: 20px;
  justify-content: center;
  min-width: 20px;
  padding: 0 4px;
  position: absolute;
  right: -4px;
  top: -4px;
}

.ba-chat-panel {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  bottom: 5rem;
  box-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);
  display: flex;
  flex-direction: column;
  height: 28rem;
  max-width: calc(100vw - 2rem);
  position: fixed;
  right: 1rem;
  width: 22rem;
  z-index: 200;
}

/* `display: flex` above would otherwise beat the user agent's `[hidden]`. */
.ba-chat-panel[hidden],
.ba-chat-unread[hidden] { display: none; }

@media (min-width: 640px) { .ba-chat-panel { width: 26rem; } }

.ba-chat-header {
  align-items: center;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  justify-content: space-between;
  padding: 8px 12px;
}

.ba-chat-header h2 {
  color: #111827;
  font-size: 15px;
  font-weight: 600;
  margin: 0;
}

.ba-chat-close {
  background: transparent;
  border: 0;
  color: #6b7280;
  cursor: pointer;
  display: flex;
  padding: 2px;
}

.ba-chat-close svg { height: 1.25rem; width: 1.25rem; }
.ba-chat-close:hover { color: #374151; }
.ba-chat-log { flex: 1; overflow: auto; padding: 1rem; }
.ba-chat-message { display: flex; margin: .25rem 0; }
.ba-chat-message.from-support { justify-content: flex-start; }
.ba-chat-message.from-user { justify-content: flex-end; }

.ba-chat-message-content {
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  color: #111827;
  font-size: 14px;
  max-width: 75%;
  padding: 8px 12px;
}

.ba-chat-message.from-support .ba-chat-message-content {
  background: #111827;
  border-color: #111827;
  color: #fff;
}

.ba-chat-message-meta {
  color: #6b7280;
  display: flex;
  font-size: 11px;
  gap: 8px;
  margin-bottom: 4px;
}

.ba-chat-message.from-support .ba-chat-message-meta { color: rgb(255 255 255 / .85); }
.ba-chat-message-body { overflow-wrap: anywhere; white-space: pre-wrap; }
.ba-chat-awaiting { color: #6b7280; font-size: 12px; margin-top: 8px; opacity: .8; }
.ba-chat-error { color: #dc2626; font-size: 13px; margin-bottom: 8px; }
.ba-chat-loading { color: #6b7280; font-size: 13px; }

.ba-chat-form {
  align-items: center;
  border-top: 1px solid #e5e7eb;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px;
}

.ba-chat-form input {
  border: 1px solid #d1d5db;
  border-radius: 8px;
  flex: 1 1 10rem;
  font: inherit;
  font-size: 14px;
  min-width: 0;
  padding: 8px 12px;
}

.ba-chat-form input::placeholder { color: #9ca3af; }

.ba-chat-send {
  background: #111827;
  border: 0;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  padding: 8px 16px;
}

.ba-chat-send:disabled { cursor: not-allowed; opacity: .5; }
.ba-chat-status { color: #6b7280; flex: 1 1 100%; font-size: 12px; margin: 0; }
.ba-chat-status:empty { display: none; }
