/**
 * FTP FAQ Hub — Frontend Styles
 */

/* ===== Hub Container ===== */
.ftp-faq-hub {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #1a1a1a;
}

/* ===== Search Bar ===== */
.ftp-faq-search-wrap {
    margin-bottom: 32px;
    position: sticky;
    top: 80px;
    z-index: 100;
    background: #fff;
    padding: 12px 0;
}

.ftp-faq-search-inner {
    position: relative;
    display: flex;
    align-items: center;
}

.ftp-faq-search-icon {
    position: absolute;
    left: 16px;
    color: #999;
    pointer-events: none;
}

.ftp-faq-search {
    width: 100%;
    padding: 14px 80px 14px 48px;
    font-size: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    background: #fafafa;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
    outline: none;
    -webkit-appearance: none;
}

.ftp-faq-search:focus {
    border-color: #1a1a1a;
    background: #fff;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.ftp-faq-search-count {
    position: absolute;
    right: 16px;
    font-size: 13px;
    color: #888;
    pointer-events: none;
}

/* ===== Cluster Filters ===== */
.ftp-faq-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 32px;
    padding-bottom: 16px;
    border-bottom: 1px solid #eee;
}

.ftp-faq-filter {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    color: #555;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 24px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.ftp-faq-filter:hover {
    background: #eee;
    color: #1a1a1a;
}

.ftp-faq-filter.active {
    background: #1a1a1a;
    color: #fff;
    border-color: #1a1a1a;
}

/* ===== Cluster Sections ===== */
.ftp-faq-cluster {
    margin-bottom: 40px;
}

.ftp-faq-cluster-title {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 16px 0;
    padding-bottom: 12px;
    border-bottom: 2px solid #1a1a1a;
    color: #1a1a1a;
}

.ftp-faq-cluster.hidden {
    display: none;
}

/* ===== Accordion Items ===== */
.ftp-faq-item {
    border-bottom: 1px solid #eee;
}

.ftp-faq-item.hidden {
    display: none;
}

.ftp-faq-item.highlight .ftp-faq-q-text {
    color: #1a1a1a;
}

/* Question Button */
.ftp-faq-question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 18px 0;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.5;
    color: #333;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    transition: color 0.2s;
    gap: 16px;
}

.ftp-faq-question:hover {
    color: #000;
}

.ftp-faq-question[aria-expanded="true"] {
    color: #000;
    font-weight: 600;
}

.ftp-faq-q-text {
    flex: 1;
}

/* Toggle Arrow */
.ftp-faq-toggle {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f5f5f5;
    transition: transform 0.3s ease, background 0.2s;
    color: #666;
}

.ftp-faq-question[aria-expanded="true"] .ftp-faq-toggle {
    transform: rotate(180deg);
    background: #1a1a1a;
    color: #fff;
}

/* Answer Panel */
.ftp-faq-answer {
    overflow: hidden;
    transition: max-height 0.35s ease, opacity 0.25s ease;
}

.ftp-faq-answer[hidden] {
    display: block !important;
    max-height: 0;
    opacity: 0;
    visibility: hidden;
}

.ftp-faq-answer:not([hidden]) {
    max-height: 2000px;
    opacity: 1;
    visibility: visible;
}

.ftp-faq-answer-inner {
    padding: 0 0 20px 0;
    font-size: 15px;
    line-height: 1.7;
    color: #444;
}

.ftp-faq-answer-inner p {
    margin: 0 0 12px;
}

.ftp-faq-answer-inner p:last-child {
    margin-bottom: 0;
}

.ftp-faq-placeholder {
    color: #999;
}

/* Meta Tags */
.ftp-faq-meta {
    display: flex;
    gap: 8px;
    padding: 0 0 16px 0;
    flex-wrap: wrap;
}

.ftp-faq-tag {
    display: inline-block;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 4px;
    background: #f0f0f0;
    color: #666;
}

.ftp-faq-tag--informational { background: #e3f2fd; color: #1565c0; }
.ftp-faq-tag--commercial    { background: #fff3e0; color: #e65100; }
.ftp-faq-tag--transactional { background: #e8f5e9; color: #2e7d32; }
.ftp-faq-tag--navigational  { background: #f3e5f5; color: #6a1b9a; }
.ftp-faq-tag--stage         { background: #fafafa; color: #888; border: 1px solid #ddd; }

/* ===== No Results ===== */
.ftp-faq-no-results {
    text-align: center;
    padding: 48px 20px;
    color: #888;
}

.ftp-faq-no-results p {
    font-size: 16px;
}

.ftp-faq-clear-search {
    color: #1a1a1a;
    font-weight: 600;
    text-decoration: underline;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .ftp-faq-hub {
        padding: 0 16px;
    }

    .ftp-faq-search-wrap {
        top: 60px;
    }

    .ftp-faq-search {
        font-size: 15px;
        padding: 12px 60px 12px 44px;
    }

    .ftp-faq-filters {
        gap: 6px;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 12px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .ftp-faq-filters::-webkit-scrollbar {
        display: none;
    }

    .ftp-faq-filter {
        font-size: 12px;
        padding: 6px 12px;
        flex-shrink: 0;
    }

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

    .ftp-faq-question {
        font-size: 15px;
        padding: 14px 0;
    }

    .ftp-faq-answer-inner {
        font-size: 14px;
    }
}

/* ===== Search Highlight ===== */
.ftp-faq-highlight {
    background: #fff3cd;
    padding: 1px 3px;
    border-radius: 2px;
}

/* ===== Print Styles ===== */
@media print {
    .ftp-faq-search-wrap,
    .ftp-faq-filters,
    .ftp-faq-toggle,
    .ftp-faq-meta {
        display: none;
    }

    .ftp-faq-answer[hidden] {
        display: block !important;
        max-height: none;
        opacity: 1;
        visibility: visible;
    }

    .ftp-faq-item {
        page-break-inside: avoid;
    }
}
