/* ─────────────────────────────────────────────
   Quifabra Chatbot Widget Styles
   ───────────────────────────────────────────── */

/* ── Floating Buttons Container ── */
.qf-chat-launcher {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

/* WhatsApp button sits separately on the LEFT side */
.qf-phone-wrap {
  position: fixed;
  bottom: 28px;
  left: 28px;
  z-index: 9999;
}

/* ── Phone Button ── */
.qf-phone-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #25D366;
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(37, 211, 102, 0.5);
  transition: transform 0.2s, box-shadow 0.2s;
  text-decoration: none;
}
.qf-phone-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 24px rgba(37, 211, 102, 0.65);
}
.qf-phone-btn svg { width: 24px; height: 24px; }

/* ── Chat Toggle Button ── */
.qf-chat-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1E96C8 0%, #0e6fa0 100%);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(30, 150, 200, 0.55);
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
}
.qf-chat-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 28px rgba(30, 150, 200, 0.7);
}
.qf-chat-btn svg { width: 28px; height: 28px; }
.qf-chat-btn .qf-close-icon { display: none; }
.qf-chat-btn.open .qf-open-icon { display: none; }
.qf-chat-btn.open .qf-close-icon { display: flex; }

/* ── Notification Badge ── */
.qf-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 20px;
  height: 20px;
  background: #FF5A5A;
  color: white;
  font-size: 12px;
  font-weight: 700;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: qf-pulse 2s infinite;
}

@keyframes qf-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

/* ── Chat Window ── */
.qf-chat-window {
  position: fixed;
  bottom: 108px;
  right: 28px;
  width: 360px;
  max-height: 500px;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 9998;
  transform: scale(0.85) translateY(20px);
  opacity: 0;
  pointer-events: none;
  transform-origin: bottom right;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s;
}

.qf-chat-window.open {
  transform: scale(1) translateY(0);
  opacity: 1;
  pointer-events: all;
}

/* ── Chat Header ── */
.qf-chat-header {
  background: linear-gradient(135deg, #1E96C8 0%, #0e6fa0 100%);
  color: white;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.qf-chat-header-avatar {
  width: 40px;
  height: 40px;
  background: rgba(255,255,255,0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.qf-chat-header-avatar svg { width: 22px; height: 22px; }
.qf-chat-header-info { flex: 1; }
.qf-chat-header-name {
  font-weight: 700;
  font-size: 0.95rem;
  margin: 0;
  line-height: 1.2;
}
.qf-chat-header-status {
  font-size: 0.73rem;
  opacity: 0.85;
  display: flex;
  align-items: center;
  gap: 4px;
}
.qf-status-dot {
  width: 8px;
  height: 8px;
  background: #4ade80;
  border-radius: 50%;
  display: inline-block;
  animation: qf-pulse 2s infinite;
}

/* ── Messages Area ── */
.qf-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f7f8fa;
  max-height: 320px;
}

.qf-msg {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 0.875rem;
  line-height: 1.45;
  animation: qf-msg-in 0.2s ease;
}

@keyframes qf-msg-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.qf-msg--bot {
  background: #fff;
  color: #1e293b;
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.07);
  align-self: flex-start;
}
.qf-msg--user {
  background: linear-gradient(135deg, #1E96C8 0%, #0e6fa0 100%);
  color: white;
  border-bottom-right-radius: 4px;
  align-self: flex-end;
}

/* ── Quick Reply Chips ── */
.qf-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px 16px 8px;
  background: #f7f8fa;
}
.qf-chip {
  padding: 6px 14px;
  background: white;
  border: 1.5px solid #1E96C8;
  color: #1E96C8;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: 0.15s;
}
.qf-chip:hover {
  background: #1E96C8;
  color: white;
}

/* ── Input Area ── */
.qf-chat-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid #e8ecf0;
  background: #fff;
}
.qf-chat-input {
  flex: 1;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 8px 14px;
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.2s;
  font-family: inherit;
}
.qf-chat-input:focus { border-color: #1E96C8; }
.qf-chat-send {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #1E96C8;
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s;
}
.qf-chat-send:hover { background: #0e6fa0; }
.qf-chat-send svg { width: 18px; height: 18px; }

/* ── Typing Indicator ── */
.qf-typing {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
  background: #fff;
  border-radius: 16px;
  border-bottom-left-radius: 4px;
  align-self: flex-start;
  box-shadow: 0 1px 4px rgba(0,0,0,0.07);
  width: fit-content;
}
.qf-typing span {
  width: 7px;
  height: 7px;
  background: #94a3b8;
  border-radius: 50%;
  animation: qf-bounce 1.2s infinite;
}
.qf-typing span:nth-child(2) { animation-delay: 0.2s; }
.qf-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes qf-bounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-6px); }
}

/* ── Responsive ── */
@media (max-width: 480px) {
  .qf-chat-window {
    right: 10px;
    bottom: 95px;
    width: calc(100vw - 20px);
  }
  .qf-chat-launcher {
    right: 16px;
    bottom: 16px;
  }
}
