/* ==========================================================================
   LISTIFY PR - AI CHATBOT AGENT STYLES
   Floating Glassmorphism UI, Pulse Animations, & Message Stream
   ========================================================================== */

/* 1. Floating Launcher Button */
.listify-chatbot-launcher {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99999;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  outline: none;
  border: none;
  background: transparent;
  padding: 0;
  font-family: var(--font-main, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
}

.listify-chatbot-teaser {
  background: rgba(14, 20, 32, 0.95);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #f8fafc;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(10px);
  white-space: nowrap;
  animation: floatTeaser 3s ease-in-out infinite alternate;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.listify-chatbot-teaser span.sparkle {
  color: #10b981;
}

@keyframes floatTeaser {
  0% { transform: translateY(0); }
  100% { transform: translateY(-4px); }
}

.listify-chatbot-btn {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 10px 25px rgba(16, 185, 129, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.2);
  position: relative;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease;
}

.listify-chatbot-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 14px 30px rgba(16, 185, 129, 0.6), 0 0 0 2px rgba(255, 255, 255, 0.4);
}

.listify-chatbot-pulse {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 50%;
  border: 2px solid #10b981;
  animation: chatbotRing 2s cubic-bezier(0.25, 0.1, 0.25, 1) infinite;
  pointer-events: none;
}

@keyframes chatbotRing {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(1.6); opacity: 0; }
}

.listify-chatbot-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 18px;
  height: 18px;
  background: #ef4444;
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 800;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #090d16;
}

/* 2. Chat Modal / Window */
.listify-chatbot-panel {
  position: fixed;
  bottom: 96px;
  right: 24px;
  width: 390px;
  max-width: calc(100vw - 32px);
  height: 580px;
  max-height: calc(100vh - 120px);
  background: rgba(11, 16, 27, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 99999;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(20px) scale(0.95);
  transform-origin: bottom right;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.25s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0.25s;
  font-family: var(--font-main, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
}

.listify-chatbot-panel.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

/* Header */
.listify-chat-header {
  padding: 16px 20px;
  background: rgba(17, 24, 39, 0.8);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.listify-chat-agent-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.listify-chat-avatar {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(6, 182, 212, 0.2));
  border: 1px solid rgba(16, 185, 129, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #10b981;
  font-size: 1.1rem;
}

.listify-chat-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 6px;
}

.listify-chat-status {
  font-size: 0.75rem;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 6px;
}

.listify-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  display: inline-block;
  box-shadow: 0 0 6px #10b981;
}

.listify-chat-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.listify-chat-control-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.listify-chat-control-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

/* Quick Action Chips */
.listify-chat-chips {
  padding: 10px 16px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  background: rgba(14, 20, 32, 0.5);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  flex-shrink: 0;
}

.listify-chat-chips::-webkit-scrollbar {
  display: none;
}

.listify-chip-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s ease;
}

.listify-chip-btn:hover {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.4);
  color: #ffffff;
  transform: translateY(-1px);
}

/* Message Stream */
.listify-chat-messages {
  flex: 1;
  padding: 18px 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.listify-chat-msg {
  display: flex;
  flex-direction: column;
  max-width: 86%;
  font-size: 0.9rem;
  line-height: 1.5;
  animation: fadeInMsg 0.2s ease forwards;
}

@keyframes fadeInMsg {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.listify-chat-msg.bot {
  align-self: flex-start;
}

.listify-chat-msg.user {
  align-self: flex-end;
}

.listify-msg-bubble {
  padding: 12px 16px;
  border-radius: 14px;
  position: relative;
  word-break: break-word;
}

.listify-chat-msg.bot .listify-msg-bubble {
  background: #141c2c;
  color: #f1f5f9;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom-left-radius: 4px;
}

.listify-chat-msg.user .listify-msg-bubble {
  background: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
  color: #ffffff;
  font-weight: 500;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.listify-msg-time {
  font-size: 0.7rem;
  color: #64748b;
  margin-top: 4px;
  align-self: flex-end;
}

.listify-chat-msg.bot .listify-msg-time {
  align-self: flex-start;
}

/* Markdown lists & highlight inside bot messages */
.listify-msg-bubble strong {
  color: #ffffff;
  font-weight: 700;
}

.listify-msg-bubble p {
  margin: 0 0 8px 0;
}

.listify-msg-bubble p:last-child {
  margin-bottom: 0;
}

.listify-msg-bubble ul {
  margin: 6px 0 8px 18px;
  padding: 0;
}

.listify-msg-bubble li {
  margin-bottom: 4px;
  color: #cbd5e1;
}

/* Inline Action Button in Messages */
.listify-msg-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 8px 14px;
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.listify-msg-action-btn:hover {
  background: #10b981;
  color: #090d16;
}

/* Typing Indicator */
.listify-typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px 16px;
  background: #141c2c;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  border-bottom-left-radius: 4px;
  width: fit-content;
  align-self: flex-start;
}

.listify-typing-dot {
  width: 6px;
  height: 6px;
  background: #10b981;
  border-radius: 50%;
  animation: typingBounce 1.4s infinite ease-in-out both;
}

.listify-typing-dot:nth-child(1) { animation-delay: -0.32s; }
.listify-typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingBounce {
  0%, 80%, 100% { transform: scale(0); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

/* Footer / Input Area */
.listify-chat-input-bar {
  padding: 14px 16px;
  background: rgba(17, 24, 39, 0.95);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 10px;
}

.listify-chat-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 11px 16px;
  font-size: 0.88rem;
  color: #ffffff;
  outline: none;
  transition: all 0.2s ease;
}

.listify-chat-input:focus {
  border-color: #10b981;
  background: rgba(255, 255, 255, 0.09);
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.listify-chat-send-btn {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--gradient-primary, linear-gradient(135deg, #10b981 0%, #06b6d4 100%));
  border: none;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.listify-chat-send-btn:hover {
  transform: scale(1.06);
}

.listify-chat-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}
