/* ─────────────────────────────────────────────────────────
   Vypo Sales Chat Widget — Landing Page
   ───────────────────────────────────────────────────────── */

/* ── Floating Action Button ─────────────────────────────── */
.schat-fab {
  position: fixed; right: 1.5rem; bottom: 1.5rem; z-index: 9999;
  width: 60px; height: 60px; border-radius: 50%;
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  color: #fff; border: none; cursor: pointer;
  display: grid; place-items: center;
  padding: 0; overflow: hidden;
  box-shadow: 0 8px 28px rgba(124, 58, 237, .5);
  transition: transform .2s, box-shadow .2s;
  animation: schat-pulse 3s ease-in-out infinite;
}
.schat-fab-img {
  width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 50%;
}
.schat-fab:hover {
  transform: scale(1.08);
  box-shadow: 0 12px 38px rgba(168, 85, 247, .65);
}
.schat-fab.open { animation: none; }

@keyframes schat-pulse {
  0%, 100% { box-shadow: 0 8px 28px rgba(124, 58, 237, .5); }
  50%       { box-shadow: 0 8px 36px rgba(168, 85, 247, .75), 0 0 0 8px rgba(168, 85, 247, .12); }
}

/* ── Tooltip ─────────────────────────────────────────────── */
.schat-tooltip {
  position: fixed; right: 5rem; bottom: 2.1rem; z-index: 10000;
  background: #1e1e30;
  border: 1px solid rgba(168, 85, 247, .3);
  border-radius: 10px;
  padding: .5rem .85rem;
  font-family: 'Inter', sans-serif;
  font-size: .82rem;
  color: #e2e8f0;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .4);
  animation: schat-tooltip-in .3s ease both;
}
.schat-tooltip::after {
  content: '';
  position: absolute; right: -6px; top: 50%;
  transform: translateY(-50%);
  border-width: 6px 0 6px 6px;
  border-style: solid;
  border-color: transparent transparent transparent #1e1e30;
}
.schat-tooltip.hide {
  animation: schat-tooltip-out .3s ease both;
}
@keyframes schat-tooltip-in  { from { opacity: 0; transform: translateX(6px); } to { opacity: 1; transform: translateX(0); } }
@keyframes schat-tooltip-out { from { opacity: 1; transform: translateX(0); } to { opacity: 0; transform: translateX(6px); } }

