/* ============================================================
   FAQ PAGE CSS — Responsive with Search + Category Filter
   ============================================================ */

:root {
    --orange: #687EFF;
    --orange-light: #ffb347;
    --orange-pale: #fff9f4;
    --orange-border: #ffe5cc;
    --text-dark: #222;
    --text-mid: #444;
    --text-soft: #666;
    --text-muted: #999;
    --radius: 16px;
    --shadow: 0 8px 28px rgba(255, 122, 0, 0.12);
    --shadow-hover: 0 18px 45px rgba(255, 122, 0, 0.22);
}

/* ---------- Section Wrapper ---------- */
.faq-page-section {
    padding: 70px 0 90px;
    background: #fafafa;
    font-family: "DM Sans", sans-serif;
}

/* ---------- Page Header ---------- */
.faq-page-header {
    text-align: center;
    margin-bottom: 50px;
}

.faq-page-header h1 {
    font-size: 42px;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 14px;
    line-height: 1.2;
}

.faq-page-header h1 span {
    color: var(--orange);
}

.faq-page-header p {
    font-size: 17px;
    color: var(--text-soft);
    max-width: 560px;
    margin: 0 auto;
    line-height: 1.7;
}

/* ---------- Search Bar ---------- */
.faq-search-wrap {
    max-width: 620px;
    margin: 0 auto 50px;
    position: relative;
}

.faq-search-wrap input {
    width: 100%;
    padding: 18px 60px 18px 24px;
    border: 2px solid #687EFF;
    border-radius: 50px;
    font-size: 16px;
    color: var(--text-dark);
    background: #fff;
    outline: none;
    box-shadow: var(--shadow);
    font-family: "DM Sans", sans-serif;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.faq-search-wrap input::placeholder {
    color: var(--text-muted);
}

.faq-search-wrap input:focus {
    border-color: var(--orange);
    box-shadow: 0 0 0 4px rgba(255, 122, 0, 0.12);
}

.faq-search-wrap .faq-search-icon {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--orange);
    font-size: 18px;
    pointer-events: none;
}

.faq-search-wrap .faq-clear-btn {
    display: none;
    position: absolute;
    right: 50px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #bbb;
    font-size: 18px;
    cursor: pointer;
    padding: 0 6px;
    line-height: 1;
    transition: color 0.2s;
}

.faq-search-wrap .faq-clear-btn:hover { color: var(--orange); }
.faq-search-wrap.has-value .faq-clear-btn { display: block; }

/* Search result count */
.faq-search-count {
    text-align: center;
    font-size: 14px;
    color: var(--text-soft);
    margin-bottom: 28px;
    min-height: 22px;
}

.faq-search-count span { color: var(--orange); font-weight: 700; }

/* ---------- Category Filter Pills ---------- */
.faq-category-tabs {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 45px;
}

.faq-category-tabs button {
    padding: 9px 22px;
    border: 2px solid var(--orange-border);
    background: #fff;
    color: var(--text-mid);
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: "DM Sans", sans-serif;
    outline: none;
}

.faq-category-tabs button:hover,
.faq-category-tabs button.active {
    background: linear-gradient(135deg, var(--orange), var(--orange-light));
    color: #fff;
    border-color: transparent;
    box-shadow: 0 5px 18px rgba(255, 122, 0, 0.32);
    transform: translateY(-2px);
}

/* ---------- FAQ Layout (Sidebar + Content) ---------- */
.faq-layout {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

/* Sidebar */
.faq-sidebar {
    width: 260px;
    flex-shrink: 0;
    position: sticky;
    top: 20px;
}

.faq-sidebar-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 28px 24px;
    box-shadow: var(--shadow);
    border: 1px solid var(--orange-border);
}

.faq-sidebar-card h4 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--orange-border);
}

.faq-sidebar-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.faq-sidebar-list li {
    margin-bottom: 6px;
}

.faq-sidebar-list li a,
.faq-sidebar-list li button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-mid);
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.25s ease;
    font-family: "DM Sans", sans-serif;
}

