/* Chatbot Variables */
#qf-chatbot-root {
  --cb-bg: rgba(13, 35, 57, 0.6); /* Deep navy glass */
  --cb-border: rgba(255, 255, 255, 0.1);
  --cb-primary: #2BBF8F;
  --cb-text: #F3F6F9;
  --cb-text-muted: #B2BAC2;
  --cb-msg-bot: rgba(255, 255, 255, 0.05);
  --cb-msg-user: rgba(43, 191, 143, 0.15);
  --cb-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
  --cb-radius: 16px;
  font-family: 'Inter', sans-serif;
}

/* Trigger Wrap */
.chatbot-trigger-wrap {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  z-index: 9999;
}

.chatbot-help-label {
  background: var(--cb-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--cb-border);
  color: var(--cb-text);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  transition: opacity 0.5s, transform 0.5s;
}

.chatbot-label-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
}

.chatbot-help-label__dot {
  width: 8px;
  height: 8px;
  background-color: var(--cb-primary);
  border-radius: 50%;
  animation: cb-pulse 2s infinite;
}

@keyframes cb-pulse {
  0% { box-shadow: 0 0 0 0 rgba(43, 191, 143, 0.4); }
  70% { box-shadow: 0 0 0 6px rgba(43, 191, 143, 0); }
  100% { box-shadow: 0 0 0 0 rgba(43, 191, 143, 0); }
}

.chatbot-trigger {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--cb-primary), #24A379);
  border: none;
  color: #000;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(43, 191, 143, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s;
}

.chatbot-trigger:hover {
  transform: scale(1.1);
}

/* Chat Window */
.chatbot-window {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 400px;
  max-width: calc(100vw - 32px);
  height: 600px;
  max-height: calc(100vh - 48px);
  background: var(--cb-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--cb-border);
  border-radius: var(--cb-radius);
  box-shadow: var(--cb-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 10000;
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.1);
  transform-origin: bottom right;
}

.chatbot-hidden {
  opacity: 0;
  transform: scale(0.8) translateY(20px);
  pointer-events: none;
}

/* Header */
.chatbot-header {
  padding: 16px;
  border-bottom: 1px solid var(--cb-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0,0,0,0.2);
}

.chatbot-header__left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chatbot-header__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--cb-primary);
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chatbot-header__title {
  color: var(--cb-text);
  font-weight: 600;
  font-size: 1rem;
}

.chatbot-header__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chatbot-header__btn {
  background: none;
  border: none;
  color: var(--cb-text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.chatbot-header__btn:hover {
  color: #fff;
}

/* Messages */
.chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.chatbot-messages::-webkit-scrollbar {
  width: 6px;
}
.chatbot-messages::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
}

.chatbot-msg-wrap {
  display: flex;
  flex-direction: column;
  max-width: 85%;
  animation: cb-fade-up 0.3s ease forwards;
}

@keyframes cb-fade-up {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

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

.chatbot-msg-wrap--user {
  align-self: flex-end;
}

.chatbot-msg {
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 0.9rem;
  line-height: 1.5;
}

.chatbot-msg--bot {
  background: var(--cb-msg-bot);
  color: var(--cb-text);
  border: 1px solid var(--cb-border);
  border-bottom-left-radius: 2px;
}

.chatbot-msg--user {
  background: var(--cb-msg-user);
  color: var(--cb-primary);
  border-bottom-right-radius: 2px;
}

.chatbot-msg a {
  display: inline-block;
  margin-top: 8px;
  color: var(--cb-primary);
  text-decoration: none;
  font-weight: 600;
}

.chatbot-msg a:hover {
  text-decoration: underline;
}

.chatbot-msg-time {
  font-size: 0.65rem;
  color: var(--cb-text-muted);
  margin-top: 6px;
  letter-spacing: 0.5px;
  margin-left: 4px;
}

/* Typing */
.chatbot-typing {
  display: flex;
  gap: 4px;
  padding: 12px 16px;
  background: var(--cb-msg-bot);
  border-radius: 12px;
  border-bottom-left-radius: 2px;
  border: 1px solid var(--cb-border);
  width: fit-content;
}

.chatbot-typing span {
  width: 6px;
  height: 6px;
  background: var(--cb-text-muted);
  border-radius: 50%;
  animation: cb-bounce 1.4s infinite ease-in-out both;
}

.chatbot-typing span:nth-child(1) { animation-delay: -0.32s; }
.chatbot-typing span:nth-child(2) { animation-delay: -0.16s; }

@keyframes cb-bounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

/* Quick Replies */
.chatbot-quick-replies {
  padding: 0 16px 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chatbot-qr-btn {
  background: transparent;
  border: 1px solid var(--cb-primary);
  color: var(--cb-primary);
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.chatbot-qr-btn:hover {
  background: rgba(43, 191, 143, 0.1);
}

/* Input Area */
.chatbot-input-area {
  padding: 12px 16px;
  border-top: 1px solid var(--cb-border);
  display: flex;
  gap: 12px;
  background: rgba(0,0,0,0.2);
}

.chatbot-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--cb-text);
  font-size: 0.95rem;
  outline: none;
}

.chatbot-input::placeholder {
  color: var(--cb-text-muted);
}

.chatbot-send-btn {
  background: var(--cb-primary);
  color: #000;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s;
}

.chatbot-send-btn:hover {
  transform: scale(1.05);
}
