/* landing/assets/help-assistant.css — storefront help assistant widget. */

:root {
  --sshelp-grad: linear-gradient(135deg, var(--accent-dark) 0%, var(--accent) 100%);
  --sshelp-accent: var(--accent-ink);
}

/* ---------------- launcher ---------------- */
.sshelp-launcher {
  position: fixed;
  right: 18px;
  bottom: 18px;
  /* Below the seller-chat drawer (z-index 1200) so an open shop chat takes the
     corner; above normal page content. */
  z-index: 1100;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px 12px 14px;
  border: none;
  border-radius: 999px;
  background: var(--sshelp-grad);
  color: #fff;
  font: 600 14px/1 "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(79, 70, 229, 0.38);
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
  animation: sshelp-pop 0.35s ease both;
}
.sshelp-launcher:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(79, 70, 229, 0.5); }
.sshelp-launcher.is-open { opacity: 0; pointer-events: none; transform: scale(0.85); }
.sshelp-launcher-ic { font-size: 18px; line-height: 1; }
.sshelp-launcher-text { white-space: nowrap; }

@keyframes sshelp-pop { from { transform: scale(0.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ---------------- panel ---------------- */
.sshelp-panel {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 1150;
  width: 372px;
  max-width: calc(100vw - 24px);
  height: 560px;
  max-height: calc(100vh - 36px);
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(17, 24, 39, 0.32);
  font: 14px/1.5 "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: #111827;
  opacity: 0;
  transform: translateY(16px) scale(0.98);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.sshelp-panel.is-open { opacity: 1; transform: none; pointer-events: auto; }

.sshelp-head {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 14px 14px 14px 16px;
  background: var(--sshelp-grad);
  color: #fff;
}
.sshelp-ava {
  width: 36px; height: 36px; flex: 0 0 auto;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  font-size: 18px;
}
.sshelp-titles { flex: 1; min-width: 0; }
.sshelp-title { font-weight: 700; font-size: 15px; }
.sshelp-sub { display: flex; align-items: center; gap: 6px; font-size: 12px; opacity: 0.9; }
.sshelp-dot { width: 7px; height: 7px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.7); animation: sshelp-pulse 2s infinite; }
@keyframes sshelp-pulse { 0% { box-shadow: 0 0 0 0 rgba(52,211,153,0.6); } 70% { box-shadow: 0 0 0 6px rgba(52,211,153,0); } 100% { box-shadow: 0 0 0 0 rgba(52,211,153,0); } }
.sshelp-lang {
  flex: 0 0 auto;
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font: 600 12px/1 inherit;
  border-radius: 8px;
  padding: 5px 8px;
  cursor: pointer;
  max-width: 92px;
}
.sshelp-lang:focus { outline: 2px solid rgba(255, 255, 255, 0.6); outline-offset: 1px; }
.sshelp-lang option { color: #111827; }
.sshelp-close {
  border: none; background: transparent; color: #fff;
  font-size: 24px; line-height: 1; cursor: pointer; padding: 0 2px; opacity: 0.85;
}
.sshelp-close:hover { opacity: 1; }

/* ---------------- log ---------------- */
.sshelp-log {
  flex: 1; overflow-y: auto; padding: 16px 14px;
  display: flex; flex-direction: column; gap: 4px;
  background: #f6f7fb;
}
.sshelp-row { display: flex; flex-direction: column; margin-bottom: 8px; }
.sshelp-row-user { align-items: flex-end; }
.sshelp-row-bot { align-items: flex-start; }
.sshelp-in { animation: sshelp-rise 0.26s ease both; }
@keyframes sshelp-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.sshelp-msg {
  max-width: 86%;
  padding: 10px 13px;
  border-radius: 16px;
  white-space: normal;
  word-wrap: break-word;
}
.sshelp-msg-bot { background: #fff; border: 1px solid #e8eaf2; border-bottom-left-radius: 5px; box-shadow: 0 1px 2px rgba(16,24,40,0.04); }
.sshelp-msg-user { background: var(--sshelp-grad); color: #fff; border-bottom-right-radius: 5px; }
.sshelp-msg strong { font-weight: 700; }

/* typing dots */
.sshelp-typing { display: inline-flex; gap: 4px; align-items: center; }
.sshelp-typing span {
  width: 7px; height: 7px; border-radius: 50%; background: #9aa3b2; display: inline-block;
  animation: sshelp-bounce 1.2s infinite ease-in-out both;
}
.sshelp-typing span:nth-child(2) { animation-delay: 0.18s; }
.sshelp-typing span:nth-child(3) { animation-delay: 0.36s; }
@keyframes sshelp-bounce { 0%, 80%, 100% { transform: scale(0.6); opacity: 0.5; } 40% { transform: scale(1); opacity: 1; } }

/* feedback / tools row */
.sshelp-tools { display: flex; align-items: center; gap: 6px; margin: 5px 2px 0; flex-wrap: wrap; }
.sshelp-tool {
  border: 1px solid #e2e5ee; background: #fff; border-radius: 8px;
  padding: 3px 7px; font-size: 13px; cursor: pointer; line-height: 1.2; opacity: 0.8;
  transition: transform 0.12s ease, background 0.12s ease, opacity 0.12s ease;
}
.sshelp-tool:hover { opacity: 1; background: #f1f3fb; transform: translateY(-1px); }
.sshelp-tool.is-active { background: #eef2ff; border-color: #c7d2fe; opacity: 1; }
.sshelp-thanks { font-size: 12px; color: #16a34a; margin-left: 2px; }

.sshelp-reason { display: flex; gap: 6px; width: 100%; margin-top: 6px; }
.sshelp-reason-in {
  flex: 1; border: 1px solid #d8dbe6; border-radius: 9px; padding: 7px 10px; font: inherit; font-size: 13px; outline: none;
}
.sshelp-reason-in:focus { border-color: var(--sshelp-accent); }
.sshelp-reason-send {
  border: none; background: var(--sshelp-accent); color: #fff; border-radius: 9px; padding: 0 12px; font-size: 13px; cursor: pointer;
}

/* suggestion chips */
.sshelp-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 4px; }
.sshelp-chip {
  border: 1px solid #d7dbe8; background: #fff; border-radius: 999px;
  padding: 7px 12px; font-size: 12.5px; cursor: pointer; color: #4338ca; font-weight: 600;
  transition: background 0.12s ease, transform 0.12s ease;
}
.sshelp-chip:hover { background: #eef2ff; transform: translateY(-1px); }

/* ---------------- composer ---------------- */
.sshelp-form { display: flex; align-items: center; gap: 8px; padding: 12px; border-top: 1px solid #eceef5; background: #fff; }
.sshelp-input {
  flex: 1; border: 1px solid #d8dbe6; border-radius: 999px; padding: 11px 15px; font: inherit; outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.sshelp-input:focus { border-color: var(--sshelp-accent); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12); }
.sshelp-send, .sshelp-mic {
  flex: 0 0 auto; border: none; cursor: pointer; border-radius: 50%;
  width: 42px; height: 42px; display: grid; place-items: center;
}
.sshelp-send { background: var(--sshelp-grad); color: #fff; transition: transform 0.12s ease, filter 0.12s ease; }
.sshelp-send:hover { transform: scale(1.06); }
.sshelp-mic { background: #eef0f6; color: #374151; font-size: 17px; transition: background 0.12s ease; }
.sshelp-mic:hover { background: #e3e7f2; }
.sshelp-mic.is-listening { background: #fee2e2; animation: sshelp-listen 1s infinite; }
@keyframes sshelp-listen { 0%,100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.5);} 60% { box-shadow: 0 0 0 7px rgba(239,68,68,0);} }
.sshelp-send:disabled, .sshelp-mic:disabled, .sshelp-input:disabled { opacity: 0.55; cursor: default; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .sshelp-launcher, .sshelp-panel, .sshelp-in, .sshelp-dot, .sshelp-typing span, .sshelp-mic.is-listening { animation: none !important; transition: none !important; }
}

/* Keep clear of the storefront's own embedded mode. */
.embedded .sshelp-launcher, .embedded .sshelp-panel { display: none; }
