/* ==========================================
   Debtia FAQ Styles
   Modern, clean FAQ design with accordions
   ========================================== */

/* -----------------------------------------
   CSS Variables
   ----------------------------------------- */
.faq-archive,
.faq-single {
    --faq-sidebar-width: 320px;
    --faq-gap: 2rem;
    --faq-accordion-radius: 16px;
    --faq-card-radius: 20px;
}

/* -----------------------------------------
   FAQ Archive Layout
   ----------------------------------------- */
.faq-archive {
    display: grid;
    grid-template-columns: var(--faq-sidebar-width) 1fr;
    gap: var(--faq-gap);
    max-width: 1400px;
    margin: 0 auto;
    padding: 3rem 1.5rem;
    align-items: start;
}

/* -----------------------------------------
   FAQ Sidebar (Pinned via ScrollSmoother)
   ----------------------------------------- */
.faq-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Search Box */
.faq-search {
    position: relative;
}

.faq-search-input {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 2.75rem;
    font-size: 0.9375rem;
    border: 2px solid rgba(0, 41, 84, 0.1);
    border-radius: var(--faq-accordion-radius);
    background: #fff;
    color: var(--bs-secondary, #002954);
    transition: all 0.2s ease;
}

.faq-search-input:focus {
    outline: none;
    border-color: var(--bs-primary, #088c76);
    box-shadow: 0 0 0 4px rgba(8, 140, 118, 0.1);
}

.faq-search-input::placeholder {
    color: #9ca3af;
}

.faq-search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    pointer-events: none;
}

.faq-search-clear {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 41, 84, 0.08);
    border: none;
    border-radius: 50%;
    color: var(--bs-secondary, #002954);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.faq-search-input:not(:placeholder-shown) ~ .faq-search-clear {
    opacity: 1;
    visibility: visible;
}

.faq-search-clear:hover {
    background: rgba(0, 41, 84, 0.15);
}

/* Category Navigation */
.faq-categories {
    background: #fff;
    border-radius: var(--faq-card-radius);
    box-shadow: 0 4px 20px rgba(0, 41, 84, 0.06);
    overflow: hidden;
}

.faq-categories-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6c757d;
    padding: 1.25rem 1.25rem 0.75rem;
    margin: 0;
}

.faq-categories-list {
    list-style: none;
    margin: 0;
    padding: 0 0 0.5rem;
}

