/**
 * SJ FAQs Styles
 */

/* Container Styles */
.sj-faqs-container,
.sj-howtos-container,
.sj-faqs-tabs-container,
.sj-faqs-search-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* FAQ Accordion Styles */
.sj-faqs-accordion {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.sj-faq-item {
    border-bottom: 1px solid #e0e0e0;
}

.sj-faq-item:last-child {
    border-bottom: none;
}

.sj-faq-question {
    display: flex;
    align-items: center;
    padding: 18px 20px;
    background: #f9f9f9;
    cursor: pointer;
    transition: background 0.2s ease;
}

.sj-faq-question:hover {
    background: #f0f0f0;
}

.sj-faq-question.active {
    background: #e8e8e8;
}

.sj-faq-icon {
    font-size: 24px;
    font-weight: 300;
    margin-right: 15px;
    color: #2271b1;
    transition: transform 0.3s ease;
    width: 20px;
    text-align: center;
}

.sj-faq-question.active .sj-faq-icon {
    transform: rotate(45deg);
}

.sj-faq-question h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
    color: #333;
    flex: 1;
}

.sj-faq-answer {
    display: none;
    padding: 20px;
    background: #fff;
    line-height: 1.7;
    color: #555;
}

.sj-faq-answer.active {
    display: block;
}

/* How-To Styles */
.sj-howtos-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sj-howto-item {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 24px;
    transition: box-shadow 0.2s ease;
}

.sj-howto-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.sj-howto-header h3 {
    margin: 0 0 12px;
    font-size: 20px;
}

.sj-howto-header h3 a {
    color: #333;
    text-decoration: none;
}

.sj-howto-header h3 a:hover {
    color: #2271b1;
}

.sj-howto-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}

