/* ════════════════════════════════════════════════════════════════════════
   Shared HHCCoin Wellness Chat Widget — styles
   Used by: index.html, shop.html, product.html, wellness.html
   Markup is injected by chat-widget.js — do not hand-author #wc-* elements.
   ════════════════════════════════════════════════════════════════════════ */

/* ── Bubble ──────────────────────────────────────────────────────────── */
#wc-bubble {
  position: fixed; bottom: 24px; right: 24px; z-index: 9000;
  display: flex; flex-direction: column; align-items: flex-end; gap: 10px;
  transition: opacity .25s ease;
}
/* While the page is actively scrolling, fade the bubble out and let taps
   pass through it — prevents it from stealing taps meant for CTAs (e.g.
   "Join Waitlist", "Read Full Whitepaper") that happen to scroll into the
   bottom-right corner underneath it. Re-shown ~400ms after scroll settles. */
#wc-bubble.wc-scrolling {
  opacity: 0;
  pointer-events: none;
}
#wc-popup {
  background: #fff; border-radius: 16px 16px 4px 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,.18);
  padding: 12px 14px; max-width: 230px;
  display: flex; align-items: flex-start; gap: 10px;
  animation: wc-pop .3s ease;
}
@keyframes wc-pop { from { opacity:0; transform:translateY(8px);} to { opacity:1; transform:none; } }
#wc-popup .wc-av {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  overflow: hidden; background: #1a4d34;
}
#wc-popup .wc-av img { width: 100%; height: 100%; object-fit: cover; display: block; }
#wc-popup p { margin: 0; font-size: 13px; color: #1a1a2e; line-height: 1.45; }
#wc-popup-close {
  position: absolute; top: -8px; right: -8px;
  width: 20px; height: 20px; border-radius: 50%;
  background: #bbb; border: none; cursor: pointer;
  font-size: 11px; color: #fff; line-height: 20px; text-align: center;
  padding: 0;
}
#wc-btn {
  width: 58px; height: 58px; border-radius: 50%; border: none; cursor: pointer;
  background: #1a4d34;
  box-shadow: 0 4px 20px rgba(0,200,114,.4);
  overflow: hidden; padding: 0;
  transition: transform .2s, box-shadow .2s;
}
#wc-btn img { width: 100%; height: 100%; object-fit: cover; display: block; }
#wc-btn:hover { transform: scale(1.08); box-shadow: 0 6px 24px rgba(0,200,114,.55); }
#wc-badge {
  position: absolute; top: 0; right: 0;
  width: 14px; height: 14px; border-radius: 50%;
  background: #ff4f4f; border: 2px solid #fff;
}

/* ── Chat window ─────────────────────────────────────────────────────── */
#wc-window {
  position: fixed; bottom: 94px; right: 24px; z-index: 9001;
  width: 340px; max-width: calc(100vw - 32px);
  background: #0f0f1a; border-radius: 18px;
  box-shadow: 0 12px 48px rgba(0,0,0,.45);
  display: none; flex-direction: column;
  overflow: hidden; font-family: 'Outfit', Arial, sans-serif;
  border: 1px solid rgba(255,255,255,.08);
}
#wc-window.open { display: flex; animation: wc-slide .25s ease; }
@keyframes wc-slide { from { opacity:0; transform:translateY(16px);} to { opacity:1; transform:none; } }

/* header */
#wc-header {
  background: linear-gradient(90deg,#00b8d9,#00c872);
  padding: 12px 14px; display: flex; align-items: center; gap: 10px;
}
#wc-header .wc-hav {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  overflow: hidden; background: #1a4d34;
}
#wc-header .wc-hav img { width: 100%; height: 100%; object-fit: cover; display: block; }
#wc-header .wc-hinfo { flex: 1; }
#wc-header .wc-hname { font-size: 14px; font-weight: 700; color: #fff; }
#wc-header .wc-hstatus { font-size: 11px; color: rgba(255,255,255,.8); }
#wc-close-btn {
  background: rgba(255,255,255,.2); border: none; cursor: pointer;
  border-radius: 50%; width: 28px; height: 28px; color: #fff;
  font-size: 16px; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

/* messages */
#wc-messages {
  flex: 1; overflow-y: auto; padding: 14px 12px;
  display: flex; flex-direction: column; gap: 10px;
  min-height: 240px; max-height: 340px;
}
#wc-messages::-webkit-scrollbar { width: 4px; }
#wc-messages::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 4px; }

