/* FAQ Display Widget Styles */

/* Main wrapper */
.faq-display-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    margin: 20px 0;
    padding: 0;
    color: #333;
}

/* Search box */
.faq-search {
    position: relative;
    margin-bottom: 30px;
    width: 100%;
}

.faq-search-input {
    width: 100%;
    padding: 12px 50px 12px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    line-height: 1.5;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.faq-search-input:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
}

.faq-search-button {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #666;
    font-size: 18px;
    cursor: pointer;
    padding: 5px;
    transition: color 0.3s ease;
}

.faq-search-button:hover {
    color: #0073aa;
}

.faq-search-clear {
    position: absolute;
    right: 40px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #666;
    font-size: 16px;
    cursor: pointer;
    padding: 5px;
    transition: color 0.3s ease;
}

.faq-search-clear:hover {
    color: #d32f2f;
}

/* Table of Contents */
.faq-toc {
    background-color: #f7f7f7;
    padding: 20px;
    margin-bottom: 30px;
    border-radius: 4px;
    border: 1px solid #eee;
}

.faq-toc h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.faq-toc ul {
    list-style-type: none;
    padding-left: 0;
    margin: 0;
}

.faq-toc ul ul {
    padding-left: 20px;
    margin-top: 5px;
}

.faq-toc li {
    margin-bottom: 8px;
}

.faq-toc a {
    color: #0073aa;
    text-decoration: none;
    transition: color 0.3s ease;
    font-size: 16px;
    line-height: 1.5;
    position: relative;
    display: inline-block;
}

.faq-toc a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -2px;
    left: 0;
    background-color: #00a0d2;
    transition: width 0.3s ease;
}

.faq-toc a:hover {
    color: #00a0d2;
    text-decoration: none;
}

.faq-toc a:hover::after {
    width: 100%;
}

/* FAQ Content */
.faq-content {
    margin-top: 20px;
}

/* Categories */
.faq-category {
    background-color: #f0f0f0;
    margin-bottom: 30px;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
}

.faq-parent-category {
    background-color: #e6f2f7;
    border-color: #c5e1ed;
}

.faq-category-title {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 24px;
    font-weight: 600;
    color: #333;
    padding-bottom: 10px;
    border-bottom: 1px solid #ddd;
}

/* Subcategories */
.faq-subcategory {
    background-color: #f9f9f9;
    padding: 15px;
    margin: 15px 0;
    border-radius: 4px;
    border: 1px solid #e5e5e5;
}

.faq-subcategory-title {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 20px;
    font-weight: 500;
    color: #444;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

/* Posts */
.faq-posts {
    list-style-type: none;
    padding-left: 0;
    margin: 0;
}

.faq-post {
    margin-bottom: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    width: 100%;
    transition: all 0.3s ease;
}

.faq-post:hover {
    background-color: rgba(0, 115, 170, 0.05);
    transform: translateY(-2px);
}

.faq-post:last-child {
    border-bottom: none;
}

.faq-post-link-wrapper {
    color: #0073aa;
    text-decoration: none;
    transition: color 0.3s ease, transform 0.2s ease;
    font-size: 16px;
    line-height: 1.5;
    display: flex;
    align-items: center;
    width: 100%;
    cursor: pointer;
}

.faq-post-link-wrapper:hover {
    color: #00a0d2;
}

.faq-post-title {
    display: inline-block;
    vertical-align: middle;
    position: relative;
}

.faq-post-title::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -2px;
    left: 0;
    background-color: #00a0d2;
    transition: width 0.3s ease;
}

.faq-post-link-wrapper:hover .faq-post-title::after {
    width: 100%;
}

.faq-post-link-wrapper:hover .faq-post-title {
    text-decoration: none;
}

.faq-no-posts {
    font-style: italic;
    color: #666;
    margin: 10px 0;
}

/* Post Icon */
.faq-post-icon {
    display: inline-block;
    vertical-align: middle;
}

.faq-post .icon-left {
    margin-right: 8px;
}

.faq-post.has-right-icon .faq-post-link-wrapper {
    justify-content: space-between;
}

.faq-post .icon-right {
    margin-left: 8px;
    order: 2;
}

.faq-post-link-wrapper .icon-right + .faq-post-title {
    order: 1;
}

/* Ensure the link wrapper takes up the full height of the list item */
.faq-post-link-wrapper {
    padding: 8px 0;
    margin: -8px 0; /* Compensate for the padding on .faq-post */
}

/* Error message */
.faq-error {
    background-color: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 4px;
    border: 1px solid #f5c6cb;
    margin-bottom: 20px;
}

/* No results message */
.faq-no-results-toc,
.faq-no-results-content {
    font-style: italic;
    color: #666;
    margin: 15px 0;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 4px;
    text-align: center;
}

/* Responsive styles */
@media (max-width: 768px) {
    .faq-category, .faq-subcategory {
        padding: 15px;
    }

    .faq-category-title {
        font-size: 20px;
    }

    .faq-subcategory-title {
        font-size: 18px;
    }

    .faq-post-link-wrapper {
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .faq-toc {
        padding: 15px;
    }

    .faq-toc h3 {
        font-size: 18px;
    }

    .faq-toc a {
        font-size: 14px;
    }

    .faq-category-title {
        font-size: 18px;
    }

    .faq-subcategory-title {
        font-size: 16px;
    }

    .faq-post-link-wrapper {
        font-size: 14px;
    }
}
