#addFaqModal,
#editFaqModal {
  display: none;
}

#addFaqModal.active,
#editFaqModal.active {
  display: flex;
}

#openModal {
  width: 56px;
  height: 56px;
  font-size: 24px;
  line-height: 0;
  text-align: center;
}

.faq-item {
  display: flex;
  flex-direction: column;
  background-color: #ffffff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  position: relative;
  max-height: 300px;
  transition: max-height 0.3s ease, width 0.3s ease;
}

.faq-item .title-bar {
  background-color: #4f46e5;
  color: #ffffff;
  padding: 12px 16px;
  font-size: 1.125rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.faq-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.faq-item .content {
  flex: 1;
  padding: 16px;
  background-color: #f9fafb;
  overflow: hidden;
}

.faq-item .content a {
  color: #4f46e5;
}

.faq-item .category {
  padding: 8px 16px;
  font-size: 0.875rem;
  color: #6b7280;
  background-color: #f9fafb;
}

.faq-item.expanded {
  position: fixed;
  top: 100px;
  width: calc(100% - 40px);
  max-height: 80vh;
  overflow-y: auto;
  z-index: 1000;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.faq-item.expanded .content {
  overflow: visible;
}

.faq-item.expanded::after {
  display: none;
}

/* Ensure the category is always at the bottom */
.faq-item .faq-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Dimmed state for other faq-items */
.faq-item.dimmed {
  opacity: 0.3;
  transition: opacity 0.3s ease;
}

/* Hide overflow when faq-item is expanded */
body.modal-open {
  overflow: hidden;
}

/* Style for code blocks */
pre {
  background-color: #f5f5f5;
  padding: 1em;
  overflow: auto;
  border-radius: 4px;
}

code {
  font-family: 'Courier New', Courier, monospace;
}

.faq-item::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 50px;
  background: linear-gradient(to top, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0));
  pointer-events: none;
}

.faq-item .action-buttons {
  display: flex;
  gap: 8px;
}

.action-buttons svg {
  width: 20px;
  height: 20px;
}

.action-buttons button {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: inherit;
}

.action-buttons button:hover {
  opacity: 0.8;
}

.faq-item .edit-btn,
.faq-item .delete-btn {
  font-size: 0.875rem;
  cursor: pointer;
  transition: color 0.2s;
}

.faq-item .edit-btn:hover {
  color: #a5b4fc;
}

.faq-item .delete-btn:hover {
  color: #fecaca;
}

#faqContainer {
  position: relative;
  overflow: visible;
}