/* ── Chat Panel ──────────────────────────────────────────── */
.schat-panel {
  position: fixed; right: 1.5rem; bottom: 5.5rem; z-index: 9998;
  width: 360px; max-width: calc(100vw - 2rem);
  height: 500px; max-height: calc(100vh - 7rem);
  background: #0d0d15;
  border: 1px solid rgba(124, 58, 237, .25);
  border-radius: 20px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, .65), 0 0 0 1px rgba(168, 85, 247, .12);
  display: flex; flex-direction: column;
  overflow: hidden;
  font-family: 'Inter', sans-serif;
  color: #e2e8f0;

  /* Slide-up animation */
  opacity: 0;
  transform: translateY(12px) scale(.98);
  pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
}
.schat-panel.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* ── Header ──────────────────────────────────────────────── */
.schat-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.1rem .9rem;
  background: linear-gradient(135deg, rgba(124, 58, 237, .22), rgba(168, 85, 247, .1));
  border-bottom: 1px solid rgba(255, 255, 255, .06);
  flex-shrink: 0;
}
.schat-title {
  display: flex; align-items: center; gap: .55rem;
  font-size: 1rem; font-weight: 700;
  font-family: 'Syne', 'Inter', sans-serif;
  letter-spacing: -.01em;
}
.schat-title-icon {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  display: grid; place-items: center;
  overflow: hidden; flex-shrink: 0;
}
.schat-title-img {
  width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 50%;
}
.schat-title-text { color: #f0f0ff; }
.schat-title-sub  { font-size: .68rem; color: #10b981; font-weight: 500; display: block; }
.schat-close {
  background: none; border: none; color: #6b6b8a;
  font-size: 1.4rem; cursor: pointer; line-height: 1;
  transition: color .15s;
}
.schat-close:hover { color: #f0f0ff; }

/* ── Messages ────────────────────────────────────────────── */
.schat-body {
  flex: 1; overflow-y: auto;
  padding: 1rem; display: flex; flex-direction: column; gap: .75rem;
}
.schat-body::-webkit-scrollbar { width: 4px; }
.schat-body::-webkit-scrollbar-thumb { background: #2a2a3e; border-radius: 3px; }

.schat-msg { display: flex; gap: .5rem; }
.schat-msg-bubble {
  max-width: 84%; padding: .65rem .9rem;
  border-radius: 14px;
  font-size: .85rem; line-height: 1.55;
  white-space: pre-wrap; word-wrap: break-word;
}
.schat-msg.bot .schat-msg-bubble {
  background: #12121a;
  border: 1px solid rgba(255, 255, 255, .07);
  border-top-left-radius: 4px;
  color: #d4d4e8;
}
.schat-msg.user {
  justify-content: flex-end;
}
.schat-msg.user .schat-msg-bubble {
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  color: #fff;
  border-top-right-radius: 4px;
}
.schat-msg-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  display: grid; place-items: center;
  flex-shrink: 0; overflow: hidden;
  align-self: flex-end;
}
.schat-avatar-img {
  width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 50%;
}

/* ── Typing indicator ────────────────────────────────────── */
.schat-typing { display: inline-flex; gap: 4px; padding: .2rem 0; }
.schat-typing span {
  width: 6px; height: 6px; border-radius: 50%; background: #6b6b8a;
  animation: schat-dot 1.2s infinite ease-in-out;
}
.schat-typing span:nth-child(2) { animation-delay: .2s; }
.schat-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes schat-dot {
  0%, 60%, 100% { opacity: .3; transform: translateY(0); }
  30%           { opacity: 1;  transform: translateY(-3px); }
}

/* ── Limit notice ────────────────────────────────────────── */
.schat-limit-notice {
  margin: .5rem 1rem;
  padding: .6rem .9rem;
  background: rgba(124, 58, 237, .08);
  border: 1px solid rgba(124, 58, 237, .2);
  border-radius: 10px;
  font-size: .78rem;
  color: #a78bfa;
  text-align: center;
  flex-shrink: 0;
}

/* ── Input area ──────────────────────────────────────────── */
.schat-foot {
  padding: .75rem;
  border-top: 1px solid rgba(255, 255, 255, .05);
  display: flex; gap: .5rem;
  flex-shrink: 0;
}
.schat-input {
  flex: 1;
  background: #12121a;
  border: 1px solid rgba(255, 255, 255, .1);
  color: #e2e8f0;
  border-radius: 12px;
  padding: .65rem .9rem;
  font-family: 'Inter', sans-serif;
  font-size: .85rem;
  outline: none;
  transition: border-color .15s;
  resize: none;
}
.schat-input:focus { border-color: #a855f7; }
.schat-input::placeholder { color: #475569; }
.schat-input:disabled { opacity: .5; cursor: not-allowed; }

.schat-send {
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  color: #fff; border: none;
  width: 42px; height: 42px;
  border-radius: 12px;
  cursor: pointer;
  display: grid; place-items: center;
  font-size: 18px;
  transition: opacity .15s, transform .15s;
  align-self: flex-end;
}
.schat-send:hover { transform: scale(1.05); }
.schat-send:disabled { opacity: .4; cursor: not-allowed; }

/* ── Mobile ──────────────────────────────────────────────── */
@media (max-width: 500px) {
  .schat-panel {
    right: 0; left: 0; bottom: 0;
    width: 100%; max-width: 100%;
    height: 70vh; max-height: 70vh;
    border-radius: 20px 20px 0 0;
    bottom: 0;
  }
  .schat-fab { right: 1rem; bottom: 1rem; }
  .schat-tooltip { right: 4.5rem; bottom: 1.6rem; }
}
