/**
 * FAQ Styles
 *
 * @category  Panth
 * @package   Panth_Faq
 * @author    Panth
 * @copyright Copyright (c) 2025 Panth
 */

/* FAQ Wrapper */
.faq-wrapper,
.faq-category-wrapper,
.faq-view-wrapper {
    margin: 20px 0;
}

/* FAQ Filters */
.faq-filters {
    margin-bottom: 30px;
    padding: 20px;
    background: #f5f5f5;
    border-radius: 4px;
}

.faq-search {
    margin-bottom: 20px;
}

.faq-search .search-field {
    display: flex;
    gap: 10px;
}

.faq-search #faq-search-input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.faq-search button.action.search {
    padding: 10px 20px;
    background: #1979c3;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}

.faq-search button.action.search:hover {
    background: #006bb4;
}

/* Category Filter */
.faq-category-filter {
    margin-top: 15px;
}

.faq-category-filter .filter-label {
    margin-bottom: 10px;
}

.faq-category-filter .filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.faq-category-filter .filter-option {
    padding: 8px 16px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s;
}

.faq-category-filter .filter-option:hover {
    background: #e9e9e9;
    border-color: #999;
}

.faq-category-filter .filter-option.active {
    background: #1979c3;
    color: #fff;
    border-color: #1979c3;
}

/* Search Results Info */
.search-results-info {
    margin-bottom: 20px;
    padding: 15px;
    background: #f0f8ff;
    border-left: 4px solid #1979c3;
}

.search-results-info .results-count {
    color: #666;
}

/* Category Section */
.faq-category-section {
    margin-bottom: 40px;
}

.faq-category-section .category-header {
    margin-bottom: 20px;
}

.faq-category-section .category-title {
    font-size: 24px;
    font-weight: 600;
    color: #333;
    margin: 0 0 10px;
}

.faq-category-section .category-description {
    color: #666;
    line-height: 1.6;
}

/* FAQ Items List */
.faq-items-list {
    border-top: 1px solid #e0e0e0;
}

/* FAQ Item */
.faq-item {
    border-bottom: 1px solid #e0e0e0;
    transition: background 0.3s;
}

.faq-item:hover {
    background: #fafafa;
}

.faq-item.active .faq-toggle-icon::after {
    transform: rotate(180deg);
}

/* FAQ Item Header */
.faq-item-header {
    padding: 20px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}

.faq-item-header:focus {
    outline: 2px solid #1979c3;
    outline-offset: -2px;
}

.faq-item-header .faq-question {
    font-size: 18px;
    font-weight: 500;
    color: #333;
    margin: 0;
    flex: 1;
}

.faq-item-header .faq-toggle-icon {
    display: inline-block;
    width: 24px;
    height: 24px;
    position: relative;
    flex-shrink: 0;
    margin-left: 15px;
}

.faq-item-header .faq-toggle-icon::after {
    content: '▼';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #1979c3;
    font-size: 12px;
    transition: transform 0.3s;
}

/* FAQ Item Content */
.faq-item-content {
    padding: 0 20px 20px;
}

.faq-item-content .faq-answer {
    line-height: 1.8;
    color: #555;
}

.faq-item-content .faq-answer p {
    margin: 0 0 15px;
}

.faq-item-content .faq-answer ul,
.faq-item-content .faq-answer ol {
    margin: 0 0 15px 20px;
}

/* FAQ Meta */
.faq-meta {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
    color: #999;
    font-size: 13px;
}

