/*
 * FAQ Section Global Styles
 * Created for USFleetTracking.com GPS Pages
 */

/* Global FAQ Section Styling - Applied to all section#faq elements */
section#faq {
  background-color: #f9fafb;
  padding: var(--section-padding, 1rem 0);
  margin-bottom: 1rem;
  position: relative;
  overflow: hidden;
}

/* Ensure FAQ sections have consistent styling with other sections */
section#faq.section-base {
  background-color: #f9fafb;
}

/* FAQ Section Container - ensures proper card styling */
section#faq .container.card.article-base {
  background: white;
  border-radius: var(--card-radius, 8px);
  box-shadow: var(--card-shadow, 0 2px 8px rgba(0,0,0,0.1));
  padding: var(--card-padding, 2rem);
  border: 1px solid #e5e7eb;
  transition: all 0.3s ease;
}

/* Subtle hover effect for FAQ sections */
section#faq .container.card.article-base:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  transform: translateY(-1px);
}

/* FAQ Section Header Styling */
section#faq header {
  margin-bottom: 1.5rem;
}

section#faq header h2 {
  color: #1f2937;
  font-weight: 600;
  font-size: 1.875rem;
  line-height: 1.2;
}

/* Responsive Design for FAQ Sections */
@media (max-width: 768px) {
  section#faq {
    padding: 2rem 0;
  }

  section#faq .container.card.article-base {
    padding: 1.5rem;
    margin: 0 1rem;
  }

  section#faq header h2 {
    font-size: 1.5rem;
  }
}

@media (max-width: 480px) {
  section#faq .container.card.article-base {
    padding: 1rem;
    margin: 0 0.5rem;
  }

  section#faq header h2 {
    font-size: 1.25rem;
  }
}

/* W3Schools Accordion Style */
/* Style the buttons that are used to open and close the accordion panel */
.faq-question {
  background-color: #eee;
  color: #444;
  cursor: pointer;
  padding: 18px;
  width: 100%;
  text-align: left;
  border: none;
  outline: none;
  transition: 0.4s;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: normal; /* Normal weight by default */
  -webkit-user-select: none;
  user-select: none;
  margin-bottom: 1px;
}

/* Add a background color to the button if it is clicked on (add the .active class with JS), and when you move the mouse over it (hover) */
.faq-question:hover {
  background-color: #ccc;
}

.faq-question.active,
.faq-item.opened .faq-question,
.faq-list-container li.opened .faq-question {
  background-color: #ccc;
  font-weight: bold; /* Bold text for expanded questions */
}

/* Style the accordion panel. Note: hidden by default */
.faq-answer {
  padding: 0 18px;
  background-color: white;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.2s ease-out;
}

/* Show the answer when parent has active or opened class */
.faq-item.active .faq-answer,
.faq-item.opened .faq-answer,
.faq-list-container li.active .faq-answer,
.faq-list-container li.opened .faq-answer {
  max-height: none; /* Allow full content height */
  padding: 18px;
}

.faq-answer p {
  margin-top: 1rem;
  margin-bottom: 1rem;
}

/* Container for the accordion */
.faq-container {
  max-width: 800px;
  margin: 0 auto;
}

/* Section styling */
.faq-section {
  padding: 3rem 0;
}

/* Icon styling */
.faq-question i {
  transition: transform 0.2s ease;
  margin-left: 5px;
}

.faq-question.active i,
.faq-item.opened .faq-question i,
.faq-list-container li.opened .faq-question i {
  transform: rotate(180deg);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .faq-question {
    padding: 15px;
    font-size: 0.95rem;
  }
}

@media (max-width: 480px) {
  .faq-question {
    padding: 12px;
    font-size: 0.9rem;
  }
}