/* ==========================================================================
   iHERD - FAQ PAGE STYLESHEET
   Description: Interactive styling for search bar, category filters, and 
                smooth expanding accordions.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. HERO HEADER & SEARCH BAR
   -------------------------------------------------------------------------- */
.faq-hero {
    background-color: var(--clr-secondary);
    color: var(--clr-bg-white);
    padding: 4.5rem 1.5rem 5rem 1.5rem;
    text-align: center;
    position: relative;
}

.faq-hero__container {
    max-width: 850px;
}

.faq-hero__subtitle {
    color: var(--clr-primary);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.faq-hero__title {
    font-size: 2.75rem;
    font-weight: 700;
    margin-bottom: 1rem;
    letter-spacing: -0.5px;
}

.faq-hero__description {
    font-size: 1.05rem;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 2.5rem;
}

/* Search Box Container */
.faq-search-wrapper {
    position: relative;
    max-width: 650px;
    margin: 0 auto;
}

.faq-search-input {
    width: 100%;
    padding: 1.1rem 3rem 1.1rem 3.2rem;
    font-size: 1rem;
    font-family: var(--font-primary);
    border-radius: 50px;
    border: 2px solid transparent;
    outline: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transition: var(--transition-smooth);
    background-color: var(--clr-bg-white);
    color: var(--clr-secondary);
}

.faq-search-input:focus {
    border-color: var(--clr-primary);
    box-shadow: 0 12px 35px rgba(23, 111, 145, 0.4);
}

.faq-search-icon {
    position: absolute;
    left: 1.2rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.1rem;
    color: var(--clr-text-body);
    pointer-events: none;
}

.faq-search-clear {
    position: absolute;
    right: 1.2rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--clr-text-body);
    cursor: pointer;
    display: none;
    line-height: 1;
}

.faq-search-clear:hover {
    color: var(--clr-secondary);
}

/* --------------------------------------------------------------------------
   2. CATEGORY TABS
   -------------------------------------------------------------------------- */
.faq-section {
    padding: var(--section-padding);
    background-color: var(--clr-bg-main);
}

.faq-categories {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 3rem;
}

.faq-category-btn {
    padding: 0.65rem 1.5rem;
    border-radius: 30px;
    background-color: var(--clr-bg-white);
    border: 1px solid rgba(0, 0, 0, 0.08);
    color: var(--clr-secondary);
    font-family: var(--font-primary);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}

.faq-category-btn:hover {
    background-color: #f0f4f7;
    transform: translateY(-1px);
}

.faq-category-btn.active {
    background-color: var(--clr-primary);
    color: var(--clr-bg-white);
    border-color: var(--clr-primary);
    box-shadow: 0 4px 12px rgba(23, 111, 145, 0.3);
}

/* --------------------------------------------------------------------------
   3. ACCORDION STYLES
   -------------------------------------------------------------------------- */
.faq-accordion {
    max-width: 850px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.faq-item {
    background-color: var(--clr-bg-white);
    border-radius: 12px;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(0,0,0,0.03);
    overflow: hidden;
    transition: var(--transition-smooth);
}

.faq-item:hover {
    border-color: rgba(23, 111, 145, 0.2);
}

.faq-question {
    width: 100%;
    padding: 1.5rem 2rem;
    background: none;
    border: none;
    text-align: left;
    font-family: var(--font-primary);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--clr-secondary);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    transition: var(--transition-smooth);
}

.faq-question:hover {
    color: var(--clr-primary);
}

.faq-icon {
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--clr-primary);
    transition: transform 0.3s ease;
    line-height: 1;
}

/* Accordion Open State */
.faq-item.active .faq-icon {
    transform: rotate(45deg); /* Turns '+' into 'x' */
}

.faq-item.active .faq-question {
    color: var(--clr-primary);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0, 1, 0, 1);
    background-color: #fafbfc;
}

.faq-item.active .faq-answer {
    max-height: 1000px; /* Extended height allowance for full content */
    transition: max-height 0.5s ease-in-out;
}

.faq-answer__content {
    padding: 1.5rem 2rem 2rem 2rem;
    font-size: 0.98rem;
    color: var(--clr-text-body);
    line-height: 1.7;
}

.faq-answer__content p {
    margin-bottom: 1rem;
}

.faq-answer__content p:last-child {
    margin-bottom: 0;
}

.faq-answer__content ul {
    margin-left: 1.25rem;
    margin-bottom: 1rem;
}

.faq-answer__content li {
    margin-bottom: 0.5rem;
}

/* --------------------------------------------------------------------------
   4. FALLBACK & CTA
   -------------------------------------------------------------------------- */
.faq-no-results {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--clr-secondary);
}

.faq-no-results h3 {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
}

.faq-cta {
    max-width: 850px;
    margin: 4rem auto 0 auto;
    padding: 3rem 2rem;
    background-color: var(--clr-bg-white);
    border-radius: 12px;
    text-align: center;
    box-shadow: var(--shadow-soft);
    border-top: 4px solid var(--clr-primary);
}

.faq-cta h3 {
    color: var(--clr-secondary);
    font-size: 1.6rem;
    margin-bottom: 0.5rem;
}

.faq-cta p {
    color: var(--clr-text-body);
    font-size: 1rem;
}

/* --------------------------------------------------------------------------
   5. RESPONSIVE DESIGN
   -------------------------------------------------------------------------- */
@media screen and (max-width: 768px) {
    .faq-hero {
        padding: 3.5rem 1rem 4rem 1rem;
    }

    .faq-hero__title {
        font-size: 2rem;
    }

    .faq-question {
        padding: 1.25rem 1.25rem;
        font-size: 1rem;
    }

    .faq-answer__content {
        padding: 1.25rem;
    }

    .faq-category-btn {
        padding: 0.5rem 1.1rem;
        font-size: 0.825rem;
    }
}