/* ═══════════════════════════════════════════════════════════
   SELLER CHAT WIDGET — People's Industry Investments
   Premium scripted chatbot for seller lead capture
   ═══════════════════════════════════════════════════════════ */

/* ── FLOATING LAUNCH BUTTON ── */
#sc-launcher {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 8900;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

#sc-btn {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: linear-gradient(135deg, #c9a84c 0%, #e0b95c 100%);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 32px rgba(201,168,76,.45), 0 2px 8px rgba(0,0,0,.3);
  transition: transform .22s cubic-bezier(.34,1.56,.64,1), box-shadow .22s;
  position: relative;
  flex-shrink: 0;
}
#sc-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 12px 40px rgba(201,168,76,.55), 0 4px 12px rgba(0,0,0,.35);
}
#sc-btn:active { transform: scale(.97); }

#sc-btn svg { transition: opacity .2s, transform .2s; }
#sc-btn .sc-icon-chat { opacity: 1; transform: scale(1); }
#sc-btn .sc-icon-close {
  position: absolute;
  opacity: 0;
  transform: scale(.5) rotate(-90deg);
}
body.sc--open #sc-btn .sc-icon-chat { opacity: 0; transform: scale(.5) rotate(90deg); }
body.sc--open #sc-btn .sc-icon-close { opacity: 1; transform: scale(1) rotate(0); }

/* Pulse ring — draws attention on load */
#sc-btn::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid rgba(201,168,76,.5);
  animation: sc-pulse-ring 2.5s ease-out infinite;
}
body.sc--open #sc-btn::before { display: none; }
@keyframes sc-pulse-ring {
  0% { transform: scale(.85); opacity: .7; }
  70% { transform: scale(1.3); opacity: 0; }
  100% { transform: scale(1.3); opacity: 0; }
}

/* Badge */
#sc-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ef4444;
  border: 2px solid #0a1628;
  font-size: .65rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Inter', system-ui, sans-serif;
  transition: transform .3s cubic-bezier(.34,1.56,.64,1);
}
body.sc--open #sc-badge { transform: scale(0); }

/* Tooltip */
#sc-tooltip {
  background: #0a1628;
  border: 1px solid rgba(201,168,76,.3);
  border-radius: 12px;
  padding: 10px 16px;
  font-size: .82rem;
  font-family: 'Inter', system-ui, sans-serif;
  color: #fff;
  white-space: nowrap;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
  animation: sc-tooltip-in .4s cubic-bezier(0,.6,.4,1) forwards;
  pointer-events: none;
}
#sc-tooltip strong { color: #c9a84c; }
@keyframes sc-tooltip-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── CHAT PANEL ── */
#sc-panel {
  position: fixed;
  bottom: 106px;
  right: 28px;
  z-index: 8800;
  width: 390px;
  max-height: 600px;
  display: flex;
  flex-direction: column;
  background: #0b1a30;
  border: 1px solid rgba(201,168,76,.2);
  border-radius: 20px;
  overflow: hidden;
  box-shadow:
    0 32px 80px rgba(0,0,0,.65),
    0 0 0 1px rgba(255,255,255,.04) inset;
  transform: translateY(20px) scale(.96);
  opacity: 0;
  pointer-events: none;
  transition: transform .32s cubic-bezier(0,.6,.4,1), opacity .28s cubic-bezier(0,.6,.4,1);
}
body.sc--open #sc-panel {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: all;
}

/* Gold top accent */
#sc-panel::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #c9a84c 30%, #e0b95c 60%, transparent);
  z-index: 1;
}

/* ── PANEL HEADER ── */
#sc-header {
  padding: 16px 18px 14px;
  background: rgba(255,255,255,.03);
  border-bottom: 1px solid rgba(255,255,255,.07);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.sc-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #c9a84c, #e0b95c);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: .78rem;
  color: #0a1628;
  font-family: 'Inter', system-ui, sans-serif;
  flex-shrink: 0;
  letter-spacing: .02em;
}
.sc-header-info { flex: 1; }
.sc-header-name {
  font-size: .88rem;
  font-weight: 600;
  color: #fff;
  font-family: 'Inter', system-ui, sans-serif;
  line-height: 1.3;
}
.sc-header-status {
  font-size: .7rem;
  color: #34d399;
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: 'Inter', system-ui, sans-serif;
  margin-top: 1px;
}
.sc-header-status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #34d399;
  animation: sc-dot-pulse 2s infinite;
}
@keyframes sc-dot-pulse {
  0%,100% { opacity: 1; }
  50% { opacity: .4; }
}
.sc-header-actions { display: flex; gap: 6px; }
.sc-header-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.1);
  color: rgba(255,255,255,.5);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .18s, color .18s;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: .78rem;
}
.sc-header-btn:hover { background: rgba(201,168,76,.18); color: #c9a84c; }

/* ── PROGRESS BAR ── */
#sc-progress-wrap {
  height: 3px;
  background: rgba(255,255,255,.06);
  flex-shrink: 0;
}
#sc-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #c9a84c, #e0b95c);
  width: 0%;
  transition: width .6s cubic-bezier(.25,.1,.25,1);
}