.faq-sidebar-list li button:hover,
.faq-sidebar-list li button.active {
    background: var(--orange-pale);
    color: var(--orange);
    padding-left: 18px;
}

.faq-sidebar-list li button .faq-cat-count {
    background: var(--orange-border);
    color: var(--orange);
    font-size: 12px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    min-width: 26px;
    text-align: center;
}

.faq-sidebar-list li button.active .faq-cat-count {
    background: var(--orange);
    color: #fff;
}

/* Need help card */
.faq-help-card {
    background: linear-gradient(135deg, var(--orange), var(--orange-light));
    border-radius: var(--radius);
    padding: 28px 24px;
    color: #fff;
    text-align: center;
    margin-top: 20px;
}

.faq-help-card h5 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 10px;
}

.faq-help-card p {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 18px;
    line-height: 1.5;
}

.faq-help-card a {
    display: inline-block;
    background: #fff;
    color: var(--orange);
    padding: 10px 24px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s ease;
}

.faq-help-card a:hover {
    background: var(--text-dark);
    color: #fff;
}

/* ---------- FAQ Content Area ---------- */
.faq-content-area {
    flex: 1;
    min-width: 0;
}

/* Category group */
.faq-group {
    margin-bottom: 40px;
}

.faq-group-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--orange-border);
}

.faq-group-title .faq-group-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--orange), var(--orange-light));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 16px;
    flex-shrink: 0;
}

/* Accordion item */
.faq-accordion-item {
    background: #fff;
    border-radius: 12px;
    margin-bottom: 12px;
    border: 1px solid var(--orange-border);
    overflow: hidden;
    box-shadow: 0 3px 12px rgba(0,0,0,0.05);
    transition: box-shadow 0.3s ease;
    animation: faqFadeIn 0.45s ease forwards;
    opacity: 0;
}

.faq-accordion-item:nth-child(1) { animation-delay: 0.05s; }
.faq-accordion-item:nth-child(2) { animation-delay: 0.10s; }
.faq-accordion-item:nth-child(3) { animation-delay: 0.15s; }
.faq-accordion-item:nth-child(4) { animation-delay: 0.20s; }
.faq-accordion-item:nth-child(5) { animation-delay: 0.25s; }
.faq-accordion-item:nth-child(6) { animation-delay: 0.30s; }
.faq-accordion-item:nth-child(7) { animation-delay: 0.35s; }
.faq-accordion-item:nth-child(8) { animation-delay: 0.40s; }

@keyframes faqFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.faq-accordion-item:hover {
    box-shadow: var(--shadow-hover);
}

.faq-accordion-item.faq-hidden {
    display: none;
}

/* Question row */
.faq-accordion-question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    cursor: pointer;
    background: var(--orange-pale);
    gap: 16px;
    transition: background 0.3s ease;
    user-select: none;
}

.faq-accordion-item.active .faq-accordion-question {
    background: linear-gradient(135deg, rgba(255,122,0,0.08), rgba(255,179,71,0.06));
}

.faq-accordion-question .faq-q-text {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
    line-height: 1.5;
    flex: 1;
    transition: color 0.3s;
}

.faq-accordion-item.active .faq-q-text {
    color: var(--orange);
}

/* Highlight matched search text */
.faq-highlight {
    background: rgba(255, 122, 0, 0.18);
    color: var(--orange);
    border-radius: 3px;
    padding: 0 2px;
}

.faq-accordion-question .faq-q-icon {
    width: 34px;
    height: 34px;
    min-width: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--orange), #687EFF);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 13px;
    transition: transform 0.35s ease, background 0.3s ease;
    flex-shrink: 0;
}

.faq-accordion-item.active .faq-q-icon {
    transform: rotate(180deg);
    background: linear-gradient(135deg, #687EFF, var(--orange));
}

/* Answer panel */
.faq-accordion-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.42s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s ease;
    background: #fff;
}

.faq-accordion-item.active .faq-accordion-answer {
    max-height: 600px;
}

.faq-accordion-answer-inner {
    padding: 0 24px;
    transition: padding 0.3s ease;
}