.faq-category-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.25rem;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--bs-secondary, #002954);
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.faq-category-link:hover {
    background: rgba(8, 140, 118, 0.04);
    color: var(--bs-primary, #088c76);
}

.faq-category-link.is-active {
    background: rgba(8, 140, 118, 0.08);
    color: var(--bs-primary, #088c76);
    border-left-color: var(--bs-primary, #088c76);
    font-weight: 600;
}

.faq-category-count {
    font-size: 0.75rem;
    font-weight: 600;
    color: #9ca3af;
    background: rgba(0, 41, 84, 0.05);
    padding: 0.125rem 0.5rem;
    border-radius: 20px;
    min-width: 28px;
    text-align: center;
}

.faq-category-link.is-active .faq-category-count {
    background: var(--bs-primary, #088c76);
    color: #fff;
}

/* Help Box */
.faq-help-box {
    border-radius: var(--faq-card-radius);
    padding: 1.5rem;
    color: #fff;
    position: relative;
    overflow: hidden;
}

.faq-help-box::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%);
    pointer-events: none;
}

.faq-help-box-content {
    position: relative;
    z-index: 1;
}

.faq-help-box-icon {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.faq-help-box-icon svg {
    width: 24px;
    height: 24px;
}

.faq-help-box-title {
    font-size: 1.125rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
    color: #fff;
}

.faq-help-box-text {
    font-size: 0.875rem;
    opacity: 0.9;
    margin: 0 0 1.25rem;
    line-height: 1.5;
}

.faq-help-box .btn {
    width: 100%;
}

/* -----------------------------------------
   FAQ Main Content
   ----------------------------------------- */
.faq-main {
    min-width: 0;
}

/* Search Results Info */
.faq-search-results {
    display: none;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: rgba(8, 140, 118, 0.08);
    border-radius: var(--faq-accordion-radius);
    margin-bottom: 1.5rem;
    font-size: 0.9375rem;
    color: var(--bs-secondary, #002954);
}

.faq-search-results.is-visible {
    display: flex;
}

.faq-search-results strong {
    color: var(--bs-primary, #088c76);
}

.faq-search-results-clear {
    margin-left: auto;
    font-size: 0.875rem;
    color: var(--bs-primary, #088c76);
    text-decoration: none;
    font-weight: 600;
}

.faq-search-results-clear:hover {
    text-decoration: underline;
}

/* No Results */
.faq-no-results {
    display: none;
    text-align: center;
    padding: 3rem 2rem;
    background: #fff;
    border-radius: var(--faq-card-radius);
    box-shadow: 0 4px 20px rgba(0, 41, 84, 0.06);
}

.faq-no-results.is-visible {
    display: block;
}

.faq-no-results-icon {
    width: 64px;
    height: 64px;
    background: rgba(0, 41, 84, 0.05);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}

.faq-no-results-icon svg {
    width: 32px;
    height: 32px;
    color: #9ca3af;
}

.faq-no-results-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--bs-secondary, #002954);
    margin: 0 0 0.5rem;
}

.faq-no-results-text {
    font-size: 0.9375rem;
    color: #6c757d;
    margin: 0;
}

/* Category Section */
.faq-category-section {
    margin-bottom: 2.5rem;
    padding: 0;
}

.faq-category-section:last-child {
    margin-bottom: 0;
}

.faq-category-section.is-hidden {
    display: none;
}

.faq-category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid rgba(0, 41, 84, 0.08);
}

.faq-category-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--bs-secondary, #002954);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.faq-category-name::before {
    content: '';
    width: 4px;
    height: 24px;
    background: var(--bs-primary, #088c76);
    border-radius: 2px;
}

.faq-category-toggle {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--bs-primary, #088c76);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.375rem 0.75rem;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.faq-category-toggle:hover {
    background: rgba(8, 140, 118, 0.08);
}

/* FAQ Grid (2 columns - masonry-like with CSS columns) */
.faq-grid {
    column-count: 2;
    column-gap: 1rem;
}

.faq-grid .faq-accordion {
    break-inside: avoid;
    margin-bottom: 1rem;
}

/* -----------------------------------------
   FAQ Accordion Item
   ----------------------------------------- */
.faq-accordion {
    background: #fff;
    border-radius: var(--faq-accordion-radius);
    box-shadow: 0 2px 8px rgba(0, 41, 84, 0.04);
    border: 1px solid rgba(0, 41, 84, 0.06);
    overflow: hidden;
    transition: all 0.3s ease;
}

.faq-accordion.is-hidden {
    display: none;
}

.faq-accordion:hover {
    box-shadow: 0 4px 16px rgba(0, 41, 84, 0.08);
    border-color: rgba(8, 140, 118, 0.2);
}

.faq-accordion.is-open {
    box-shadow: 0 8px 24px rgba(0, 41, 84, 0.1);
    border-color: var(--bs-primary, #088c76);
}

/* Accordion Header/Trigger */
.faq-accordion-trigger {
    width: 100%;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    transition: background 0.2s ease;
}

.faq-accordion-trigger:hover {
    background: rgba(8, 140, 118, 0.02);
}

.faq-accordion.is-open .faq-accordion-trigger {
    background: rgba(8, 140, 118, 0.04);
}

.faq-accordion-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, rgba(8, 140, 118, 0.1), rgba(0, 41, 84, 0.08));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.faq-accordion.is-open .faq-accordion-icon {
    background: var(--bs-primary, #088c76);
}

.faq-accordion-icon svg {
    width: 16px;
    height: 16px;
    color: var(--bs-primary, #088c76);
    transition: all 0.3s ease;
}

.faq-accordion.is-open .faq-accordion-icon svg {
    color: #fff;
    transform: rotate(45deg);
}

.faq-accordion-question {
    flex: 1;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--bs-secondary, #002954);
    line-height: 1.4;
    margin: 0;
    padding-top: 0.25rem;
}

.faq-accordion.is-open .faq-accordion-question {
    color: var(--bs-primary, #088c76);
}

/* Accordion Content/Answer */
.faq-accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.faq-accordion.is-open .faq-accordion-content {
    max-height: 1000px;
}

.faq-accordion-answer {
    padding: 0 1.25rem 1.25rem 4rem;
    font-size: 0.9375rem;
    line-height: 1.7;
    color: #4b5563;
}

.faq-accordion-answer p {
    margin: 0 0 1rem;
}

.faq-accordion-answer p:last-child {
    margin-bottom: 0;
}

.faq-accordion-answer a {
    color: var(--bs-primary, #088c76);
    font-weight: 500;
}

.faq-accordion-answer ul,
.faq-accordion-answer ol {
    margin: 0 0 1rem;
    padding-left: 1.25rem;
}

.faq-accordion-answer li {
    margin-bottom: 0.5rem;
}

/* Read More Link */
.faq-accordion-more {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    margin-top: 0.75rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--bs-primary, #088c76);
    text-decoration: none;
}

.faq-accordion-more:hover {
    text-decoration: underline;
}

.faq-accordion-more svg {
    width: 14px;
    height: 14px;
}

/* -----------------------------------------
   FAQ Single Layout
   ----------------------------------------- */
.faq-single {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
}

.faq-single-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 3rem;
    align-items: start;
}

/* Single Main Content */
.faq-single-main {
    min-width: 0;
}

.faq-single-card {
    background: #fff;
    border-radius: var(--faq-card-radius);
    box-shadow: 0 4px 24px rgba(0, 41, 84, 0.08);
    overflow: hidden;
}

.faq-single-header {
    padding: 2rem 2rem 1.5rem;
    border-bottom: 1px solid rgba(0, 41, 84, 0.06);
}

.faq-single-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.faq-single-category {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--bs-primary, #088c76);
    background: rgba(8, 140, 118, 0.1);
    border-radius: 20px;
    text-decoration: none;
}

.faq-single-category:hover {
    background: rgba(8, 140, 118, 0.15);
}

.faq-single-category svg {
    width: 12px;
    height: 12px;
}

.faq-single-date {
    font-size: 0.8125rem;
    color: #9ca3af;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.faq-single-date svg {
    width: 14px;
    height: 14px;
}

.faq-single-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--bs-secondary, #002954);
    line-height: 1.3;
    margin: 0;
}

.faq-single-content {
    padding: 2rem;
}

.faq-single-content > *:first-child {
    margin-top: 0;
}

.faq-single-content > *:last-child {
    margin-bottom: 0;
}

.faq-single-content p {
    font-size: 1rem;
    line-height: 1.8;
    color: #374151;
    margin: 0 0 1.5rem;
}

.faq-single-content h2,
.faq-single-content h3,
.faq-single-content h4 {
    color: var(--bs-secondary, #002954);
    margin: 2rem 0 1rem;
}

.faq-single-content ul,
.faq-single-content ol {
    margin: 0 0 1.5rem;
    padding-left: 1.5rem;
}

.faq-single-content li {
    margin-bottom: 0.75rem;
    line-height: 1.7;
}

.faq-single-content a {
    color: var(--bs-primary, #088c76);
    font-weight: 500;
}

.faq-single-content blockquote {
    margin: 1.5rem 0;
    padding: 1.25rem 1.5rem;
    background: rgba(8, 140, 118, 0.05);
    border-left: 4px solid var(--bs-primary, #088c76);
    border-radius: 0 12px 12px 0;
}

.faq-single-content blockquote p {
    margin: 0;
    font-style: italic;
}

/* Single Sidebar */
.faq-single-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Related Box (FAQs & Words) */
.faq-related-box {
    background: #fff;
    border-radius: var(--faq-card-radius);
    box-shadow: 0 4px 20px rgba(0, 41, 84, 0.06);
    overflow: hidden;
}

.faq-related-header {
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, rgba(8, 140, 118, 0.08), rgba(0, 41, 84, 0.05));
    border-bottom: 1px solid rgba(0, 41, 84, 0.06);
}

.faq-related-title {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--bs-secondary, #002954);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.faq-related-title svg {
    width: 16px;
    height: 16px;
    color: var(--bs-primary, #088c76);
}

.faq-related-list {
    list-style: none;
    margin: 0;
    padding: 0.5rem 0;
}

.faq-related-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--bs-secondary, #002954);
    text-decoration: none;
    transition: all 0.2s ease;
}

.faq-related-link:hover {
    background: rgba(8, 140, 118, 0.04);
    color: var(--bs-primary, #088c76);
}

.faq-related-link svg {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    color: var(--bs-primary, #088c76);
    opacity: 0.5;
}

.faq-related-link:hover svg {
    opacity: 1;
}

.faq-related-link span {
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Related List Wrapper with scroll */
.faq-related-list-wrapper {
    max-height: 320px;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(8, 140, 118, 0.3) transparent;
}

.faq-related-list-wrapper::-webkit-scrollbar {
    width: 4px;
}

.faq-related-list-wrapper::-webkit-scrollbar-track {
    background: transparent;
}

.faq-related-list-wrapper::-webkit-scrollbar-thumb {
    background: rgba(8, 140, 118, 0.3);
    border-radius: 4px;
}

.faq-related-list-wrapper::-webkit-scrollbar-thumb:hover {
    background: rgba(8, 140, 118, 0.5);
}

/* Hidden items */
.faq-related-list li.is-hidden {
    display: none;
}

.faq-related-box.is-expanded .faq-related-list li.is-hidden {
    display: list-item;
}

/* Toggle button */
.faq-related-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    width: calc(100% - 1rem);
    margin: 0.5rem 0.5rem 0.75rem;
    padding: 0.625rem 1rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--bs-primary, #088c76);
    background: rgba(8, 140, 118, 0.06);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.faq-related-toggle:hover {
    background: rgba(8, 140, 118, 0.12);
}

.faq-related-toggle svg {
    width: 16px;
    height: 16px;
    transition: transform 0.25s ease;
}

.faq-related-box.is-expanded .faq-related-toggle svg {
    transform: rotate(180deg);
}

/* Back to FAQ link */
.faq-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--bs-secondary, #002954);
    background: #fff;
    border-radius: var(--faq-accordion-radius);
    box-shadow: 0 2px 8px rgba(0, 41, 84, 0.06);
    text-decoration: none;
    transition: all 0.2s ease;
}

.faq-back-link:hover {
    color: var(--bs-primary, #088c76);
    box-shadow: 0 4px 12px rgba(0, 41, 84, 0.1);
}

.faq-back-link svg {
    width: 16px;
    height: 16px;
}

/* CTA Section at bottom */
.faq-cta-section {
    margin-top: 3rem;
    padding: 2.5rem;
    border-radius: var(--faq-card-radius);
    text-align: center;
    color: #fff;
}

.faq-cta-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 0.75rem;
    color: #fff;
}

.faq-cta-text {
    font-size: 1rem;
    opacity: 0.9;
    margin: 0 0 1.5rem;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.faq-cta-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* -----------------------------------------
   Compact Header for Single FAQ
   ----------------------------------------- */
.faq-compact-header {
    padding: 1.5rem 0;
    margin-bottom: 0;
}

.faq-compact-header .container {
    max-width: 1200px;
}

.faq-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
}

.faq-breadcrumb a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: color 0.2s ease;
}

.faq-breadcrumb a:hover {
    color: #fff;
}

.faq-breadcrumb-separator {
    opacity: 0.5;
}

.faq-breadcrumb-current {
    color: #fff;
    font-weight: 500;
}

/* -----------------------------------------
   Responsive Styles
   ----------------------------------------- */
@media (max-width: 1199.98px) {
    .faq-archive {
        --faq-sidebar-width: 280px;
        --faq-gap: 1.5rem;
    }
}

@media (max-width: 991.98px) {
    .faq-archive {
        grid-template-columns: 1fr;
        padding: 2rem 1rem;
    }

    .faq-sidebar {
        position: static !important;
        transform: none !important;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }

    .faq-search {
        grid-column: 1 / -1;
    }

    .faq-help-box {
        display: none;
    }

    .faq-grid {
        column-count: 1;
    }

    .faq-single-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .faq-single-sidebar {
        order: -1;
    }

    .faq-back-link {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 767.98px) {
    .faq-sidebar {
        grid-template-columns: 1fr;
    }

    .faq-category-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .faq-accordion-trigger {
        padding: 1rem;
    }

    .faq-accordion-answer {
        padding: 0 1rem 1rem 3rem;
    }

    .faq-single-header {
        padding: 1.5rem;
    }

    .faq-single-content {
        padding: 1.5rem;
    }

    .faq-single-title {
        font-size: 1.375rem;
    }

    .faq-cta-section {
        padding: 2rem 1.5rem;
    }

    .faq-cta-title {
        font-size: 1.25rem;
    }
}

/* -----------------------------------------
   Animations
   ----------------------------------------- */
.faq-accordion {
    animation: fadeInUp 0.4s ease forwards;
    opacity: 0;
}

.faq-category-section:nth-child(1) .faq-accordion:nth-child(1) { animation-delay: 0.05s; }
.faq-category-section:nth-child(1) .faq-accordion:nth-child(2) { animation-delay: 0.1s; }
.faq-category-section:nth-child(1) .faq-accordion:nth-child(3) { animation-delay: 0.15s; }
.faq-category-section:nth-child(1) .faq-accordion:nth-child(4) { animation-delay: 0.2s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .faq-accordion,
    .faq-accordion-content,
    .faq-search-input,
    .faq-category-link,
    .faq-accordion-trigger,
    .faq-accordion-icon,
    .faq-accordion-icon svg {
        transition: none;
        animation: none;
        opacity: 1;
    }
}

/* -----------------------------------------
   Search Highlight
   ----------------------------------------- */
.faq-highlight {
    background: rgba(8, 140, 118, 0.2);
    padding: 0.125rem 0.25rem;
    border-radius: 4px;
}
