/* ============================================
   FAQ MODULE — Collapsible Section & Public Styles
   v1.0.0 — 2026-03-10
   ============================================ */

/* --- Collapsible Header (index.html) --- */

.faq-collapsible .faq-header-toggle {
    cursor: pointer;
    text-align: center;
    padding: 2.5rem 1rem 2rem;
    transition: background 0.3s;
    border-radius: 16px;
    user-select: none;
    position: relative;
    z-index: 1;
}

.faq-collapsible .faq-header-toggle:hover {
    background: rgba(127, 255, 0, 0.02);
}

.faq-collapsible .faq-header-toggle:focus-visible {
    outline: 2px solid rgba(127, 255, 0, 0.4);
    outline-offset: 4px;
    border-radius: 12px;
}

.faq-collapsible .faq-title {
    margin-bottom: 0.6rem;
}

.faq-toggle-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.faq-toggle-text {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.35);
    transition: color 0.3s;
}

.faq-header-toggle:hover .faq-toggle-text {
    color: rgba(255, 255, 255, 0.55);
}

.faq-toggle-arrow {
    color: var(--primary-color, #7FFF00);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

.faq-header-toggle[aria-expanded="true"] .faq-toggle-arrow {
    transform: rotate(180deg);
}

/* --- Collapsible Content --- */

.faq-content {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.4s ease 0.05s;
}

.faq-content.faq-expanded {
    max-height: 4000px;
    opacity: 1;
}

/* --- Category Navigation Pills --- */

.faq-categories-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-bottom: 2rem;
    padding: 0 1rem;
    position: relative;
    z-index: 1;
}

.faq-cat-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--cat-border, rgba(255, 255, 255, 0.08));
    border-radius: 100px;
    color: var(--cat-color, rgba(255, 255, 255, 0.6));
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s;
    user-select: none;
    font-family: inherit;
}

.faq-cat-pill:hover {
    background: color-mix(in srgb, var(--cat-color, #7FFF00) 10%, transparent);
    border-color: var(--cat-color, rgba(127, 255, 0, 0.3));
    color: var(--cat-color, #fff);
    filter: brightness(1.15);
}

.faq-cat-pill.active {
    background: color-mix(in srgb, var(--cat-color, #7FFF00) 14%, transparent);
    border-color: var(--cat-color, rgba(127, 255, 0, 0.5));
    color: var(--cat-color, #7FFF00);
}

.faq-cat-pill .cat-icon {
    display: inline-flex;
    align-items: center;
    line-height: 1;
}
.faq-cat-pill .cat-icon svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    fill: none;
    vertical-align: middle;
}

.faq-cat-pill .cat-count {
    background: rgba(255, 255, 255, 0.1);
    padding: 1px 7px;
    border-radius: 10px;
    font-size: 0.72rem;
}

.faq-cat-pill.active .cat-count {
    background: color-mix(in srgb, var(--cat-color, #7FFF00) 20%, transparent);
}

/* --- FAQ Items — fade-in for dynamic items --- */

.faq-item[data-dynamic] {
    animation: faqFadeIn 0.3s ease forwards;
    opacity: 0;
}

@keyframes faqFadeIn {
    to { opacity: 1; }
}

/* --- Category group label --- */

.faq-category-group {
    margin-bottom: 0.5rem;
}

.faq-category-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    font-weight: 600;
    color: rgba(127, 255, 0, 0.55);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.75rem 1rem 0.25rem;
    margin-top: 1rem;
}

.faq-category-group:first-child .faq-category-label {
    margin-top: 0;
}

/* --- Footer Link — "View All FAQs" --- */

.faq-footer-link {
    text-align: center;
    margin-top: 2rem;
    padding-bottom: 0.5rem;
    position: relative;
    z-index: 1;
}

.btn-faq-all {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--primary-color, #7FFF00);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 10px 22px;
    border: 1px solid rgba(127, 255, 0, 0.2);
    border-radius: 8px;
    transition: all 0.3s;
}

.btn-faq-all:hover {
    background: rgba(127, 255, 0, 0.08);
    border-color: rgba(127, 255, 0, 0.4);
    transform: translateX(2px);
}

/* --- Loading --- */

.faq-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 2.5rem 1rem;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.9rem;
}

.faq-loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(127, 255, 0, 0.2);
    border-top-color: #7FFF00;
    border-radius: 50%;
    animation: faqSpin 0.8s linear infinite;
}

@keyframes faqSpin {
    to { transform: rotate(360deg); }
}

/* --- Empty state --- */

.faq-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: rgba(255, 255, 255, 0.35);
    font-size: 0.9rem;
}

/* --- Search (faq.html full page) --- */

.faq-search-bar {
    max-width: 600px;
    margin: 0 auto 2rem;
    position: relative;
    z-index: 1;
}

.faq-search-bar input {
    width: 100%;
    padding: 14px 20px 14px 48px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #fff;
    font-size: 1rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
    box-sizing: border-box;
}

.faq-search-bar input:focus {
    border-color: rgba(127, 255, 0, 0.4);
    box-shadow: 0 0 0 3px rgba(127, 255, 0, 0.06);
}

.faq-search-bar input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.faq-search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.3);
    pointer-events: none;
}

.faq-search-clear {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: rgba(255, 255, 255, 0.5);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: all 0.2s;
}

.faq-search-clear.visible {
    display: flex;
}

.faq-search-clear:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

/* --- Search results count --- */

.faq-results-info {
    text-align: center;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 1;
}

.faq-results-info strong {
    color: #7FFF00;
}

/* --- Full page header (faq.html) --- */

.faq-page-header {
    text-align: center;
    position: relative;
    z-index: 1;
}

.faq-page-subtitle {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.45);
    margin-top: -2.5rem;
    margin-bottom: 2.5rem;
}

/* --- Total items counter badge --- */

.faq-total-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    background: rgba(127, 255, 0, 0.08);
    border: 1px solid rgba(127, 255, 0, 0.15);
    border-radius: 100px;
    color: rgba(127, 255, 0, 0.7);
    font-size: 0.78rem;
    font-weight: 600;
    margin-bottom: 2rem;
}

/* --- Responsive --- */

@media (max-width: 768px) {
    .faq-collapsible .faq-header-toggle {
        padding: 2rem 0.5rem 1.5rem;
    }

    .faq-toggle-text {
        font-size: 0.8rem;
    }

    .faq-categories-nav {
        gap: 6px;
    }

    .faq-cat-pill {
        padding: 6px 12px;
        font-size: 0.78rem;
    }

    .faq-search-bar input {
        padding: 12px 16px 12px 44px;
        font-size: 0.9rem;
    }

    .faq-page-subtitle {
        font-size: 0.9rem;
        margin-top: -2rem;
        margin-bottom: 2rem;
    }
}