/* FAQ Helpful Voting */
.faq-helpful {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.faq-helpful .helpful-label {
    font-weight: 500;
    color: #666;
}

.faq-helpful .helpful-btn {
    padding: 6px 12px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.3s;
}

.faq-helpful .helpful-btn:hover {
    background: #e9e9e9;
}

.faq-helpful .helpful-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.faq-helpful .helpful-yes:hover {
    background: #d4edda;
    border-color: #28a745;
    color: #28a745;
}

.faq-helpful .helpful-no:hover {
    background: #f8d7da;
    border-color: #dc3545;
    color: #dc3545;
}

.faq-helpful .count {
    color: #999;
}

/* FAQ Item Detail (View Page) */
.faq-item-detail .faq-item-header {
    padding: 0 0 20px;
    cursor: default;
}

.faq-item-detail .faq-question {
    font-size: 28px;
    font-weight: 600;
}

.faq-item-detail .faq-item-content {
    padding: 0;
}

/* FAQ Actions */
.faq-actions {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.faq-actions .action.back {
    display: inline-block;
    padding: 10px 20px;
    background: #f5f5f5;
    color: #333;
    text-decoration: none;
    border-radius: 4px;
    transition: background 0.3s;
}

.faq-actions .action.back:hover {
    background: #e9e9e9;
}

/* Empty State */
.message.info.empty,
.message.error {
    padding: 20px;
    margin: 20px 0;
    border-radius: 4px;
}

.message.info.empty {
    background: #f0f8ff;
    border-left: 4px solid #1979c3;
}

/* Fix icon overlap issue - ensure text doesn't get cut off */
.panth-faq-module .message.info.empty,
.panth-faq-module .message.error {
    padding-left: 50px; /* Extra padding to account for icon */
    position: relative;
}

.panth-faq-module .message.info.empty div,
.panth-faq-module .message.error div {
    display: block;
    width: 100%;
}

.message.error {
    background: #f8d7da;
    border-left: 4px solid #dc3545;
    color: #721c24;
}

/* Responsive */
@media (max-width: 768px) {
    /* Wrappers */
    .faq-wrapper,
    .faq-category-wrapper,
    .faq-view-wrapper {
        margin: 15px 0;
        padding: 12px 10px;
    }

    /* Filters */
    .faq-filters {
        margin-bottom: 15px;
        padding: 12px;
    }

    .faq-search {
        margin-bottom: 12px;
    }

    .faq-search .search-field {
        flex-direction: column;
        gap: 8px;
    }

    .faq-search #faq-search-input {
        padding: 10px 12px;
        font-size: 14px;
    }

    .faq-search button.action.search {
        width: 100%;
        padding: 10px 16px;
        font-size: 14px;
    }

    /* Category Filter */
    .faq-category-filter {
        margin-top: 12px;
    }

    .faq-category-filter .filter-label {
        margin-bottom: 8px;
        font-size: 14px;
    }

    .faq-category-filter .filter-options {
        flex-direction: column;
        gap: 8px;
    }

    .faq-category-filter .filter-option {
        text-align: center;
        padding: 8px 14px;
        font-size: 14px;
    }

    /* Search Results */
    .search-results-info {
        margin-bottom: 15px;
        padding: 12px;
        font-size: 14px;
    }

    /* Category Section */
    .faq-category-section {
        margin-bottom: 25px;
    }

    .faq-category-section .category-header {
        margin-bottom: 12px;
    }

    .faq-category-section .category-title {
        font-size: 18px;
        margin-bottom: 8px;
    }

    .faq-category-section .category-description {
        font-size: 13px;
    }

    /* FAQ Items */
    .faq-items-list {
        border-top: none;
    }

    .faq-item {
        margin-bottom: 10px;
        border-radius: 4px;
    }

    .faq-item-header {
        padding: 12px 14px;
    }

    .faq-item-header .faq-question {
        font-size: 14px;
        line-height: 1.4;
    }

    .faq-item-header .faq-toggle-icon {
        width: 20px;
        height: 20px;
        margin-left: 10px;
    }

    .faq-item-content {
        padding: 0 14px 12px;
    }

    .faq-item-content .faq-answer {
        font-size: 13px;
        line-height: 1.5;
    }

    /* FAQ Item Detail (View Page) */
    .faq-item-detail .faq-item-header {
        padding: 0 0 15px;
    }

    .faq-item-detail .faq-question {
        font-size: 20px;
    }

    .faq-item-detail .faq-item-content {
        padding: 0;
    }

    /* FAQ Meta */
    .faq-meta {
        margin-top: 12px;
        padding-top: 12px;
        font-size: 12px;
    }

    /* FAQ Helpful */
    .faq-helpful {
        flex-wrap: wrap;
        margin-top: 12px;
        padding-top: 12px;
        gap: 8px;
    }

    .faq-helpful .helpful-label {
        font-size: 13px;
    }

    .faq-helpful .helpful-btn {
        padding: 5px 10px;
        font-size: 12px;
    }

    /* FAQ Actions */
    .faq-actions {
        margin-top: 20px;
        padding-top: 15px;
    }

    .faq-actions .action.back {
        padding: 8px 16px;
        font-size: 14px;
    }

    /* Messages */
    .message.info.empty,
    .message.error {
        padding: 12px;
        padding-left: 40px;
        margin: 15px 0;
        font-size: 13px;
    }
}
