/* FAQ Page Styles */

/* Debug block (visible when ?debug=1) */
.faq-debug {
    background: #1e293b;
    color: #e2e8f0;
    padding: 16px;
    font-family: monospace;
    font-size: 13px;
    margin: 0;
    border-bottom: 3px solid #f59e0b;
}

.faq-debug code {
    background: #334155;
    padding: 2px 6px;
    border-radius: 4px;
}

.faq-debug-link {
    color: #38bdf8;
}

:root {
    --faq-primary: #2563eb;
    --faq-primary-light: #eff6ff;
    --faq-text: #1f2937;
    --faq-text-muted: #6b7280;
    --faq-border: #e5e7eb;
    --faq-bg: #ffffff;
    --faq-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --faq-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.faq-page {
    text-align: center;
    margin-bottom: 50px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding: 40px 20px 60px;
}

.faq-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.faq-header {
    text-align: center;
    margin-bottom: 30px;
}

.faq-header h1 {
    font-size: 2.5rem;
    color: var(--faq-text);
    margin-bottom: 15px;
}

.faq-header p {
    color: var(--faq-text-muted);
    font-size: 1.1rem;
}

/* Search Bar */
.faq-search-wrapper {
    position: relative;
    max-width: 600px;
    margin: 0 auto 40px;
}

.faq-search-input {
    width: 100%;
    padding: 15px 20px 15px 50px;
    border: 2px solid var(--faq-border);
    border-radius: 12px;
    font-size: 1rem;
    transition: var(--faq-transition);
    outline: none;
    background-color: var(--faq-bg);
}

.faq-search-input:focus {
    border-color: var(--faq-primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.faq-search-icon {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--faq-text-muted);
    font-size: 1.2rem;
    pointer-events: none;
}

/* Category Sections */
.faq-category-section {
    margin-bottom: 40px;
}

.faq-category-title {
    font-size: 1.5rem;
    color: var(--faq-text);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--faq-primary-light);
    display: block;
}

/* Accordion */
.faq-item {
    background: var(--faq-bg);
    border: 1px solid var(--faq-border);
    border-radius: 12px;
    margin-bottom: 15px;
    overflow: hidden;
    transition: var(--faq-transition);
}

.faq-item:hover {
    border-color: var(--faq-primary);
    transform: translateY(-2px);
    box-shadow: var(--faq-shadow);
}

.faq-question {
    padding: 20px 25px;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    background: none;
    border: none;
    text-align: left;
    font-weight: 600;
    color: var(--faq-text);
    font-size: 1.1rem;
    transition: var(--faq-transition);
}

.faq-question:hover {
    color: var(--faq-primary);
}

.faq-item.active {
    border-left: 4px solid var(--faq-primary);
}

.faq-item.active .faq-question {
    color: var(--faq-primary);
    padding-left: 21px;
    /* Adjust for border */
}

.faq-icon {
    font-size: 0.9rem;
    transition: transform 0.3s ease;
    color: var(--faq-text-muted);
}

.faq-item.active .faq-icon {
    transform: rotate(180deg);
    color: var(--faq-primary);
}

.faq-answer-wrapper {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0, 1, 0, 1), opacity 0.3s ease;
    opacity: 0;
}

.faq-item.active .faq-answer-wrapper {
    max-height: 1000px;
    /* High enough to contain content */
    transition: max-height 0.3s cubic-bezier(1, 0, 1, 0), opacity 0.3s ease;
    opacity: 1;
}

.faq-answer {
    padding: 0 25px 25px;
    color: var(--faq-text-muted);
    line-height: 1.6;
    text-align: left;
}

/* Handle TinyMCE output */
.faq-answer p {
    margin-bottom: 1rem;
}

.faq-answer ul,
.faq-answer ol {
    margin-left: 20px;
    margin-bottom: 1rem;
}

/* Empty State */
.faq-no-results {
    text-align: center;
    padding: 40px;
    background: var(--faq-primary-light);
    border-radius: 12px;
    color: var(--faq-text);
    display: none;
}

.faq-no-data {
    display: block;
}

/* Sidebar */
.faq-sidebar {
    position: sticky;
    top: 80px;
    height: fit-content;
    align-self: flex-start;
}

.faq-sidebar-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--faq-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 16px;
}

.faq-category-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.category-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 8px;
    color: var(--faq-text);
    text-decoration: none;
    background-color: transparent;
    transition: var(--faq-transition);
}

.category-link i {
    font-size: 1rem;
    color: var(--faq-text-muted);
}

.category-label {
    flex: 1;
    text-align: left;
}

.category-count {
    font-size: 0.85rem;
    color: var(--faq-text-muted);
}

.category-link:hover {
    background: #f3f4f6;
}

.category-link.active {
    background: var(--faq-primary);
    color: #ffffff;
}

.category-link.active i,
.category-link.active .category-count {
    color: #e5edff;
}

/* Main Content */
.faq-content {
    min-width: 0;
}

.faq-section {
    display: none;
}

.faq-section.faq-section-active {
    display: block;
}

/* Mobile Tabs */
.faq-mobile-tabs {
    display: none;
}

.tab-btn {
    border: none;
    background: #f3f4f6;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    color: var(--faq-text);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    transition: var(--faq-transition);
}

.tab-btn i {
    font-size: 0.9rem;
}

.tab-btn.active {
    background: var(--faq-primary);
    color: #ffffff;
}

/* Responsive */
@media (max-width: 768px) {
    .faq-page {
        padding: 30px 16px 40px;
    }

    .faq-header h1 {
        font-size: 2rem;
    }

    .faq-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .faq-sidebar {
        display: none;
    }

    .faq-content {
        width: 100%;
    }

    .faq-mobile-tabs {
        display: flex;
        position: sticky;
        top: 60px;
        background: #ffffff;
        z-index: 10;
        overflow-x: auto;
        gap: 8px;
        padding: 10px 0 14px;
        border-bottom: 2px solid #e5e7eb;
    }

    .faq-mobile-tabs::-webkit-scrollbar {
        height: 6px;
    }

    .faq-mobile-tabs::-webkit-scrollbar-thumb {
        background: #d1d5db;
        border-radius: 999px;
    }

    .faq-question {
        padding: 15px 20px;
        font-size: 1rem;
    }
}