.mainfaq {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: url("../img/registration-bg.jpg") no-repeat center center/cover;
  -webkit-clip-path: polygon(0 0, 100% 0, 100% 100%, 0 80%);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 80%);
  z-index: -1;
}

#faq {
  max-width: 900px;
  margin: 20px auto;
  padding: 2rem;
  background-color: var(--lighter-blue);
  border-radius: 15px;
}

#faq h1 {
  color: var(--primary-blue);
  border-bottom: 3px solid var(--yellow);
  padding-bottom: 0.5rem;
  margin-bottom: 2rem;
}

#faq header {
  z-index: 900 !important;
}

.faq-container {
  margin-top: 2rem;
}

.faq-category {
  margin-bottom: 2rem;
  border: 1px solid var(--light-gray);
  border-radius: 10px;
  overflow: hidden;
  background-color: #fff;
}

.category-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  background-color: var(--lighter-gray);
  cursor: pointer;
  border-bottom: 2px solid var(--yellow);
}

.category-header h2 {
  margin: 0;
  font-size: 1.5rem;
  color: var(--blue);
}

.category-content {
  padding: 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
}

.category-content.active {
  max-height: 3000px; /* Arbitrary large value to accommodate all content */
  padding: 1rem;
}

.faq-item {
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--lighter-gray);
  padding-bottom: 1rem;
}

.faq-item:last-child {
  margin-bottom: 0;
  border-bottom: none;
}

.faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  padding: 0.5rem 0;
}

.faq-question h3 {
  margin: 0;
  font-size: 1.2rem;
  color: var(--orange);
}

.faq-answer {
  padding: 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
}

.faq-answer.active {
  max-height: 1000px; /* Arbitrary large value to accommodate all content */
  padding: 1rem 1rem 0.5rem 1rem;
}

.faq-answer p,
.faq-answer ul {
  margin-top: 0;
}

.faq-answer ul {
  padding-left: 1.5rem;
}

.faq-answer ul li {
  margin-bottom: 0.5rem;
}

.toggle-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--blue);
  font-size: 1.2rem;
  padding: 0.2rem 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toggle-btn:focus {
  outline: none;
}

.arrow-icon {
  transition: transform 0.3s ease;
}

.rotate {
  transform: rotate(-180deg);
}

/* Add FAQ link to the Registration and Sessions pages */
.faq-link-section {
  background-color: var(--lighter-blue);
  padding: 1rem;
  margin: 2rem 0;
  border-radius: 10px;
  text-align: center;
}

.faq-link-section p {
  margin: 0;
}

.faq-link-section a {
  color: var(--orange);
  font-weight: bold;
  text-decoration: none;
}

.faq-link-section a:hover {
  text-decoration: underline;
}

@media (max-width: 768px) {
  #faq {
    padding: 1rem;
  }

  #faq h1 {
    font-size: 1.8rem;
  }

  .category-header {
    padding: 0.8rem 1rem;
  }

  .category-header h2 {
    font-size: 1.3rem;
  }

  .faq-question h3 {
    font-size: 1.1rem;
  }

  .category-content.active,
  .faq-answer.active {
    padding: 0.8rem;
  }
}