/* ── MESSAGE AREA ── */
#sc-messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px 16px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  scroll-behavior: smooth;
}
#sc-messages::-webkit-scrollbar { width: 4px; }
#sc-messages::-webkit-scrollbar-track { background: transparent; }
#sc-messages::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 2px; }

/* Message bubbles */
.sc-msg {
  display: flex;
  gap: 8px;
  max-width: 88%;
  animation: sc-msg-in .3s cubic-bezier(0,.6,.4,1) forwards;
  opacity: 0;
}
@keyframes sc-msg-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.sc-msg--bot { align-self: flex-start; }
.sc-msg--user { align-self: flex-end; flex-direction: row-reverse; max-width: 82%; }

.sc-bubble {
  padding: 10px 14px;
  border-radius: 16px;
  font-size: .84rem;
  line-height: 1.6;
  font-family: 'Inter', system-ui, sans-serif;
}
.sc-msg--bot .sc-bubble {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  color: rgba(255,255,255,.9);
  border-bottom-left-radius: 4px;
}
.sc-msg--user .sc-bubble {
  background: rgba(201,168,76,.14);
  border: 1px solid rgba(201,168,76,.25);
  color: #fff;
  border-bottom-right-radius: 4px;
}

/* Highlight / callout bubble */
.sc-bubble--callout {
  background: rgba(201,168,76,.08) !important;
  border-color: rgba(201,168,76,.3) !important;
  color: rgba(255,255,255,.88) !important;
}
.sc-bubble--urgent {
  background: rgba(239,68,68,.1) !important;
  border-color: rgba(239,68,68,.35) !important;
}
.sc-bubble--success {
  background: rgba(52,211,153,.08) !important;
  border-color: rgba(52,211,153,.25) !important;
}

/* Typing indicator */
.sc-typing {
  align-self: flex-start;
  padding: 10px 14px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 16px;
  border-bottom-left-radius: 4px;
  display: flex;
  gap: 4px;
  align-items: center;
  animation: sc-msg-in .3s forwards;
  opacity: 0;
}
.sc-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,.4);
  animation: sc-bounce 1.2s infinite;
}
.sc-typing span:nth-child(2) { animation-delay: .18s; }
.sc-typing span:nth-child(3) { animation-delay: .36s; }
@keyframes sc-bounce {
  0%,60%,100% { transform: translateY(0); }
  30% { transform: translateY(-5px); }
}

/* Timestamp */
.sc-time {
  font-size: .62rem;
  color: rgba(255,255,255,.28);
  font-family: 'Inter', system-ui, sans-serif;
  padding: 0 4px;
  margin-top: 2px;
  align-self: flex-end;
}
.sc-msg--user .sc-time { text-align: right; }

/* ── INPUT AREA ── */
#sc-input-area {
  padding: 12px 14px 14px;
  border-top: 1px solid rgba(255,255,255,.07);
  background: rgba(0,0,0,.15);
  flex-shrink: 0;
}

/* Chips */
.sc-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  animation: sc-msg-in .3s forwards;
  opacity: 0;
}
.sc-chip {
  padding: 8px 14px;
  background: transparent;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 50px;
  font-size: .8rem;
  font-weight: 500;
  color: rgba(255,255,255,.8);
  cursor: pointer;
  font-family: 'Inter', system-ui, sans-serif;
  transition: background .16s, border-color .16s, color .16s, transform .14s;
  white-space: nowrap;
}
.sc-chip:hover {
  background: rgba(201,168,76,.12);
  border-color: rgba(201,168,76,.45);
  color: #e0b95c;
  transform: translateY(-1px);
}
.sc-chip:active { transform: translateY(0) scale(.98); }
.sc-chip--selected {
  background: rgba(201,168,76,.18);
  border-color: #c9a84c;
  color: #e0b95c;
}
.sc-chip--urgent {
  border-color: rgba(239,68,68,.5);
  color: #f87171;
}
.sc-chip--urgent:hover {
  background: rgba(239,68,68,.12);
  border-color: rgba(239,68,68,.7);
  color: #f87171;
}

