/* ============================================
   DeltaWeb FAQ Widget — Dark Theme
   ============================================ */

/* --- Bubble Button --- */
#faq-btn {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4F8EF7, #3A7AE8);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  box-shadow: 0 8px 30px rgba(79, 142, 247, 0.45);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.2s ease;
  padding: 0;
  color: #fff;
  animation: faqBtnPulse 2.5s infinite;
}

#faq-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 10px 40px rgba(79, 142, 247, 0.6);
}

#faq-btn.faq-btn-active {
  animation: none;
  background: linear-gradient(135deg, #3A7AE8, #2d6dd4);
}

#faq-btn svg {
  width: 22px;
  height: 22px;
}

@keyframes faqBtnPulse {
  0%, 100% { box-shadow: 0 8px 30px rgba(79, 142, 247, 0.45); }
  50%       { box-shadow: 0 8px 40px rgba(79, 142, 247, 0.65), 0 0 0 8px rgba(79, 142, 247, 0.1); }
}

/* --- Panel --- */
#faq-panel {
  position: fixed;
  bottom: 98px;
  right: 28px;
  width: 360px;
  background: #13161F;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.04);
  display: flex;
  flex-direction: column;
  z-index: 9998;
  overflow: hidden;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  transform-origin: bottom right;
  opacity: 0;
  transform: scale(0.88) translateY(8px);
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
              transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#faq-panel.faq-panel-open {
  opacity: 1;
  transform: scale(1) translateY(0);
  pointer-events: auto;
}

/* --- Header --- */
#faq-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  background: linear-gradient(135deg, rgba(79, 142, 247, 0.12), rgba(58, 122, 232, 0.06));
}

.faq-logo {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, #4F8EF7, #3A7AE8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 11px;
  color: #0F1117;
  flex-shrink: 0;
  letter-spacing: -0.3px;
}

.faq-header-title {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  color: #E8E8F0;
  letter-spacing: -0.01em;
}

#faq-close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.07);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #8B8FA8;
  transition: background 0.18s, color 0.18s;
  padding: 0;
  flex-shrink: 0;
}

#faq-close:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #E8E8F0;
}

/* --- Body --- */
#faq-body {
  overflow-y: auto;
  max-height: 360px;
}

#faq-body::-webkit-scrollbar { width: 4px; }
#faq-body::-webkit-scrollbar-track { background: transparent; }
#faq-body::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 4px; }

/* --- Question Buttons --- */
.faq-questions {
  display: flex;
  flex-direction: column;
  padding: 6px 0;
}

.faq-q-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 14px 18px;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
  color: #E8E8F0;
}

.faq-q-btn:last-child {
  border-bottom: none;
}

.faq-q-btn:hover {
  background: rgba(255, 255, 255, 0.04);
}

.faq-q-btn span {
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.45;
  flex: 1;
}

.faq-q-btn svg {
  color: #8B8FA8;
  flex-shrink: 0;
  transition: transform 0.15s, color 0.15s;
}

.faq-q-btn:hover svg {
  color: #4F8EF7;
  transform: translateX(2px);
}

/* --- Answer View --- */
.faq-answer-view {
  display: flex;
  flex-direction: column;
  padding: 16px 18px 20px;
  gap: 16px;
  animation: faqFadeIn 0.2s ease both;
}

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

#faq-back {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 500;
  color: #8B8FA8;
  padding: 0;
  transition: color 0.15s;
  align-self: flex-start;
}

#faq-back:hover {
  color: #4F8EF7;
}

.faq-answer-text {
  font-size: 13.5px;
  line-height: 1.7;
  color: #C4C4D0;
}

.faq-answer-text strong {
  color: #E8E8F0;
}

.faq-answer-text small {
  font-size: 11.5px;
  color: #8B8FA8;
}

/* --- CTA Button --- */
.faq-cta {
  display: block;
  text-align: center;
  background: #4F8EF7;
  color: #0F1117;
  font-size: 13.5px;
  font-weight: 600;
  padding: 13px 20px;
  border-radius: 50px;
  text-decoration: none;
  transition: background 0.18s, transform 0.18s, box-shadow 0.18s;
  box-shadow: 0 8px 24px rgba(79, 142, 247, 0.35);
  margin-top: 4px;
}

.faq-cta:hover {
  background: #3A7AE8;
  transform: translateY(-1px);
  box-shadow: 0 10px 30px rgba(79, 142, 247, 0.5);
}

/* --- Light Theme --- */
[data-theme="light"] #faq-panel {
  background: #F7F7F3;
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] #faq-header {
  border-bottom-color: rgba(0, 0, 0, 0.07);
  background: linear-gradient(135deg, rgba(79, 142, 247, 0.08), rgba(58, 122, 232, 0.03));
}

[data-theme="light"] .faq-header-title {
  color: #1A1A2E;
}

[data-theme="light"] #faq-close {
  background: rgba(0, 0, 0, 0.06);
  color: #5A5E72;
}

[data-theme="light"] #faq-close:hover {
  background: rgba(0, 0, 0, 0.1);
  color: #1A1A2E;
}

[data-theme="light"] #faq-body::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .faq-q-btn {
  color: #1A1A2E;
  border-bottom-color: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .faq-q-btn:hover {
  background: rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .faq-q-btn svg {
  color: #5A5E72;
}

[data-theme="light"] #faq-back {
  color: #5A5E72;
}

[data-theme="light"] .faq-answer-text {
  color: #3A3D52;
}

[data-theme="light"] .faq-answer-text strong {
  color: #1A1A2E;
}

[data-theme="light"] .faq-answer-text small {
  color: #5A5E72;
}

/* --- Mobile --- */
@media (max-width: 480px) {
  #faq-panel {
    width: calc(100vw - 24px);
    right: 12px;
    bottom: 90px;
  }

  #faq-btn {
    bottom: 20px;
    right: 16px;
  }
}
