/* HiBart FAQ — Ask-BART search bar, category chips, animated accordion */

/* ---- Ask bar ---- */
.faq-ask-bar {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 26px;
    max-width: 640px;
}

.ask-bart-wrap {
    flex: 0 0 auto;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ask-live-bart {
    width: 64px;
    height: 64px;
    pointer-events: none;
}

.ask-live-bart .bart-body {
    width: 52px;
    height: 52px;
    gap: 4px;
    border-radius: 50%;
}

.ask-live-bart .bart-eye {
    width: 15px;
    height: 15px;
}

.ask-live-bart .bart-pupil {
    width: 7px;
    height: 7px;
}

.ask-live-bart .bart-blush {
    width: 8px;
    height: 3px;
}

.ask-live-bart .bart-shadow {
    width: 40px;
    height: 6px;
    bottom: -6px;
}

.ask-input-wrap {
    position: relative;
    flex: 1;
}

.faq-ask-input {
    width: 100%;
    padding: 16px 44px 16px 20px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: #fff;
    font: inherit;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.faq-ask-input::placeholder {
    color: rgba(255, 255, 255, 0.38);
}

.faq-ask-input:focus {
    border-color: rgba(94, 92, 230, 0.65);
    background: rgba(255, 255, 255, 0.07);
    box-shadow: 0 0 0 4px rgba(94, 92, 230, 0.16), 0 0 30px rgba(94, 92, 230, 0.18);
}

.faq-ask-clear {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.75);
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s ease;
}

.faq-ask-clear:hover {
    background: rgba(255, 255, 255, 0.22);
}

/* ---- Results dropdown ---- */
.faq-ask-results {
    position: absolute;
    top: calc(100% + 10px);
    left: 78px;
    right: 0;
    z-index: 40;
    padding: 16px;
    border-radius: 22px;
    background: rgba(18, 17, 24, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.11);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    gap: 14px;
    animation: askResultsIn 0.22s ease;
}

@keyframes askResultsIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.faq-ask-results[hidden],
.ask-results-group[hidden],
.ask-results-empty[hidden] {
    display: none;
}

.ask-results-label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.4);
}

.ask-question-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ask-question-item {
    text-align: left;
    padding: 11px 14px;
    border-radius: 14px;
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.85);
    font: inherit;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.ask-question-item:hover {
    background: rgba(94, 92, 230, 0.16);
    border-color: rgba(94, 92, 230, 0.4);
    transform: translateX(3px);
}

.ask-tutorial-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ask-tutorial-chip {
    padding: 9px 15px;
    border-radius: 999px;
    border: 1px solid rgba(94, 92, 230, 0.45);
    background: rgba(94, 92, 230, 0.14);
    color: #c9c8ff;
    font: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.ask-tutorial-chip:hover {
    background: rgba(94, 92, 230, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(94, 92, 230, 0.25);
}

.ask-results-empty {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.95rem;
}

/* ---- Category chips ---- */
.faq-category-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
}

.faq-cat-chip {
    padding: 9px 16px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.045);
    color: rgba(255, 255, 255, 0.65);
    font: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.faq-cat-chip:hover {
    background: rgba(255, 255, 255, 0.09);
    color: rgba(255, 255, 255, 0.85);
}

.faq-cat-chip.is-active {
    background: rgba(94, 92, 230, 0.22);
    border-color: rgba(94, 92, 230, 0.55);
    color: #d6d5ff;
}

/* ---- Animated accordion ---- */
.resource-faq-grid details .faq-answer {
    overflow: hidden;
    max-height: none;
    transition: max-height 0.32s cubic-bezier(0.33, 1, 0.68, 1), opacity 0.28s ease;
}

.resource-faq-grid summary {
    position: relative;
    padding-right: 26px;
    transition: color 0.2s ease;
}

.resource-faq-grid summary::after {
    content: '+';
    position: absolute;
    right: 2px;
    top: 50%;
    transform: translateY(-50%);
    font-weight: 500;
    font-size: 1.15rem;
    color: rgba(255, 255, 255, 0.4);
    transition: transform 0.28s cubic-bezier(0.33, 1, 0.68, 1), color 0.2s ease;
}

.resource-faq-grid details[open] summary::after {
    transform: translateY(-50%) rotate(45deg);
    color: rgba(94, 92, 230, 0.9);
}

.resource-faq-grid details {
    transition: border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease, opacity 0.4s ease, transform 0.4s ease;
}

.resource-faq-grid details:hover {
    border-color: rgba(255, 255, 255, 0.18);
    background: rgba(0, 0, 0, 0.3);
}

.resource-faq-grid details[open] {
    border-color: rgba(94, 92, 230, 0.4);
    background: rgba(94, 92, 230, 0.06);
}

/* search-jump highlight */
.faq-highlight {
    border-color: rgba(94, 92, 230, 0.85) !important;
    box-shadow: 0 0 0 3px rgba(94, 92, 230, 0.25), 0 0 40px rgba(94, 92, 230, 0.3) !important;
}

/* category filter hide */
.faq-card-hidden {
    display: none;
}

/* ---- Scroll-in reveal ---- */
.faq-reveal {
    opacity: 0;
    transform: translateY(18px);
}

.faq-reveal.faq-revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ---- Responsive ---- */
@media (max-width: 760px) {
    .faq-ask-bar {
        gap: 10px;
    }

    .ask-bart-wrap {
        width: 52px;
        height: 52px;
    }

    .ask-live-bart {
        width: 52px;
        height: 52px;
    }

    .ask-live-bart .bart-body {
        width: 42px;
        height: 42px;
    }

    .faq-ask-input {
        padding: 14px 40px 14px 16px;
        font-size: 0.95rem;
    }

    .faq-ask-results {
        left: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .faq-ask-results,
    .resource-faq-grid details .faq-answer,
    .resource-faq-grid summary::after,
    .faq-reveal {
        animation: none;
        transition: none;
        opacity: 1;
        transform: none;
    }
}