/* Text input row */
.sc-text-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  animation: sc-msg-in .3s forwards;
  opacity: 0;
}
.sc-text-input-wrap {
  flex: 1;
  position: relative;
}
.sc-text-input-wrap .sc-currency-prefix {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255,255,255,.45);
  font-size: .88rem;
  font-family: 'Inter', system-ui, sans-serif;
  pointer-events: none;
}
.sc-text-input {
  width: 100%;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 12px;
  padding: 11px 14px;
  font-size: .88rem;
  font-family: 'Inter', system-ui, sans-serif;
  color: #fff;
  outline: none;
  transition: border-color .18s, background .18s;
  -webkit-appearance: none;
}
.sc-text-input--currency { padding-left: 26px; }
.sc-text-input::placeholder { color: rgba(255,255,255,.3); }
.sc-text-input:focus {
  border-color: rgba(201,168,76,.55);
  background: rgba(201,168,76,.05);
}
.sc-text-input.sc--error {
  border-color: rgba(239,68,68,.55);
  animation: sc-shake .4s;
}
@keyframes sc-shake {
  0%,100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.sc-send {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #c9a84c, #e0b95c);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: opacity .18s, transform .18s;
}
.sc-send:hover { opacity: .88; transform: scale(1.06); }
.sc-send:active { transform: scale(.96); }
.sc-send:disabled { opacity: .4; cursor: not-allowed; transform: none; }

/* Skip button */
.sc-skip {
  display: block;
  width: 100%;
  text-align: center;
  font-size: .74rem;
  color: rgba(255,255,255,.3);
  padding: 6px 0 0;
  background: none;
  border: none;
  cursor: pointer;
  font-family: 'Inter', system-ui, sans-serif;
  transition: color .18s;
}
.sc-skip:hover { color: rgba(255,255,255,.55); }

/* ── LEAD SUMMARY CARD ── */
.sc-summary {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 12px;
  padding: 14px 16px;
  font-family: 'Inter', system-ui, sans-serif;
  animation: sc-msg-in .4s forwards;
  opacity: 0;
  margin-top: 4px;
}
.sc-summary__title {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #c9a84c;
  margin-bottom: 10px;
}
.sc-summary__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  padding: 4px 0;
  border-bottom: 1px solid rgba(255,255,255,.05);
  font-size: .78rem;
}
.sc-summary__row:last-child { border-bottom: none; }
.sc-summary__label { color: rgba(255,255,255,.45); flex-shrink: 0; }
.sc-summary__val { color: #fff; font-weight: 500; text-align: right; }
.sc-summary__urgent {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(239,68,68,.15);
  border: 1px solid rgba(239,68,68,.35);
  border-radius: 50px;
  padding: 2px 10px;
  font-size: .7rem;
  font-weight: 700;
  color: #f87171;
  letter-spacing: .04em;
  margin-bottom: 10px;
}
.sc-summary__urgent::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ef4444;
  animation: sc-dot-pulse 1s infinite;
}

/* ── SUCCESS SCREEN ── */
.sc-success-screen {
  padding: 10px 0 4px;
  text-align: center;
  animation: sc-msg-in .4s forwards;
  opacity: 0;
}
.sc-success-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(52,211,153,.1);
  border: 2px solid rgba(52,211,153,.3);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
}
.sc-success-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.15rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 8px;
}
.sc-success-body {
  font-size: .8rem;
  color: rgba(255,255,255,.5);
  line-height: 1.7;
  max-width: 300px;
  margin: 0 auto 16px;
}
.sc-success-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}
.sc-success-btn {
  padding: 9px 18px;
  border-radius: 8px;
  font-size: .8rem;
  font-weight: 600;
  font-family: 'Inter', system-ui, sans-serif;
  cursor: pointer;
  border: none;
  transition: opacity .18s, transform .18s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.sc-success-btn:hover { opacity: .88; transform: translateY(-1px); text-decoration: none; }
.sc-success-btn--gold { background: linear-gradient(135deg, #c9a84c, #e0b95c); color: #0a1628; }
.sc-success-btn--outline {
  background: transparent;
  border: 1px solid rgba(255,255,255,.18);
  color: rgba(255,255,255,.7);
}

/* ── FAQ GRID ── */
.sc-faq-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
  animation: sc-msg-in .3s forwards;
  opacity: 0;
}
.sc-faq-item {
  padding: 9px 14px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 10px;
  font-size: .8rem;
  color: rgba(255,255,255,.78);
  cursor: pointer;
  font-family: 'Inter', system-ui, sans-serif;
  transition: background .16s, border-color .16s;
  text-align: left;
}
.sc-faq-item:hover {
  background: rgba(201,168,76,.1);
  border-color: rgba(201,168,76,.3);
  color: #e0b95c;
}

/* ── URGENT BANNER ── */
.sc-urgent-bar {
  padding: 8px 14px;
  background: rgba(239,68,68,.12);
  border-bottom: 1px solid rgba(239,68,68,.25);
  font-size: .72rem;
  font-weight: 600;
  color: #f87171;
  text-align: center;
  letter-spacing: .04em;
  font-family: 'Inter', system-ui, sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-shrink: 0;
}
.sc-urgent-bar::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ef4444;
  animation: sc-dot-pulse 1s infinite;
}

/* ── MOBILE ── */
@media (max-width: 480px) {
  #sc-launcher { bottom: 18px; right: 18px; }
  #sc-panel {
    width: calc(100vw - 24px);
    right: 12px;
    bottom: 96px;
    max-height: calc(100vh - 120px);
    border-radius: 18px;
  }
  #sc-btn { width: 56px; height: 56px; }
}
@media (max-width: 360px) {
  #sc-panel { width: calc(100vw - 16px); right: 8px; }
}
