/* ============================================
   HELP CHATBOT WIDGET - help-widget.css
   Version: 20260322d
   ============================================ */

/* --- FAB Button --- */
.help-fab {
  position: fixed;
  bottom: 90px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, box-shadow 0.2s;
}
.help-fab:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.5);
}
.help-fab:active { transform: scale(0.96); }
.help-fab svg { width: 26px; height: 26px; fill: currentColor; }
.help-fab .fab-close { display: none; }
.help-fab.open .fab-chat { display: none; }
.help-fab.open .fab-close { display: block; }

/* --- Unread Badge --- */
.help-fab-badge {
  position: absolute;
  top: -2px; right: -2px;
  width: 18px; height: 18px;
  background: #ef4444;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
}
.help-fab-badge[hidden] { display: none !important; }

/* --- Chat Panel --- */
.help-panel {
  position: fixed;
  bottom: 158px;
  right: 24px;
  width: 380px;
  max-height: 520px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.15);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.9) translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.help-panel.open {
  transform: scale(1) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

/* --- Panel Header --- */
.help-panel-header {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #fff;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.help-panel-avatar {
  width: 36px; height: 36px;
  background: rgba(255,255,255,0.2);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}
.help-panel-title { font-size: 15px; font-weight: 600; }
.help-panel-subtitle { font-size: 12px; opacity: 0.85; }

/* --- Messages Area --- */
.help-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 200px;
  max-height: 320px;
}

/* --- Message Bubbles --- */
.help-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13.5px;
  line-height: 1.6;
  word-break: break-word;
  white-space: pre-wrap;
}
.help-msg.bot {
  background: #f1f5f9;
  color: #1e293b;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}
.help-msg.user {
  background: #2563eb;
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

/* --- FAQ Quick Buttons --- */
.help-faq-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.help-faq-btn {
  background: #fff;
  border: 1px solid #dbeafe;
  border-radius: 20px;
  padding: 6px 12px;
  font-size: 12.5px;
  color: #2563eb;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.help-faq-btn:hover {
  background: #eff6ff;
  border-color: #93c5fd;
}

/* --- Category Tabs --- */
.help-category-tabs {
  display: flex;
  gap: 4px;
  padding: 8px 16px 0;
  border-bottom: 1px solid #e2e8f0;
  overflow-x: auto;
  scrollbar-width: none;
}
.help-category-tabs::-webkit-scrollbar { display: none; }
.help-cat-tab {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  color: #64748b;
  border: none;
  background: none;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
}
.help-cat-tab:hover { color: #2563eb; }
.help-cat-tab.active {
  color: #2563eb;
  border-bottom-color: #2563eb;
}

/* --- Typing Indicator --- */
.help-typing {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 10px 14px;
  background: #f1f5f9;
  border-radius: 12px;
  border-bottom-left-radius: 4px;
  align-self: flex-start;
  width: 52px;
}
.help-typing span {
  width: 6px; height: 6px;
  background: #94a3b8;
  border-radius: 50%;
  animation: helpTypingBounce 1.2s ease-in-out infinite;
}
.help-typing span:nth-child(2) { animation-delay: 0.15s; }
.help-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes helpTypingBounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-4px); }
}

/* --- Input Area --- */
.help-input-area {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
}
.help-input {
  flex: 1;
  border: 1px solid #d1d5db;
  border-radius: 20px;
  padding: 8px 14px;
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.15s;
  font-family: inherit;
}
.help-input:focus { border-color: #2563eb; }
.help-input::placeholder { color: #9ca3af; }
.help-send-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: #2563eb;
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  flex-shrink: 0;
}
.help-send-btn:hover { background: #1d4ed8; }
.help-send-btn:disabled { background: #93c5fd; cursor: not-allowed; }
.help-send-btn svg { width: 16px; height: 16px; fill: currentColor; }

/* --- Powered By Footer --- */
.help-footer {
  text-align: center;
  padding: 6px;
  font-size: 10.5px;
  color: #94a3b8;
  background: #f8fafc;
  border-top: 1px solid #f1f5f9;
}

/* --- Mobile Responsive --- */
@media (max-width: 767px) {
  .help-panel {
    right: 8px;
    left: 8px;
    bottom: 144px;
    width: auto;
    max-height: 70vh;
  }
  .help-fab {
    bottom: 80px;
    right: 16px;
    width: 50px;
    height: 50px;
  }
  .help-fab svg { width: 22px; height: 22px; }
  .help-messages { max-height: 45vh; }
}
