/* ==========================================================================
   BHH Live Chat Widget — public customer-facing styles
   ========================================================================== */

#bhh-livechat-root {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

/* Floating bubble ---------------------------------------------------------- */

.bhhwgt-bubble {
  align-items: center;
  background: #1d4ed8;
  border: none;
  border-radius: 50%;
  bottom: 24px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.22);
  cursor: pointer;
  display: flex;
  height: 56px;
  justify-content: center;
  position: fixed;
  right: 24px;
  transition: background 0.15s, transform 0.15s;
  width: 56px;
  z-index: 99998;
}

.bhhwgt-bubble:hover {
  background: #1e40af;
  transform: scale(1.06);
}

.bhhwgt-bubble:focus-visible {
  outline: 3px solid #93c5fd;
  outline-offset: 2px;
}

/* Chat panel --------------------------------------------------------------- */

.bhhwgt-panel {
  background: #fff;
  border-radius: 16px;
  bottom: 92px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: fixed;
  right: 24px;
  width: 340px;
  z-index: 99998;
}

.bhhwgt-hidden {
  display: none !important;
}

/* Panel header ------------------------------------------------------------- */

.bhhwgt-header {
  align-items: center;
  background: #1d4ed8;
  color: #fff;
  display: flex;
  justify-content: space-between;
  padding: 14px 16px;
}

.bhhwgt-header-title {
  font-size: 15px;
  font-weight: 600;
}

.bhhwgt-close-btn {
  background: transparent;
  border: none;
  color: #fff;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  padding: 0 2px;
  opacity: 0.8;
  transition: opacity 0.1s;
}

.bhhwgt-close-btn:hover {
  opacity: 1;
}

/* Panel body --------------------------------------------------------------- */

.bhhwgt-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  max-height: 420px;
  overflow: hidden;
  padding: 16px;
}

/* Offline notice ----------------------------------------------------------- */

.bhhwgt-offline-note {
  background: #fef3c7;
  border-left: 3px solid #f59e0b;
  border-radius: 4px;
  color: #78350f;
  font-size: 13px;
  margin: 0 0 12px;
  padding: 10px 12px;
}

/* Form --------------------------------------------------------------------- */

.bhhwgt-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bhhwgt-label {
  display: flex;
  flex-direction: column;
  font-size: 12px;
  font-weight: 600;
  gap: 5px;
  color: #374151;
}

.bhhwgt-input,
.bhhwgt-textarea {
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  outline: none;
  padding: 8px 10px;
  resize: none;
  transition: border-color 0.15s;
  width: 100%;
  box-sizing: border-box;
}

.bhhwgt-input:focus,
.bhhwgt-textarea:focus {
  border-color: #1d4ed8;
  box-shadow: 0 0 0 2px rgba(29, 78, 216, 0.18);
}

/* Send button (shared by form + reply bar) --------------------------------- */

.bhhwgt-send-btn {
  background: #1d4ed8;
  border: none;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 16px;
  transition: background 0.15s;
  width: 100%;
}

.bhhwgt-send-btn:hover {
  background: #1e40af;
}

.bhhwgt-send-btn:disabled {
  background: #93c5fd;
  cursor: not-allowed;
}

/* Messages area ------------------------------------------------------------ */

.bhhwgt-messages {
  flex: 1;
  margin-bottom: 10px;
  overflow-y: auto;
  padding: 4px 0;
}

/* Message bubbles (reuse bhh-lc-message classes from widget) */
.bhhwgt-messages .bhh-lc-message {
  margin-bottom: 8px;
}

.bhhwgt-messages .bhh-lc-msg-body {
  border-radius: 14px;
  display: inline-block;
  font-size: 13px;
  max-width: 82%;
  padding: 8px 12px;
  white-space: pre-wrap;
  word-break: break-word;
}

.bhhwgt-messages .bhh-lc-msg-customer {
  text-align: left;
}

.bhhwgt-messages .bhh-lc-msg-customer .bhh-lc-msg-body {
  background: #f3f4f6;
  color: #111827;
}

.bhhwgt-messages .bhh-lc-msg-agent {
  text-align: right;
}

.bhhwgt-messages .bhh-lc-msg-agent .bhh-lc-msg-body {
  background: #1d4ed8;
  color: #fff;
}

.bhhwgt-messages .bhh-lc-msg-agent .bhh-lc-msg-body a {
  color: #fff;
  text-decoration: underline;
}

