
/* ═══════════════════════════════════════════
   BLOB Widget CSS v4 — Square avatar
   ═══════════════════════════════════════════ */

#blob-widget {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  font-family: 'Inter', sans-serif;
}

/* Intro bubble */
#blob-intro-bubble {
  display: none;
  position: absolute;
  bottom: 80px;
  right: 0;
  background: white;
  border-radius: 14px 14px 4px 14px;
  padding: 10px 14px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #08062B;
  box-shadow: 0 6px 24px rgba(0,0,0,0.14);
  border: 1px solid rgba(4,209,255,0.2);
  white-space: nowrap;
  align-items: center;
  gap: 8px;
  animation: blobBubbleIn 0.4s cubic-bezier(0.34,1.56,0.64,1) forwards;
  cursor: pointer;
}
#blob-intro-bubble::after {
  content: '';
  position: absolute;
  bottom: -8px;
  right: 20px;
  border-left: 8px solid transparent;
  border-top: 8px solid white;
}
#blob-bubble-close {
  background: none;
  border: none;
  color: #9ca3af;
  font-size: 0.65rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}
@keyframes blobBubbleIn {
  from { opacity:0; transform:scale(0.8) translateY(6px); }
  to   { opacity:1; transform:scale(1) translateY(0); }
}

/* Launcher — SQUARE */
#blob-launcher {
  width: 68px;
  height: 68px;
  border-radius: 16px;
  background: #08062B;
  border: 2px solid rgba(4,209,255,0.3);
  cursor: pointer;
  box-shadow: 0 8px 32px rgba(4,209,255,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  padding: 0;
}
#blob-launcher:hover {
  transform: scale(1.07);
  box-shadow: 0 6px 28px rgba(4,209,255,0.55);
}
#blob-launcher-img {
  width: 68px !important;
  height: 68px !important;
  object-fit: cover !important;
  border-radius: 14px !important;
  display: block;
}
/* Pulse ring */
#blob-launcher::before {
  content: '';
  position: absolute;
  inset: -5px;
  border-radius: 20px;
  background: linear-gradient(135deg,#04D1FF,#6366f1);
  opacity: 0.2;
  animation: blobPulse 2s ease-in-out infinite;
  z-index: -1;
}
@keyframes blobPulse {
  0%,100% { transform:scale(1); opacity:0.2; }
  50%      { transform:scale(1.22); opacity:0.05; }
}

/* Chat window */
#blob-chat {
  position: absolute;
  bottom: 76px;
  right: 0;
  width: 340px;
  max-height: 500px;
  background: #0e0b2e;
  border-radius: 1.25rem;
  border: 1px solid rgba(4,209,255,0.2);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  flex-direction: column;
  overflow: hidden;
}

/* Header */
#blob-chat-header {
  background: linear-gradient(135deg,rgba(4,209,255,0.12),rgba(99,102,241,0.12));
  border-bottom: 1px solid rgba(4,209,255,0.12);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.blob-hdr-avatar {
  width: 36px; height: 36px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
  background: rgba(4,209,255,0.1);
}
.blob-hdr-avatar img { width:100%; height:100%; object-fit:cover; }
.blob-hdr-info { flex:1; }
.blob-hdr-name {
  font-size: 0.85rem; font-weight:700; color:white;
  display:flex; align-items:center; gap:6px;
}
.blob-dot-live {
  width:7px; height:7px; background:#4ade80; border-radius:50%;
  animation: blobDotPulse 1.5s ease-in-out infinite;
}
@keyframes blobDotPulse { 0%,100%{opacity:1} 50%{opacity:.3} }
.blob-hdr-sub { font-size:0.68rem; color:rgba(255,255,255,0.4); margin-top:1px; }
.blob-x {
  background:none; border:none; color:rgba(255,255,255,0.35);
  cursor:pointer; font-size:1rem; padding:4px; transition:color 0.15s;
}
.blob-x:hover { color:white; }

/* Messages */
#blob-messages {
  flex:1; overflow-y:auto; padding:12px;
  display:flex; flex-direction:column; gap:10px;
  scrollbar-width:thin; scrollbar-color:rgba(4,209,255,0.2) transparent;
}
.blob-msg { display:flex; align-items:flex-end; gap:8px; max-width:88%; }
.blob-msg.bot  { align-self:flex-start; }
.blob-msg.user { align-self:flex-end; flex-direction:row-reverse; }
.blob-msg-av {
  width:28px; height:28px; border-radius:8px;
  overflow:hidden; flex-shrink:0; background:rgba(4,209,255,0.1);
}
.blob-msg-av img { width:100%; height:100%; object-fit:cover; }
.blob-bubble {
  padding: 8px 12px; border-radius:12px;
  font-size:0.78rem; line-height:1.5; max-width:240px;
}
.blob-msg.bot  .blob-bubble {
  background:rgba(255,255,255,0.07); color:rgba(255,255,255,0.88);
  border-bottom-left-radius:3px; border:1px solid rgba(255,255,255,0.06);
}
.blob-msg.user .blob-bubble {
  background:linear-gradient(135deg,#04D1FF,#6366f1); color:white;
  border-bottom-right-radius:3px;
}
/* Typing dots */
.bd {
  display:inline-block; width:6px; height:6px; margin:0 2px;
  background:rgba(255,255,255,0.5); border-radius:50%;
  animation:blobBounce 1.2s ease-in-out infinite;
}
.bd:nth-child(2){animation-delay:.2s} .bd:nth-child(3){animation-delay:.4s}
@keyframes blobBounce { 0%,60%,100%{transform:translateY(0)} 30%{transform:translateY(-5px)} }

/* Chips */
#blob-chips {
  display:flex; flex-wrap:wrap; gap:6px; padding:0 12px 10px;
}
.blob-chip {
  background:rgba(4,209,255,0.08); border:1px solid rgba(4,209,255,0.25);
  color:#04D1FF; border-radius:9999px; padding:4px 12px;
  font-size:0.7rem; font-weight:600; cursor:pointer; white-space:nowrap;
  transition:background 0.15s, transform 0.1s;
}
.blob-chip:hover { background:rgba(4,209,255,0.18); transform:translateY(-1px); }

/* Input */
#blob-input-wrap {
  padding: 10px; border-top:1px solid rgba(255,255,255,0.06);
  display:flex; gap:8px; background:rgba(0,0,0,0.2);
}
#blob-input {
  flex:1; background:rgba(255,255,255,0.06);
  border:1px solid rgba(255,255,255,0.1); border-radius:10px;
  padding:8px 12px; color:white; font-size:0.78rem; outline:none;
  transition:border-color 0.15s; font-family:inherit;
}
#blob-input::placeholder { color:rgba(255,255,255,0.28); }
#blob-input:focus { border-color:rgba(4,209,255,0.4); }
#blob-send {
  width:34px; height:34px; background:linear-gradient(135deg,#04D1FF,#6366f1);
  border:none; border-radius:10px; color:white; cursor:pointer;
  display:flex; align-items:center; justify-content:center; font-size:0.95rem;
  transition:opacity 0.15s, transform 0.1s; flex-shrink:0;
}
#blob-send:hover { opacity:0.88; transform:scale(1.05); }

@media(max-width:480px){
  #blob-chat { width:calc(100vw - 2rem); right:-0.5rem; }
}
