/* Chatbot UI for Signify */
.chat-btn {
  width: 46px;
  height: 46px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, #5b6bff, #8b5cf6);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.chat-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 18px 40px rgba(91, 107, 255, 0.32);
}

.chatbot-widget {
  position: fixed;
  right: 22px;
  bottom: 22px;
  top: 90px;
  height: calc(100vh - 110px);
  width: min(100%, 380px);
  max-width: 380px;
  max-height: 600px;
  transform: translateY(32px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.3s ease, opacity 0.3s ease;
  z-index: 9999;
}

.chatbot-widget.open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.chatbot-card {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 520px;
  max-width: 380px;
  background: rgba(255, 255, 255, 0.98);
  border-radius: 32px;
  box-shadow: 0 40px 100px rgba(15, 23, 42, 0.18);
  overflow: hidden;
  border: 1px solid rgba(79, 70, 229, 0.12);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.chatbot-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 20px 20px 16px;
  background: linear-gradient(135deg, #4f46e5 0%, #8b5cf6 100%);
  color: #ffffff;
}

.chatbot-title {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 1.18rem;
  font-weight: 700;
  font-family: 'Poppins', 'Inter', system-ui, sans-serif;
  letter-spacing: -0.02em;
  color: #ffffff;
}

.chatbot-title .chat-icon {
  font-size: 1rem;
  color: #22d3ee;
}

.chatbot-title .accent {
  color: #22d3ee;
}

.chatbot-subtitle {
  margin: 6px 0 0;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.92);
  line-height: 1.5;
}

.chatbot-close {
  border: none;
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.1rem;
  display: grid;
  place-items: center;
  transition: transform 0.2s ease, background 0.2s ease;
}

.chatbot-close:hover {
  transform: scale(1.05);
  background: rgba(255, 255, 255, 0.24);
}

.chatbot-body {
  padding: 18px 18px 14px;
  display: grid;
  gap: 14px;
  background: #f8fafc;
  overflow-y: auto;
  scroll-behavior: smooth;
  min-height: 240px;
  max-height: calc(100vh - 220px);
  flex: 1;
}

.chatbot-message {
  max-width: 70%;
  min-width: 160px;
  width: fit-content;
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 16px 18px;
  border-radius: 18px;
  line-height: 1.65;
  font-size: 0.95rem;
  opacity: 0;
  animation: fadeIn 0.28s ease forwards;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.08);
  background-clip: padding-box;
  word-break: break-word;
}

.chatbot-message p {
  margin: 0;
  white-space: pre-wrap;
}

.chatbot-message.user {
  margin-left: auto;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: #ffffff;
  border-radius: 18px;
  border-bottom-right-radius: 6px;
  box-shadow: 0 20px 38px rgba(79, 70, 229, 0.16);
}

.chatbot-message.bot {
  margin-right: auto;
  background: #f8fafc;
  color: #111827;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 18px;
  border-bottom-left-radius: 6px;
}

.chat-media {
  width: 120px;
  max-width: 100%;
  border-radius: 10px;
  margin-top: 12px;
  display: block;
  box-shadow: 0 18px 28px rgba(15, 23, 42, 0.08);
  animation: scaleIn 0.35s ease forwards;
}

.chat-media-label {
  margin-top: 8px;
  font-size: 0.78rem;
  color: #52525b;
}

.chat-media-note {
  margin-top: 10px;
  font-size: 0.78rem;
  color: #6b7280;
  opacity: 0.88;
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.typing-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  border-radius: 20px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  font-size: 0.92rem;
  color: #6b7280;
  font-style: italic;
}

.typing-dot {
  width: 8px;
  height: 8px;
  background: #4f46e5;
  border-radius: 50%;
  animation: blink 1s infinite ease-in-out;
}

.typing-dot:nth-child(2) {
  animation-delay: 0.15s;
}

.typing-dot:nth-child(3) {
  animation-delay: 0.3s;
}

.chatbot-input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 16px 18px 18px;
  background: #ffffff;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
  flex-shrink: 0;
}

.chatbot-input {
  width: 100%;
  min-height: 50px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.55);
  background: #f8fafc;
  padding: 0 18px;
  font-size: 0.96rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.chatbot-input::placeholder {
  color: #94a3b8;
}

.chatbot-input:focus {
  border-color: #6366f1;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.14);
}

.chatbot-send {
  width: 56px;
  height: 56px;
  border: none;
  background: linear-gradient(135deg, #2563eb 0%, #22d3ee 100%);
  color: #ffffff;
  border-radius: 50%;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.chatbot-send svg {
  width: 20px;
  height: 20px;
  transform: translateX(1px);
}

.chatbot-send:hover {
  transform: scale(1.08);
  box-shadow: 0 16px 28px rgba(79, 70, 229, 0.25);
}

.chatbot-send:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes blink {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

@media (max-width: 420px) {
  .chatbot-widget {
    right: 14px;
    bottom: 14px;
    width: calc(100% - 28px);
  }
}