.bhhwgt-messages .bhh-lc-msg-customer .bhh-lc-msg-body a {
  color: #1d4ed8;
}

.bhhwgt-messages .bhh-lc-msg-agent-name {
  color: #6b7280;
  font-size: 10px;
  margin-bottom: 2px;
  text-align: right;
}

.bhhwgt-messages .bhh-lc-msg-meta {
  color: #9ca3af;
  font-size: 10px;
  margin-top: 2px;
}

/* Offline notice inside an existing conversation --------------------------- */

.bhhwgt-offline-session-notice {
  background: #fef3c7;
  border-left: 3px solid #f59e0b;
  border-radius: 4px;
  margin-bottom: 10px;
  padding: 10px 12px;
}

.bhhwgt-offline-session-notice .bhhwgt-offline-note {
  margin: 0 0 8px;
}

.bhhwgt-email-saved {
  color: #78350f;
  font-size: 12px;
}

/* Email prompt card --------------------------------------------------------- */

.bhhwgt-email-prompt {
  background: #fff4e5;
  border-left: 3px solid #f59e0b;
  border-radius: 4px;
  margin-top: 10px;
  padding: 12px 14px;
}

.bhhwgt-email-prompt-msg {
  color: #78350f;
  font-size: 13px;
  margin: 0 0 8px;
}

.bhhwgt-email-form {
  display: flex;
  gap: 6px;
}

.bhhwgt-email-form .bhhwgt-input {
  flex: 1;
  min-width: 0;
}

.bhhwgt-email-form .bhhwgt-send-btn {
  width: auto;
  padding: 8px 12px;
  font-size: 13px;
}

/* Reply bar ---------------------------------------------------------------- */

.bhhwgt-reply-wrap {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr auto;
}

.bhhwgt-reply-input {
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  outline: none;
  padding: 8px 10px;
  resize: none;
  transition: border-color 0.15s;
}

.bhhwgt-reply-input:focus {
  border-color: #1d4ed8;
  box-shadow: 0 0 0 2px rgba(29, 78, 216, 0.18);
}

.bhhwgt-reply-wrap .bhhwgt-send-btn {
  align-self: end;
  width: auto;
  padding: 9px 14px;
}

/* Confirmation / closed notices -------------------------------------------- */

.bhhwgt-confirm-msg,
.bhhwgt-closed-note {
  background: #f0fdf4;
  border-left: 3px solid #22c55e;
  border-radius: 4px;
  color: #14532d;
  font-size: 13px;
  margin: 0;
  padding: 12px 14px;
}

.bhhwgt-closed-note {
  margin-top: 10px;
}

/* Mobile — full-screen panel below 600 px ---------------------------------- */

@media (max-width: 600px) {
  .bhhwgt-panel {
    border-radius: 0;
    bottom: 0;
    height: 100dvh;
    right: 0;
    width: 100%;
  }

  .bhhwgt-body {
    max-height: none;
    flex: 1;
  }

  .bhhwgt-bubble {
    bottom: 16px;
    right: 16px;
  }
}

/* URL / image previews ----------------------------------------------------- */

.bhhwgt-messages .bhh-lc-inline-img {
  border-radius: 8px;
  display: block;
  margin-top: 6px;
  max-height: 200px;
  max-width: 100%;
  object-fit: contain;
}

.bhhwgt-messages .bhh-lc-url-preview {
  border: 1px solid #dcdcde;
  border-radius: 8px;
  display: flex;
  gap: 8px;
  margin-top: 6px;
  max-width: 100%;
  overflow: hidden;
  padding: 8px;
}

.bhhwgt-messages .bhh-lc-msg-agent .bhh-lc-url-preview {
  margin-left: auto;
}

.bhhwgt-messages .bhh-lc-msg-agent .bhh-lc-inline-img {
  margin-left: auto;
}

.bhhwgt-messages .bhh-lc-url-preview-img {
  border-radius: 4px;
  flex-shrink: 0;
  height: 52px;
  object-fit: cover;
  width: 52px;
}

.bhhwgt-messages .bhh-lc-url-preview-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.bhhwgt-messages .bhh-lc-url-preview-title {
  color: #1d2327;
  font-size: 11px;
  font-weight: 600;
  overflow: hidden;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bhhwgt-messages .bhh-lc-url-preview-desc {
  color: #646970;
  font-size: 10px;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.bhhwgt-messages .bhh-lc-url-preview-domain {
  color: #8c8f94;
  font-size: 10px;
}
