/* ==========================================================================
   Nairaloop — FAQ Modal
   ========================================================================== */

/* Modal shell */
.nl-faq-modal-wrap .modal-dialog {
  transition: transform 0.35s ease, opacity 0.35s ease;
}

.nl-faq-modal-wrap .nl-faq-dialog {
  transform: scale(0.96);
}

.nl-faq-modal-wrap.show .nl-faq-dialog {
  transform: scale(1);
}

.nl-faq-dialog {
  max-width: 1000px;
  width: 95%;
  margin: 1.5rem auto;
}

.nl-faq-modal {
  position: relative;
  border: none;
  border-radius: 24px;
  background: var(--faq-modal-bg, #ffffff);
  box-shadow: var(--faq-modal-shadow, 0 24px 64px rgba(0, 0, 0, 0.12));
  overflow: hidden;
  font-family: 'Poppins', var(--nl-font);
}

.nl-faq-modal__close {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: var(--faq-close-bg, #f3f4f6);
  color: var(--faq-close-color, #6b7280);
  font-size: 18px;
  padding: 0;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.nl-faq-modal__close:hover {
  background: rgba(79, 70, 229, 0.1);
  color: #4f46e5;
  transform: scale(1.05);
}

.nl-faq-modal__close:focus-visible {
  outline: 2px solid #4f46e5;
  outline-offset: 2px;
}

.nl-faq-modal__body {
  padding: 40px;
}

/* Category pills */
.nl-faq-pills {
  display: flex;
  flex-wrap: nowrap;
  gap: 16px;
  margin-bottom: 32px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 4px;
}

.nl-faq-pills::-webkit-scrollbar {
  display: none;
}

.nl-faq-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 52px;
  padding: 0 28px;
  border-radius: 999px;
  border: 1px solid #ececec;
  background: var(--faq-pill-bg, #ffffff);
  color: var(--faq-pill-color, #1e1b4b);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease,
    box-shadow 0.25s ease, transform 0.25s ease;
}

.nl-faq-pill i {
  font-size: 17px;
}

.nl-faq-pill:hover:not(.nl-faq-pill--active) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
  border-color: #d8d8d8;
}

.nl-faq-pill--active {
  border-color: transparent;
  background: linear-gradient(135deg, #4f46e5 0%, #6d28d9 100%);
  color: #ffffff;
  box-shadow: 0 8px 24px rgba(79, 70, 229, 0.35);
}

.nl-faq-pill--active:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(79, 70, 229, 0.42);
}

.nl-faq-pill:focus-visible {
  outline: 2px solid #4f46e5;
  outline-offset: 2px;
}

/* FAQ list */
.nl-faq-list {
  display: flex;
  flex-direction: column;
}

.nl-faq-item {
  margin-bottom: 18px;
  border-radius: 20px;
  border: 1px solid var(--faq-card-border, #f1f1f1);
  background: var(--faq-card-bg, #ffffff);
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease, opacity 0.35s ease,
    max-height 0.35s ease, margin 0.35s ease;
}

.nl-faq-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.08);
}

.nl-faq-item.nl-faq-item--hidden {
  opacity: 0;
  transform: translateY(8px);
  max-height: 0;
  margin-bottom: 0;
  padding: 0;
  border-width: 0;
  box-shadow: none;
  pointer-events: none;
  overflow: hidden;
}

.nl-faq-item.nl-faq-item--visible {
  opacity: 1;
  transform: translateY(0);
}

.nl-faq-item__trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: 100%;
  padding: 28px 32px;
  border: none;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}

.nl-faq-item__trigger:focus-visible {
  outline: 2px solid #4f46e5;
  outline-offset: -2px;
  border-radius: 20px;
}

.nl-faq-item__question {
  font-size: 22px;
  font-weight: 700;
  color: var(--faq-question-color, #1e1b4b);
  line-height: 1.35;
}

.nl-faq-item__icon {
  position: relative;
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  color: var(--faq-question-color, #1e1b4b);
}

.nl-faq-item__icon::before,
.nl-faq-item__icon::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  background: currentColor;
  border-radius: 1px;
  transition: transform 0.35s ease, opacity 0.35s ease;
}

.nl-faq-item__icon::before {
  width: 16px;
  height: 2px;
  transform: translate(-50%, -50%);
}

.nl-faq-item__icon::after {
  width: 2px;
  height: 16px;
  transform: translate(-50%, -50%);
}

.nl-faq-item__trigger[aria-expanded="true"] .nl-faq-item__icon::after {
  transform: translate(-50%, -50%) rotate(90deg);
  opacity: 0;
}

.nl-faq-item__panel {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, opacity 0.35s ease, padding 0.35s ease;
  padding: 0 32px;
}

.nl-faq-item__panel.nl-faq-item__panel--open {
  opacity: 1;
  padding: 0 32px 28px;
}

.nl-faq-item__answer {
  font-size: 16px;
  line-height: 1.8;
  color: var(--faq-answer-color, #6b7280);
}

.nl-faq-item__answer p {
  margin: 0 0 12px;
}

.nl-faq-item__answer p:last-child {
  margin-bottom: 0;
}

.nl-faq-item__answer ol,
.nl-faq-item__answer ul {
  margin: 0 0 12px;
  padding-left: 1.25rem;
}

.nl-faq-item__answer li {
  margin-bottom: 6px;
}

.nl-faq-item__answer li:last-child {
  margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   Dark theme
   -------------------------------------------------------------------------- */
[data-theme="dark"] {
  --faq-modal-bg: #16162c;
  --faq-modal-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
  --faq-close-bg: #282845;
  --faq-close-color: #9499b3;
  --faq-pill-bg: #1e1e38;
  --faq-pill-color: #ececf5;
  --faq-card-bg: #1e1e38;
  --faq-card-border: rgba(255, 255, 255, 0.07);
  --faq-question-color: #ececf5;
  --faq-answer-color: #9499b3;
}

[data-theme="dark"] .nl-faq-pill:not(.nl-faq-pill--active) {
  border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .nl-faq-item {
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.25);
}

[data-theme="dark"] .nl-faq-item:hover {
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.35);
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .nl-faq-dialog {
    width: 90%;
  }
}

@media (max-width: 768px) {
  .nl-faq-dialog {
    width: 100%;
    margin: 0.5rem auto;
  }

  .nl-faq-modal {
    border-radius: 20px;
    max-height: 92vh;
  }

  .nl-faq-modal__body {
    padding: 20px;
  }

  .nl-faq-modal__close {
    top: 14px;
    right: 14px;
    width: 40px;
    height: 40px;
  }

  .nl-faq-pills {
    margin-bottom: 24px;
    margin-left: -4px;
    margin-right: -4px;
    padding-left: 4px;
    padding-right: 4px;
  }

  .nl-faq-pill {
    height: 46px;
    padding: 0 20px;
    font-size: 14px;
  }

  .nl-faq-item__trigger {
    padding: 20px;
  }

  .nl-faq-item__question {
    font-size: 18px;
  }

  .nl-faq-item__panel {
    padding: 0 20px;
  }

  .nl-faq-item__panel.nl-faq-item__panel--open {
    padding: 0 20px 20px;
  }

  .nl-faq-item__answer {
    font-size: 15px;
  }
}