.wc-msg { display: flex; gap: 8px; align-items: flex-start; }
.wc-msg.user { flex-direction: row-reverse; }
.wc-msg .wc-mav {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  overflow: hidden; background: #1a4d34;
}
.wc-msg .wc-mav img { width: 100%; height: 100%; object-fit: cover; display: block; }
.wc-msg.user .wc-mav { background: #2a2a40; font-size: 14px; display: flex; align-items: center; justify-content: center; }
.wc-bubble {
  max-width: 82%; padding: 9px 12px; border-radius: 14px;
  font-size: 13px; line-height: 1.5; color: #e8e8f0;
}
.wc-msg.bot  .wc-bubble { background: #1c1c30; border-radius: 4px 14px 14px 14px; }
.wc-msg.user .wc-bubble { background: linear-gradient(135deg,#00b8d9,#00c872); color:#fff; border-radius: 14px 4px 14px 14px; }
.wc-bubble a { color: #00d9ff; text-decoration: none; }
.wc-bubble a:hover { text-decoration: underline; }
.wc-bubble strong { color: #fff; }

/* typing dots */
.wc-typing { display: flex; gap: 4px; padding: 4px 0; }
.wc-typing span {
  width: 7px; height: 7px; border-radius: 50%; background: #00d9ff;
  animation: wc-dot 1.2s infinite; opacity: .4;
}
.wc-typing span:nth-child(2) { animation-delay: .2s; }
.wc-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes wc-dot { 0%,80%,100%{opacity:.4;transform:none} 40%{opacity:1;transform:translateY(-4px);} }

/* quick buttons */
#wc-quick {
  display: flex; flex-wrap: wrap; gap: 6px; padding: 0 12px 8px;
}
.wc-quick-btn {
  background: rgba(0,217,255,.1); border: 1px solid rgba(0,217,255,.25);
  color: #00d9ff; border-radius: 20px; padding: 5px 12px;
  font-size: 12px; cursor: pointer; transition: background .15s;
  font-family: inherit;
}
.wc-quick-btn:hover { background: rgba(0,217,255,.2); }

/* email capture */
#wc-email-card {
  margin: 0 12px 10px; background: #1c1c30; border-radius: 12px;
  padding: 12px; display: none; flex-direction: column; gap: 8px;
  border: 1px solid rgba(0,217,255,.2);
}
#wc-email-card p { margin:0; font-size:12px; color:#aaa; line-height:1.4; }
#wc-email-card .wc-ei {
  display: flex; gap: 6px;
}
#wc-email-input {
  flex:1; background:#0f0f1a; border:1px solid rgba(255,255,255,.12);
  border-radius: 8px; padding: 7px 10px; color:#fff; font-size:12px;
  font-family:inherit; outline:none;
}
#wc-email-input:focus { border-color: rgba(0,217,255,.5); }
#wc-email-submit {
  background: linear-gradient(90deg,#00b8d9,#00c872); border:none;
  border-radius:8px; padding:7px 12px; color:#fff; font-size:12px;
  cursor:pointer; font-family:inherit; font-weight:600; white-space:nowrap;
}
#wc-email-msg { font-size:11px; color:#00c872; display:none; margin:0; }

/* retry */
#wc-retry-card {
  margin: 0 12px 10px; background: #1c1c30; border-radius: 12px;
  padding: 12px; display: none; flex-direction: column; gap: 8px;
  border: 1px solid rgba(255,79,79,.3);
}
#wc-retry-card p { margin:0; font-size:12px; color:#ccc; line-height:1.4; }
#wc-retry-btn {
  background: linear-gradient(90deg,#00b8d9,#00c872); border:none;
  border-radius:8px; padding:7px 12px; color:#fff; font-size:12px;
  cursor:pointer; font-family:inherit; font-weight:600; align-self:flex-start;
}

/* input row */
#wc-input-row {
  display: flex; gap: 8px; padding: 10px 12px;
  border-top: 1px solid rgba(255,255,255,.06);
}
#wc-input {
  flex:1; background:#1c1c30; border:1px solid rgba(255,255,255,.1);
  border-radius:10px; padding:9px 12px; color:#fff; font-size:13px;
  font-family:inherit; outline:none; resize:none; max-height:80px;
}
#wc-input:focus { border-color:rgba(0,217,255,.4); }
#wc-send {
  background:linear-gradient(135deg,#00b8d9,#00c872); border:none;
  border-radius:10px; width:38px; height:38px; cursor:pointer;
  display:flex; align-items:center; justify-content:center; flex-shrink:0;
  align-self:flex-end;
}
#wc-send svg { width:16px; height:16px; fill:#fff; }

/* mobile */
@media (max-width: 480px) {
  #wc-window { bottom: 84px; right: 12px; left: 12px; width: auto; }
  #wc-bubble { bottom: 16px; right: 16px; }
  #wc-messages { max-height: 280px; }
}
