﻿/* chatbot Block Styles */

/* ===== AI Chatbot Widget ===== */
.chatbot-widget {
  --cb-primary: #0d6efd;
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 3000;
  font-family: var(--font-sans);
}

.chatbot-toggle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: var(--cb-primary);
  color: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(0,0,0,0.18);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  z-index: 3001;
}

.chatbot-toggle:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 28px rgba(0,0,0,0.25);
}

.chatbot-toggle svg {
  width: 24px;
  height: 24px;
}

.chatbot-panel {
  position: fixed;
  bottom: 92px;
  right: 24px;
  width: 380px;
  max-width: calc(100vw - 48px);
  height: 520px;
  max-height: calc(100vh - 140px);
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.16);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px) scale(0.96);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
  z-index: 3000;
}

.chatbot-panel--open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.chatbot-header {
  background: var(--cb-primary);
  color: #ffffff;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.chatbot-header-title {
  font-weight: 650;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
}

.chatbot-close {
  background: none;
  border: none;
  color: #ffffff;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.8;
  transition: opacity 0.15s ease;
}

.chatbot-close:hover {
  opacity: 1;
  background: rgba(255,255,255,0.15);
}

.chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #f8fafc;
}

.chatbot-message {
  display: flex;
  gap: 8px;
  max-width: 90%;
  animation: chatbotFadeIn 0.3s ease;
}

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

.chatbot-message--user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.chatbot-message--bot {
  align-self: flex-start;
}

.chatbot-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--cb-primary);
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

.chatbot-bubble {
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 0.875rem;
  line-height: 1.5;
  word-break: break-word;
}

.chatbot-message--bot .chatbot-bubble {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  color: #1e293b;
  border-bottom-left-radius: 4px;
}

.chatbot-message--user .chatbot-bubble {
  background: var(--cb-primary);
  color: #ffffff;
  border-bottom-right-radius: 4px;
}

.chatbot-input-area {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid #e2e8f0;
  background: #ffffff;
  flex-shrink: 0;
}

.chatbot-input {
  flex: 1;
  border: 1px solid #e2e8f0;
  border-radius: 24px;
  padding: 10px 16px;
  font-size: 0.875rem;
  outline: none;
  background: #f8fafc;
  transition: border-color 0.2s ease;
}

.chatbot-input:focus {
  border-color: var(--cb-primary);
  background: #ffffff;
}

.chatbot-send {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--cb-primary);
  color: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s ease, transform 0.15s ease;
}

.chatbot-send:hover {
  filter: brightness(1.1);
  transform: scale(1.05);
}

.chatbot-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Typing indicator */
.chatbot-typing .chatbot-bubble {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 14px 16px;
}

.chatbot-typing .chatbot-bubble span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #94a3b8;
  animation: chatbotTyping 1.4s infinite ease-in-out;
}

.chatbot-typing .chatbot-bubble span:nth-child(2) { animation-delay: 0.2s; }
.chatbot-typing .chatbot-bubble span:nth-child(3) { animation-delay: 0.4s; }

@keyframes chatbotTyping {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-6px); opacity: 1; }
}

/* Preview placeholder */
.chatbot-preview-placeholder {
  margin: 0;
}

