/**
 * Pixel Media Services - Floating Chatbot Stylesheet
 */

.pms-chatbot-widget {
  position: fixed;
  bottom: 24px;
  right: 90px; /* Sits cleanly next to WhatsApp floater */
  z-index: 99990;
  font-family: var(--pms-font-sans, system-ui, sans-serif);
}

.pms-chatbot-toggle-btn {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--pms-primary, #1e3a8a), var(--pms-secondary, #0284c7));
  color: #ffffff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 25px -5px rgba(30, 58, 138, 0.35);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.pms-chatbot-toggle-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 15px 30px -5px rgba(30, 58, 138, 0.45);
}

.pms-chatbot-window {
  position: absolute;
  bottom: 68px;
  right: 0;
  width: 360px;
  max-width: calc(100vw - 32px);
  height: 520px;
  max-height: calc(100vh - 120px);
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 20px 35px -10px rgba(15, 23, 42, 0.25);
  border: 1px solid var(--pms-border-color, #e2e8f0);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: pmsChatSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.chatbot-header {
  background: linear-gradient(135deg, var(--pms-primary, #1e3a8a), #1e40af);
  color: #ffffff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chatbot-header-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chatbot-avatar-mark {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: #10b981;
  box-shadow: 0 0 8px #10b981;
}

.chatbot-name {
  display: block;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
}

.chatbot-status-indicator {
  font-size: 11px;
  opacity: 0.85;
}

.chatbot-close-btn {
  background: none;
  border: none;
  color: #ffffff;
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
}

/* Messages Stream */
.chatbot-messages-stream {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background-color: #f8fafc;
}

.chat-bubble {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13.5px;
  line-height: 1.5;
  word-wrap: break-word;
}

.chat-bubble-bot {
  align-self: flex-start;
  background-color: #ffffff;
  color: #0f172a;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.chat-bubble-user {
  align-self: flex-end;
  background-color: var(--pms-primary, #1e3a8a);
  color: #ffffff;
}

.chat-cta-link {
  display: inline-block;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--pms-secondary, #0284c7);
  text-decoration: underline;
}

.chat-typing span {
  animation: blink 1.4s infinite both;
  display: inline-block;
  font-size: 20px;
  line-height: 10px;
  margin-right: 2px;
}
.chat-typing span:nth-child(2) { animation-delay: .2s; }
.chat-typing span:nth-child(3) { animation-delay: .4s; }

@keyframes blink {
  0% { opacity: .2; }
  20% { opacity: 1; }
  100% { opacity: .2; }
}

/* Quick Replies */
.chatbot-quick-replies-area {
  padding: 8px 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
  max-height: 110px;
  overflow-y: auto;
}

.chat-quick-btn {
  background: #eff6ff;
  color: var(--pms-primary, #1e3a8a);
  border: 1px solid #bfdbfe;
  padding: 5px 10px;
  border-radius: 9999px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.chat-quick-btn:hover {
  background: var(--pms-primary, #1e3a8a);
  color: #ffffff;
}

/* Input Bar */
.chatbot-input-bar {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border-top: 1px solid #e2e8f0;
  background-color: #ffffff;
}

.chatbot-input-bar input {
  flex: 1;
  border: 1px solid #cbd5e1;
  border-radius: 20px;
  padding: 8px 14px;
  font-size: 13px;
  outline: none;
}

.chatbot-input-bar input:focus {
  border-color: var(--pms-primary, #1e3a8a);
}

.chatbot-send-btn {
  background: var(--pms-primary, #1e3a8a);
  color: #ffffff;
  border: none;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 8px;
  cursor: pointer;
  transition: background 0.2s;
}

.chatbot-send-btn:hover {
  background: #172554;
}

/* Mobile Friendly */
@media (max-width: 480px) {
  .pms-chatbot-widget {
    right: 76px;
    bottom: 16px;
  }
  .pms-chatbot-window {
    width: calc(100vw - 24px);
    height: 480px;
    right: -60px;
  }
}