.sj-howto-meta span {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.sj-howto-difficulty {
    background: #e8f4fc;
    color: #2271b1;
}

.sj-difficulty-beginner {
    background: #e6f4ea;
    color: #137333;
}

.sj-difficulty-intermediate {
    background: #fef7e0;
    color: #b06000;
}

.sj-difficulty-advanced {
    background: #fce8e6;
    color: #c5221f;
}

.sj-howto-time {
    background: #f0f0f0;
    color: #555;
}

.sj-howto-plugin {
    background: #f3e8ff;
    color: #7c3aed;
}

.sj-howto-excerpt {
    color: #666;
    line-height: 1.6;
    margin-bottom: 15px;
}

.sj-howto-read-more {
    display: inline-block;
    color: #2271b1;
    text-decoration: none;
    font-weight: 500;
}

.sj-howto-read-more:hover {
    text-decoration: underline;
}

/* Tab Styles */
.sj-faqs-tabs {
    display: flex;
    gap: 5px;
    border-bottom: 2px solid #e0e0e0;
    margin-bottom: 25px;
}

.sj-faqs-tab {
    padding: 12px 24px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    color: #666;
    transition: all 0.2s ease;
}

.sj-faqs-tab:hover {
    color: #2271b1;
}

.sj-faqs-tab.active {
    color: #2271b1;
    border-bottom-color: #2271b1;
}

.sj-faqs-tab-content {
    display: none;
}

.sj-faqs-tab-content.active {
    display: block;
}

/* Search Styles */
.sj-faqs-search-form {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.sj-faqs-search-input {
    flex: 1;
    padding: 14px 18px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.2s ease;
}

.sj-faqs-search-input:focus {
    outline: none;
    border-color: #2271b1;
}

.sj-faqs-search-button {
    padding: 14px 20px;
    background: #2271b1;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.sj-faqs-search-button:hover {
    background: #135e96;
}

.sj-faqs-search-button .dashicons {
    font-size: 20px;
}

/* Search Results */
.sj-faqs-search-results {
    min-height: 50px;
}

.sj-faqs-search-loading {
    text-align: center;
    padding: 20px;
    color: #666;
}

.sj-faqs-search-message {
    text-align: center;
    padding: 20px;
    color: #666;
    background: #f9f9f9;
    border-radius: 8px;
}

.sj-faqs-search-result-item {
    padding: 18px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 12px;
    transition: box-shadow 0.2s ease;
}

.sj-faqs-search-result-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.sj-faqs-search-result-item h4 {
    margin: 0 0 8px;
}

.sj-faqs-search-result-item h4 a {
    color: #333;
    text-decoration: none;
}

.sj-faqs-search-result-item h4 a:hover {
    color: #2271b1;
}

.sj-faqs-search-result-type {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.sj-faqs-search-result-type.type-faq {
    background: #e8f4fc;
    color: #2271b1;
}

.sj-faqs-search-result-type.type-howto {
    background: #f3e8ff;
    color: #7c3aed;
}

.sj-faqs-search-result-excerpt {
    color: #666;
    font-size: 14px;
    line-height: 1.5;
}

/* No Results */
.sj-faqs-no-results,
.sj-howtos-no-results {
    text-align: center;
    padding: 40px;
    color: #666;
    background: #f9f9f9;
    border-radius: 8px;
}

/* Responsive */
@media (max-width: 600px) {
    .sj-faqs-tabs {
        flex-direction: column;
        gap: 0;
    }
    
    .sj-faqs-tab {
        border-bottom: 1px solid #e0e0e0;
        margin-bottom: 0;
    }
    
    .sj-faqs-tab.active {
        background: #f0f7fc;
        border-bottom-color: #e0e0e0;
    }
    
    .sj-faqs-search-form {
        flex-direction: column;
    }
    
    .sj-howto-meta {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* =====================================================
   VOTING STYLES
   ===================================================== */
.sj-faqs-voting {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
    flex-wrap: wrap;
}

.sj-faqs-voting-label {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.sj-faqs-voting-buttons {
    display: flex;
    gap: 8px;
}

.sj-faqs-vote-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.sj-faqs-vote-btn:hover:not(:disabled) {
    border-color: #2271b1;
    background: #f0f7fc;
}

.sj-faqs-vote-btn:disabled {
    cursor: default;
    opacity: 0.7;
}

.sj-faqs-vote-btn.active {
    border-color: #2271b1;
    background: #e8f4fc;
}

.sj-faqs-vote-helpful .dashicons {
    color: #22c55e;
}

.sj-faqs-vote-not-helpful .dashicons {
    color: #ef4444;
}

.sj-faqs-vote-count {
    font-weight: 600;
    color: #333;
}

.sj-faqs-voting-thanks {
    font-size: 13px;
    color: #22c55e;
    font-style: italic;
}

/* =====================================================
   COPY LINK BUTTON STYLES
   ===================================================== */
.sj-faq-copy-link {
    margin-left: auto;
    padding: 6px 10px;
    border: none;
    background: transparent;
    cursor: pointer;
    color: #999;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
}

.sj-faq-copy-link:hover {
    background: #e0e0e0;
    color: #2271b1;
}

.sj-faq-copy-link.copied {
    color: #22c55e;
}

.sj-faq-copy-link .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* =====================================================
   PRODUCT BADGE STYLES
   ===================================================== */
.sj-faqs-product-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.sj-faqs-product-badge {
    display: inline-block;
    padding: 4px 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Product filter dropdown */
.sj-faqs-product-filter {
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
    cursor: pointer;
    min-width: 180px;
}

.sj-faqs-product-filter:focus {
    outline: none;
    border-color: #2271b1;
}

/* =====================================================
   ANCHOR HIGHLIGHT STYLES
   ===================================================== */
.sj-faq-item:target {
    animation: highlight-fade 2s ease-out;
}

.sj-faq-item:target .sj-faq-question {
    background: #fff3cd;
}

@keyframes highlight-fade {
    0% {
        background-color: #fff3cd;
    }
    100% {
        background-color: transparent;
    }
}

/* Copy link tooltip */
.sj-faq-copy-tooltip {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    z-index: 9999;
    animation: tooltip-fade 2s ease-out forwards;
}

@keyframes tooltip-fade {
    0%, 70% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

/* =====================================================
   TOOLBAR (EXPAND/COLLAPSE ALL)
   ===================================================== */
.sj-faqs-toolbar {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-bottom: 15px;
    padding: 10px 0;
}

.sj-faqs-expand-all,
.sj-faqs-collapse-all {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    font-size: 13px;
    color: #555;
    transition: all 0.2s ease;
}

.sj-faqs-expand-all:hover,
.sj-faqs-collapse-all:hover {
    border-color: #2271b1;
    background: #f0f7fc;
    color: #2271b1;
}

.sj-faqs-expand-all .dashicons,
.sj-faqs-collapse-all .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* =====================================================
   VIEW COUNTER STYLES
   ===================================================== */
.sj-faqs-views {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #999;
    margin-left: auto;
    margin-right: 10px;
    white-space: nowrap;
}

.sj-faqs-views .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

/* =====================================================
   SINGLE FAQ STYLES
   ===================================================== */
.sj-faq-single {
    max-width: 100%;
}

.sj-faqs-error {
    color: #dc3545;
    padding: 10px 15px;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 6px;
}

/* =====================================================
   RESPONSIVE ADDITIONS
   ===================================================== */
@media (max-width: 600px) {
    .sj-faqs-toolbar {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .sj-faqs-views {
        display: none;
    }
    
    .sj-faqs-voting {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .sj-faq-copy-link {
        position: absolute;
        right: 10px;
        top: 50%;
        transform: translateY(-50%);
    }
    
    .sj-faq-question {
        position: relative;
        padding-right: 50px;
    }
}
