/* Floating AI Chatbot Widget Styles */
.ai-widget-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

/* Floating Trigger Button */
.ai-widget-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #18181b, #2563eb);
  color: #fff;
  border: none;
  border-radius: 9999px;
  padding: 10px 20px 10px 12px;
  box-shadow: 0 10px 25px -5px rgba(37, 99, 235, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.ai-widget-btn:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 15px 30px -5px rgba(37, 99, 235, 0.5);
}

.bot-avatar-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #9333ea);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  color: #fff;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3);
}

.widget-label {
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: -0.2px;
}

.widget-pulse {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 10px;
  height: 10px;
  background: #22c55e;
  border-radius: 50%;
  border: 2px solid #fff;
}

/* Chat Window */
.ai-chat-window {
  position: fixed;
  bottom: 86px;
  right: 24px;
  width: 380px;
  height: 580px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 110px);
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 20px 40px -10px rgba(15, 23, 42, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.95);
  transform-origin: bottom right;
  transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1000;
}

.ai-chat-window.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* Chat Header */
.chat-header {
  background: #0f172a;
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #1e293b;
}

.chat-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-avatar-wrapper {
  position: relative;
}

.bot-avatar-inner {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1rem;
}

.online-indicator {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 10px;
  height: 10px;
  background: #22c55e;
  border-radius: 50%;
  border: 2px solid #0f172a;
}

.bot-name {
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.2;
}

.bot-status {
  font-size: 0.72rem;
  color: #38bdf8;
  display: block;
}

.chat-header-actions {
  display: flex;
  gap: 6px;
}

.header-icon-btn {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #cbd5e1;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  transition: all 0.2s;
}

.header-icon-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

/* Quick Prompts Bar */
.quick-prompts-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  overflow-x: auto;
  scrollbar-width: none;
}
.quick-prompts-bar::-webkit-scrollbar {
  display: none;
}

.quick-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  flex-shrink: 0;
}

.quick-chip {
  background: #fff;
  border: 1px solid #cbd5e1;
  color: #334155;
  font-size: 0.76rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 9999px;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.quick-chip:hover {
  background: #eff6ff;
  border-color: #3b82f6;
  color: #2563eb;
}

/* Chat Messages Stream */
.chat-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  background: #f1f5f9;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.chat-bubble {
  max-width: 82%;
  display: flex;
  flex-direction: column;
}

.chat-bubble.bot-msg {
  align-self: flex-start;
}

.chat-bubble.user-msg {
  align-self: flex-end;
}

.bubble-content {
  padding: 11px 15px;
  border-radius: 16px;
  font-size: 0.88rem;
  line-height: 1.5;
  word-break: break-word;
}

.bot-msg .bubble-content {
  background: #ffffff;
  color: #1e293b;
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  border: 1px solid #e2e8f0;
}

.bot-msg .bubble-content p {
  margin-bottom: 6px;
}
.bot-msg .bubble-content p:last-child {
  margin-bottom: 0;
}

.bot-msg .bubble-content ul {
  padding-left: 18px;
  margin: 6px 0;
}

.user-msg .bubble-content {
  background: #2563eb;
  color: #ffffff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 2px 5px rgba(37, 99, 235, 0.3);
}

.bubble-time {
  font-size: 0.68rem;
  color: #94a3b8;
  margin-top: 4px;
  padding: 0 4px;
}

.user-msg .bubble-time {
  text-align: right;
}

/* Typing Indicator Animation */
.typing-bubble {
  align-self: flex-start;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 12px 18px;
  background: #ffffff;
  border-radius: 16px;
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  border: 1px solid #e2e8f0;
}

.typing-dot {
  width: 7px;
  height: 7px;
  background: #94a3b8;
  border-radius: 50%;
  animation: bounceDot 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }
.typing-dot:nth-child(3) { animation-delay: 0s; }

@keyframes bounceDot {
  0%, 80%, 100% { transform: scale(0); opacity: 0.5; }
  40% { transform: scale(1); opacity: 1; }
}

/* Chat Input Bar */
.chat-input-area {
  padding: 10px 14px;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-input-area input {
  flex: 1;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  border-radius: 9999px;
  padding: 10px 16px;
  font-size: 0.88rem;
  outline: none;
  transition: all 0.2s;
}

.chat-input-area input:focus {
  border-color: #2563eb;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.send-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #2563eb;
  color: #ffffff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  transition: all 0.2s;
  flex-shrink: 0;
}

.send-btn:hover {
  background: #1d4ed8;
  transform: scale(1.05);
}

.send-btn:disabled {
  background: #cbd5e1;
  cursor: not-allowed;
  transform: none;
}

