/* ============================================================
   FDG Sales Chatbot — v3.0.0
   ============================================================ */

#fdg-chatbot-widget {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 99999;
  font-family: Arial, sans-serif;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

/* ── Toggle button ──────────────────────────────────────── */
#fdg-chatbot-toggle {
  width: 60px;
  height: 60px;
  border-radius: 999px;
  border: none;
  background: #1261a6;
  color: white;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  flex-shrink: 0;
}

#fdg-chatbot-toggle:hover {
  background: #0d4f8a;
}

.fdg-icon-close {
  font-size: 18px;
  font-style: normal;
}

/* ── Chat box ───────────────────────────────────────────── */
#fdg-chatbot-box {
  width: 340px;
  max-height: 520px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  margin-bottom: 12px;
  border: 1px solid #e5e7eb;
}

.fdg-hidden {
  display: none !important;
}

/* ── Header ─────────────────────────────────────────────── */
#fdg-chatbot-header {
  background: #1261a6;
  color: white;
  padding: 14px 16px;
  flex-shrink: 0;
}

#fdg-chatbot-header strong {
  display: block;
  font-size: 15px;
}

#fdg-chatbot-header span {
  display: block;
  font-size: 11px;
  margin-top: 3px;
  opacity: 0.85;
}

/* ── Messages area ──────────────────────────────────────── */
#fdg-chatbot-messages {
  flex: 1;
  padding: 14px;
  overflow-y: auto;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
}

.fdg-message {
  max-width: 85%;
  padding: 9px 12px;
  margin-bottom: 8px;
  border-radius: 12px;
  font-size: 13.5px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.fdg-message.bot {
  background: #ffffff;
  color: #111827;
  border: 1px solid #e5e7eb;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.fdg-message.user {
  background: #1261a6;
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

/* ── Typing indicator ───────────────────────────────────── */
.fdg-typing {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 12px 14px !important;
}

.fdg-dot {
  width: 7px;
  height: 7px;
  background: #9ca3af;
  border-radius: 50%;
  display: inline-block;
  animation: fdg-bounce 1.2s infinite ease-in-out;
}

.fdg-dot:nth-child(2) { animation-delay: 0.2s; }
.fdg-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes fdg-bounce {
  0%, 80%, 100% { transform: translateY(0); }
  40%            { transform: translateY(-5px); }
}

/* ── Quick replies ──────────────────────────────────────── */
#fdg-chatbot-quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 12px 10px;
  background: #f8fafc;
}

.fdg-qr-btn {
  background: white;
  border: 1px solid #1261a6;
  color: #1261a6;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.fdg-qr-btn:hover {
  background: #1261a6;
  color: white;
}

/* ── Input area ─────────────────────────────────────────── */
#fdg-chatbot-input-area {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid #e5e7eb;
  background: white;
  flex-shrink: 0;
}

#fdg-chatbot-input {
  flex: 1;
  padding: 9px 12px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  outline: none;
  font-size: 13.5px;
  transition: border-color 0.2s;
}

#fdg-chatbot-input:focus {
  border-color: #1261a6;
}

#fdg-chatbot-send {
  background: #1261a6;
  color: white;
  border: none;
  padding: 9px 14px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 15px;
  transition: background 0.2s;
  flex-shrink: 0;
}

#fdg-chatbot-send:hover {
  background: #0d4f8a;
}

#fdg-chatbot-send:disabled,
#fdg-chatbot-input:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* ── Mobile ─────────────────────────────────────────────── */
@media (max-width: 400px) {
  #fdg-chatbot-box {
    width: calc(100vw - 32px);
  }
}
