/**
 * Easy FAQs Module - Base Styles
 * Contains core styling for the FAQ functionality
 */

/* Base wrapper and container styles */
.jx-efaqs-wrapper {
    max-width: 100%;
    margin-bottom: 30px;
    font-family: inherit;
  }
  
  .easy-faq.accordion_wrapper {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  
  /* FAQ item styles */
  .jx-efaqs-question {
    overflow: hidden;
    transition: all 0.3s ease;
  }
  
  .jx-efaqs-title {
    position: relative;
    cursor: pointer;
    font-weight: 500;
    padding: 15px 20px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  
  /* Icon styles - improved centering */
  .faqs-icon-wrapper {
    position: relative;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .faqs-icon {
    font-size: 20px;
    font-weight: normal;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
    line-height: 1;
  }
  
  .faqs-icon.faqs-plus {
    opacity: 1;
  }
  
  .faqs-icon.faqs-minus {
    opacity: 0;
  }
  
  .is-active .faqs-icon.faqs-plus {
    opacity: 0;
  }
  
  .is-active .faqs-icon.faqs-minus {
    opacity: 1;
  }
  
  /* Fixed icon alignment */
  .faqs-right {
    margin-left: 10px;
    order: 2;
  }
  
  .faqs-left {
    margin-right: 10px;
    order: -1;
  }
  
  /* Ensure text is properly aligned with left icons */
  .jx-efaqs-title .faqs-left + span,
  .jx-efaqs-title span:not(.faqs-left):not(.faqs-right):not(.faqs-icon-wrapper):not(.faqs-icon) {
    flex: 1;
  }
  
  /* FAQ answer styles */
  .jx-efaqs-answer {
    padding: 15px 20px 20px;
    overflow: hidden;
    display: none;
  }
  
  /* Search functionality */
  .jx-efaqs-search-container {
    margin-bottom: 20px;
    position: relative;
  }
  
  .jx-efaqs-search-input {
    width: 100%;
    padding: 10px 40px 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    box-sizing: border-box;
  }
  
  .jx-efaqs-search-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    pointer-events: none;
  }
  
  .jx-efaqs-search-icon svg {
    width: 100%;
    height: 100%;
    fill: #555;
  }
  
  .jx-efaqs-highlight {
    background-color: rgba(255, 255, 0, 0.3);
    padding: 0 2px;
    border-radius: 2px;
  }
  
  /* Controls */
  .jx-efaqs-controls {
    display: flex;
    margin-bottom: 15px;
    gap: 10px;
  }
  
  .jx-efaqs-expand-all,
  .jx-efaqs-collapse-all {
    background: var(--jx-efaqs-control-bg, #f5f5f5);
    border: 1px solid var(--jx-efaqs-control-border, #ddd);
    padding: 5px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    color: var(--jx-efaqs-control-text, #333);
    transition: all 0.2s ease;
  }
  
  .jx-efaqs-expand-all:hover,
  .jx-efaqs-collapse-all:hover {
    background: var(--jx-efaqs-control-hover-bg, #e9e9e9);
    color: var(--jx-efaqs-control-hover-text, #000);
  }
  
  /* Category filters */
  .jx-efaqs-category-filters {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 15px;
    gap: 8px;
  }
  
  .jx-efaqs-category-filter {
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    background: var(--jx-efaqs-category-bg, #f5f5f5);
    color: var(--jx-efaqs-category-text, #333);
    border: 1px solid var(--jx-efaqs-category-border, #ddd);
    transition: all 0.2s ease;
  }
  
  .jx-efaqs-category-filter:hover {
    background: var(--jx-efaqs-category-hover-bg, #e9e9e9);
    color: var(--jx-efaqs-category-hover-text, #000);
  }
  
  .jx-efaqs-category-filter.active {
    background: var(--jx-efaqs-category-active-bg, #4a90e2);
    color: var(--jx-efaqs-category-active-text, white);
    border-color: var(--jx-efaqs-category-active-border, #4a90e2);
  }
  
  /* No results message */
  .jx-efaqs-no-results {
    padding: 20px;
    text-align: center;
    background: #f9f9f9;
    border-radius: 4px;
    margin-top: 20px;
    display: none; /* Hide by default */
    color: #666;
    border: 1px solid #e0e0e0;
    font-size: 14px;
  }
  
  /* Highlight effect for URL anchors */
  .jx-efaqs-highlighted {
    animation: jx-highlight-pulse 2s ease-in-out;
  }
  
  @keyframes jx-highlight-pulse {
    0% {
      box-shadow: 0 0 0 0 rgba(74, 144, 226, 0.7);
    }
    70% {
      box-shadow: 0 0 0 10px rgba(74, 144, 226, 0);
    }
    100% {
      box-shadow: 0 0 0 0 rgba(74, 144, 226, 0);
    }
  }
  
  /* Responsive styles */
  @media (max-width: 768px) {
    .jx-efaqs-controls {
      flex-direction: column;
    }
    
    .jx-efaqs-category-filters {
      justify-content: center;
    }
    
    .jx-efaqs-search-input {
      font-size: 14px;
      padding: 8px 35px 8px 12px;
    }
    
    .jx-efaqs-search-icon {
      width: 16px;
      height: 16px;
      right: 12px;
    }
  }
  
  /* Base theme styling */
  .jx-efaqs-wrapper:not([class*="jx-efaqs-theme-"]) .jx-efaqs-question {
    margin-bottom: 5px;
  }
  
  .jx-efaqs-wrapper:not([class*="jx-efaqs-theme-"]) .jx-efaqs-title {
    background: #f5f5f5;
    color: #333;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
  }
  
  .jx-efaqs-wrapper:not([class*="jx-efaqs-theme-"]) .jx-efaqs-question.is-active .jx-efaqs-title {
    background: #4a90e2;
    color: #ffffff;
    border-radius: 4px 4px 0 0;
  }
  
  .jx-efaqs-wrapper:not([class*="jx-efaqs-theme-"]) .jx-efaqs-answer {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-top: none;
    border-radius: 0 0 4px 4px;
  }
/* Additional image styling */
.jx-efaqs-answer img {
    max-width: 100%;
    height: auto;
}

.jx-efaqs-featured-image {
    margin-bottom: 15px;
}

/* Fix image alignment in articles */
.jx-efaqs-answer p img {
    display: inline-block;
    vertical-align: middle;
}

.jx-efaqs-answer .pull-left,
.jx-efaqs-answer .pull-right,
.jx-efaqs-answer .float-left,
.jx-efaqs-answer .float-right {
    max-width: 50%;
}

.jx-efaqs-answer .pull-left,
.jx-efaqs-answer .float-left {
    margin: 0 15px 15px 0;
}

.jx-efaqs-answer .pull-right,
.jx-efaqs-answer .float-right {
    margin: 0 0 15px 15px;
}