.faq-accordion-item.active .faq-accordion-answer-inner {
    padding: 18px 24px 24px;
}

.faq-accordion-answer p {
    font-size: 15px;
    color: var(--text-soft);
    line-height: 1.75;
    margin: 0;
    text-align: justify;
}

/* No results */
.faq-no-results {
    text-align: center;
    padding: 70px 20px;
    display: none;
}

.faq-no-results.visible { display: block; }

.faq-no-results i {
    font-size: 52px;
    color: var(--orange-border);
    margin-bottom: 18px;
    display: block;
}

.faq-no-results h4 {
    font-size: 22px;
    color: var(--text-mid);
    margin-bottom: 10px;
}

.faq-no-results p {
    font-size: 15px;
    color: var(--text-muted);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* Sidebar hides on tablet — category tabs show instead */
@media (max-width: 991px) {
    .faq-layout {
        flex-direction: column;
    }

    .faq-sidebar {
        width: 100%;
        position: static;
        display: none; /* hidden; tabs used instead */
    }

    .faq-category-tabs {
        display: flex; /* tabs visible on mobile/tablet */
    }
}

/* Desktop: hide tabs, show sidebar */
@media (min-width: 992px) {
    .faq-sidebar { display: block; }
    .faq-category-tabs { display: none; }
}

@media (max-width: 768px) {
    .faq-page-section { padding: 50px 0 70px; }
    .faq-page-header h1 { font-size: 32px; }
    .faq-page-header p  { font-size: 15px; }
    .faq-search-wrap input { padding: 15px 55px 15px 20px; font-size: 15px; }
    .faq-accordion-question { padding: 16px 18px; }
    .faq-accordion-question .faq-q-text { font-size: 15px; }
    .faq-accordion-item.active .faq-accordion-answer-inner { padding: 14px 18px 20px; }
}

@media (max-width: 576px) {
    .faq-page-section { padding: 35px 0 55px; }
    .faq-page-header h1 { font-size: 26px; }
    .faq-search-wrap { margin-bottom: 35px; }
    .faq-search-wrap input { padding: 13px 50px 13px 18px; font-size: 14px; }
    .faq-group-title { font-size: 17px; }
    .faq-accordion-question .faq-q-text { font-size: 14px; }
    .faq-accordion-question { padding: 14px 15px; gap: 12px; }
    .faq-accordion-answer p { font-size: 14px; }
    .faq-accordion-item.active .faq-accordion-answer-inner { padding: 12px 15px 18px; }
    .faq-category-tabs button { padding: 7px 15px; font-size: 12px; }
    .faq-q-icon { width: 30px !important; height: 30px !important; min-width: 30px !important; }
}
/* CENTER WRAPPER */
.faq-content-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 30px;
}

/* MAIN CARD */
.faq-content-area {
    width: 100%;
    max-width: 800px;
    max-height: 500px;
    overflow-y: auto;
    padding: 20px;
    border-radius: 15px;
}

/* EACH FAQ CARD */
.faq-accordion-item {
    border-radius: 12px;
    margin-bottom: 15px;
    padding: 15px;
    transition: 0.3s;
    border: 1px solid #ddd;
}
.faq-content-area {
    counter-reset: faq;
}

.faq-q-text::before {
    counter-increment: faq;
    content: counter(faq) ". ";
    font-weight: 600;
}
/* QUESTION */
.faq-accordion-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-weight: 500;
}

/* ANSWER */
.faq-accordion-answer {
    display: none;
    margin-top: 10px;
}

/* ACTIVE OPEN */
.faq-accordion-item.active .faq-accordion-answer {
    display: block;
}

/* SCROLLBAR (minimal) */
.faq-content-area::-webkit-scrollbar {
    width: 6px;
}
.faq-accordion-answer {
    cursor: pointer;
}

.faq-content-area::-webkit-scrollbar-thumb {
    border-radius: 10px;
}.faq-content-area {
    scrollbar-width: thin;
    scrollbar-color: #bbb transparent;
}