/* ══════════════════════════════════════════════════════════════════════════════
   GLOBAL FLOATING FAQ WIDGET
   A floating help button that opens a searchable FAQ panel
   ══════════════════════════════════════════════════════════════════════════════ */

/* ── FLOATING BUTTON ── */
.faq-widget-btn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 9998;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(139, 92, 246, 0.4), 0 0 0 0 rgba(139, 92, 246, 0.4);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  animation: faqWidgetPulse 2s ease-in-out infinite;
}

.faq-widget-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 30px rgba(139, 92, 246, 0.5);
}

.faq-widget-btn.active {
  animation: none;
  transform: rotate(45deg);
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.faq-widget-btn i {
  font-size: 24px;
  color: #fff;
  transition: transform 0.3s ease;
}

.faq-widget-btn.active i {
  transform: rotate(-45deg);
}

@keyframes faqWidgetPulse {
  0%, 100% { box-shadow: 0 4px 20px rgba(139, 92, 246, 0.4), 0 0 0 0 rgba(139, 92, 246, 0.4); }
  50% { box-shadow: 0 4px 20px rgba(139, 92, 246, 0.4), 0 0 0 12px rgba(139, 92, 246, 0); }
}

/* ── PANEL ── */
.faq-widget-panel {
  position: fixed;
  bottom: 100px;
  right: 30px;
  z-index: 9997;
  width: 380px;
  max-width: calc(100vw - 40px);
  max-height: 500px;
  background: rgba(26, 36, 33, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(139, 92, 246, 0.2);
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.95);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
}

.faq-widget-panel.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* ── PANEL HEADER ── */
.faq-widget-header {
  padding: 18px 20px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.15) 0%, rgba(99, 102, 241, 0.1) 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 12px;
}

.faq-widget-header-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.faq-widget-header-icon i {
  font-size: 18px;
  color: #fff;
}

.faq-widget-header-text h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
}

.faq-widget-header-text p {
  margin: 2px 0 0;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
}

/* ── SEARCH ── */
.faq-widget-search {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.faq-widget-search input {
  width: 100%;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #fff;
  font-size: 0.85rem;
  font-family: inherit;
  outline: none;
  transition: all 0.2s ease;
}

.faq-widget-search input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.faq-widget-search input:focus {
  border-color: rgba(139, 92, 246, 0.5);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

/* ── FAQ LIST ── */
.faq-widget-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(139, 92, 246, 0.3) transparent;
}

.faq-widget-list::-webkit-scrollbar {
  width: 6px;
}

.faq-widget-list::-webkit-scrollbar-track {
  background: transparent;
}

.faq-widget-list::-webkit-scrollbar-thumb {
  background: rgba(139, 92, 246, 0.3);
  border-radius: 3px;
}

.faq-widget-list::-webkit-scrollbar-thumb:hover {
  background: rgba(139, 92, 246, 0.5);
}

/* ── FAQ ITEM ── */
.faq-widget-item {
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.faq-widget-item:last-child {
  border-bottom: none;
}

.faq-widget-question {
  width: 100%;
  padding: 14px 16px;
  background: transparent;
  border: none;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  transition: background 0.2s ease;
}

.faq-widget-question:hover {
  background: rgba(139, 92, 246, 0.08);
}

.faq-widget-question-icon {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: rgba(139, 92, 246, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.faq-widget-question-icon i {
  font-size: 10px;
  color: #8b5cf6;
  transition: transform 0.2s ease;
}

.faq-widget-item.open .faq-widget-question-icon {
  background: rgba(139, 92, 246, 0.25);
}

.faq-widget-item.open .faq-widget-question-icon i {
  transform: rotate(180deg);
}

.faq-widget-question-text {
  flex: 1;
  font-size: 0.85rem;
  font-weight: 500;
  color: #fff;
  line-height: 1.4;
}

/* ── FAQ ANSWER ── */
.faq-widget-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.faq-widget-item.open .faq-widget-answer {
  max-height: 300px;
}

.faq-widget-answer-inner {
  padding: 0 16px 14px 52px;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.6;
}

/* ── CATEGORY TAG ── */
.faq-widget-category {
  display: inline-block;
  padding: 3px 8px;
  margin-bottom: 6px;
  background: rgba(139, 92, 246, 0.15);
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 600;
  color: #8b5cf6;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ── EMPTY STATE ── */
.faq-widget-empty {
  padding: 40px 20px;
  text-align: center;
  color: rgba(255, 255, 255, 0.5);
}

.faq-widget-empty i {
  font-size: 32px;
  margin-bottom: 12px;
  opacity: 0.5;
}

.faq-widget-empty p {
  margin: 0;
  font-size: 0.85rem;
}

/* ── FOOTER LINK ── */
.faq-widget-footer {
  padding: 12px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  text-align: center;
}

.faq-widget-footer a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #8b5cf6;
  text-decoration: none;
  transition: color 0.2s ease;
}

.faq-widget-footer a:hover {
  color: #a78bfa;
}

.faq-widget-footer a i {
  font-size: 0.7rem;
}

/* ── MOBILE RESPONSIVE ── */
@media (max-width: 480px) {
  .faq-widget-btn {
    bottom: 20px;
    right: 20px;
    width: 54px;
    height: 54px;
  }

  .faq-widget-btn i {
    font-size: 20px;
  }

  .faq-widget-panel {
    bottom: 85px;
    right: 15px;
    left: 15px;
    width: auto;
    max-height: 70vh;
  }

  .faq-widget-header {
    padding: 14px 16px;
  }

  .faq-widget-header-icon {
    width: 36px;
    height: 36px;
  }

  .faq-widget-header-text h3 {
    font-size: 0.9rem;
  }
}
