/* ── Quiru Chatbot Widget ───────────────────────────────────────────────── */

#quiru-launcher {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  font-family: 'Inter', system-ui, sans-serif;
}

/* Bubble button */
#quiru-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #E63946;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(230,57,70,0.45);
  transition: transform .2s, box-shadow .2s;
  flex-shrink: 0;
}
#quiru-btn:hover { transform: scale(1.08); box-shadow: 0 6px 24px rgba(230,57,70,0.55); }
#quiru-btn svg { pointer-events: none; }
#quiru-btn .quiru-close-icon { display: none; }
#quiru-btn.open .quiru-chat-icon  { display: none; }
#quiru-btn.open .quiru-close-icon { display: block; }

/* Unread badge */
#quiru-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 18px;
  height: 18px;
  background: #555555;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
}

/* Chat window */
#quiru-window {
  width: 360px;
  max-height: 520px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform-origin: bottom right;
  transform: scale(0.85);
  opacity: 0;
  pointer-events: none;
  transition: transform .2s cubic-bezier(.34,1.56,.64,1), opacity .15s;
}
#quiru-window.open {
  transform: scale(1);
  opacity: 1;
  pointer-events: auto;
}

/* Header */
#quiru-header {
  background: #E63946;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.quiru-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  color: #fff;
  flex-shrink: 0;
}
.quiru-header-info { flex: 1 }
.quiru-header-name { color: #fff; font-weight: 600; font-size: 14px; line-height: 1.2 }
.quiru-header-status { color: rgba(255,255,255,0.8); font-size: 11px; display: flex; align-items: center; gap: 4px }
.quiru-status-dot { width: 7px; height: 7px; background: #4ade80; border-radius: 50%; }

/* Messages */
#quiru-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
}
#quiru-messages::-webkit-scrollbar { width: 4px }
#quiru-messages::-webkit-scrollbar-track { background: transparent }
#quiru-messages::-webkit-scrollbar-thumb { background: #e2e2e2; border-radius: 4px }

.quiru-msg {
  max-width: 82%;
  padding: 10px 13px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.55;
  word-break: break-word;
}
.quiru-msg.bot {
  background: #f3f4f6;
  color: #1a1c1c;
  border-bottom-left-radius: 4px;
  align-self: flex-start;
}
.quiru-msg.bot strong {
  font-weight: 700;
  color: #E63946;
}
.quiru-msg.bot em {
  font-style: italic;
  color: #555;
}
.quiru-msg.user {
  background: #2d2d2d;
  color: #fff;
  border-bottom-right-radius: 4px;
  align-self: flex-end;
}

/* CTA buttons inside chat */
.quiru-cta-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-self: flex-start;
  max-width: 82%;
}
.quiru-cta-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: opacity .15s;
}
.quiru-cta-btn:hover { opacity: .85 }
.quiru-cta-btn--form { background: #2d2d2d; color: #fff; }
.quiru-cta-btn--wa   { background: #555555; color: #fff; }

/* Typing indicator */
.quiru-typing {
  display: flex;
  gap: 4px;
  padding: 12px 14px;
  background: #f3f4f6;
  border-radius: 14px;
  border-bottom-left-radius: 4px;
  align-self: flex-start;
  width: fit-content;
}
.quiru-typing span {
  width: 7px;
  height: 7px;
  background: #9ca3af;
  border-radius: 50%;
  animation: quiruBounce 1.2s infinite;
}
.quiru-typing span:nth-child(2) { animation-delay: .15s }
.quiru-typing span:nth-child(3) { animation-delay: .3s }
@keyframes quiruBounce {
  0%,60%,100% { transform: translateY(0) }
  30%          { transform: translateY(-6px) }
}

/* Input area */
#quiru-form {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid #f0f0f0;
  flex-shrink: 0;
  background: #fff;
}
#quiru-input {
  flex: 1;
  border: 1px solid #e2e2e2;
  border-radius: 22px;
  padding: 9px 14px;
  font-size: 13.5px;
  font-family: inherit;
  outline: none;
  resize: none;
  line-height: 1.4;
  max-height: 80px;
  overflow-y: auto;
  transition: border-color .15s;
}
#quiru-input:focus { border-color: #2d2d2d; }
#quiru-send {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #2d2d2d;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .15s;
}
#quiru-send:hover { background: #1a1a1a; }
#quiru-send:disabled { background: #c0c7d2; cursor: default; }

#quiru-footer {
  text-align: center;
  font-size: 10px;
  color: #9ca3af;
  padding: 4px 0 8px;
  flex-shrink: 0;
}

@media (max-width: 480px) {
  #quiru-window { width: calc(100vw - 24px); }
  #quiru-launcher { right: 12px; bottom: 12px; }
}
