/* ═══════════════════════════════════════════════════════════════
   faqs.css — FAQs Page Styles
   Matches the dark-navy design system used across C4HR v2.
   ═══════════════════════════════════════════════════════════════ */

/* ── Page shell ──────────────────────────────────────────────── */
.faq-page {
    padding-bottom: 4rem;
}

.faq-page .container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ── Search bar ───────────────────────────────────────────────── */
.faq-search-section {
    background: #f7f9fc;
    border-bottom: 1px solid #e2e8f0;
    padding: 1.25rem 0;
}

.faq-search-form {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    max-width: 640px;
    margin: 0 auto;
}

.faq-search-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    background: #fff;
    border: 1.5px solid #e2e8f0;
    border-radius: 50px;
    padding: 0 1rem;
    box-shadow: 0 2px 10px rgba(11, 31, 58, 0.07);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.faq-search-wrap:focus-within {
    border-color: #1a3358;
    box-shadow: 0 0 0 3px rgba(26, 51, 88, 0.10);
}

.faq-search-wrap i {
    color: #a0aec0;
    font-size: 1rem;
    flex-shrink: 0;
}

.faq-search-input {
    border: none;
    outline: none;
    background: transparent;
    padding: 0.65rem 0.6rem;
    font-size: 0.88rem;
    font-family: 'DM Sans', sans-serif;
    color: #2d3748;
    width: 100%;
}

.faq-search-input::placeholder {
    color: #a0aec0;
}

.faq-search-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.55rem 1.4rem;
    background: #1a3358;
    color: #fff;
    border: none;
    border-radius: 50px;
    font-size: 0.83rem;
    font-weight: 700;
    font-family: 'DM Sans', sans-serif;
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
    transition: background 0.15s, transform 0.12s;
    flex-shrink: 0;
}

.faq-search-btn:hover {
    background: #0b1f3a;
    color: #fff;
    transform: translateY(-1px);
    text-decoration: none;
}

/* ── Topic Browser ────────────────────────────────────────────── */
.faq-browser {
    padding: 2.5rem 0;
}

.faq-browser-heading {
    font-size: 1rem;
    font-weight: 700;
    color: #4a5568;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1.75rem;
    text-align: center;
}

.faq-topics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.faq-topic-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 1.25rem 1.25rem 1rem;
    background: #fff;
    border: 1.5px solid #e2e8f0;
    border-radius: 0.75rem;
    text-decoration: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.15s ease;
    box-shadow: 0 2px 8px rgba(11, 31, 58, 0.05);
}

.faq-topic-card:hover {
    border-color: #1a3358;
    box-shadow: 0 6px 20px rgba(26, 51, 88, 0.14);
    transform: translateY(-2px);
    text-decoration: none;
}

.faq-topic-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.faq-topic-emoji {
    font-size: 1.45rem;
    line-height: 1;
    display: inline-block;
    transition: transform 0.2s ease;
}

.faq-topic-card:hover .faq-topic-icon {
    background: #e2e8f0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.faq-topic-card:hover .faq-topic-emoji {
    transform: scale(1.12);
}

.faq-topic-name {
    font-size: 0.88rem;
    font-weight: 600;
    color: #0b1f3a;
    line-height: 1.4;
}

.faq-topic-count {
    font-size: 0.75rem;
    font-weight: 500;
    color: #718096;
    background: #f0f4f8;
    border-radius: 50px;
    padding: 0.1rem 0.55rem;
}

/* ── Results State ────────────────────────────────────────────── */
.faq-results {
    padding: 1.5rem 0 2rem;
}

.faq-results-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e2e8f0;
}

.faq-results-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #0b1f3a;
    margin: 0;
}

.faq-results-badge {
    background: #1a3358;
    color: #fff;
    border-radius: 9999px;
    padding: 0.1rem 0.65rem;
    font-weight: 700;
    font-size: 0.78rem;
}

.faq-results-search-icon {
    color: #718096;
    font-size: 1rem;
}

.faq-results-count,
.faq-results-page {
    font-size: 0.82rem;
    color: #718096;
}

.faq-back-btn {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.9rem;
    background: #f0f4f8;
    border: 1px solid #e2e8f0;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    font-family: 'DM Sans', sans-serif;
    color: #4a5568;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}

.faq-back-btn:hover {
    background: #e2e8f0;
    color: #1a3358;
    text-decoration: none;
}

/* ── Sub-category section header ──────────────────────────────── */
.faq-subcat-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin: 1.75rem 0 0.85rem;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: #4a5568;
}

.faq-subcat-header::before {
    content: '';
    flex: 1;
    height: 1px;
    background: #e2e8f0;
    order: -1;
    max-width: 20px;
}

.faq-subcat-header::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}

.faq-results .faq-subcat-header:first-child {
    margin-top: 0;
}

/* ── FAQ accordion item ───────────────────────────────────────── */
.faq-item {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    margin-bottom: 0.75rem;
    transition: all 0.2s ease;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(11, 31, 58, 0.03);
}

.faq-item:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 14px rgba(11, 31, 58, 0.08);
}

details[open].faq-item {
    border-color: #1a3358;
    box-shadow: 0 4px 16px rgba(26, 51, 88, 0.09);
}

.faq-question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.1rem 1.25rem;
    cursor: pointer;
    user-select: none;
    list-style: none;
    transition: background-color 0.15s ease;
}

.faq-question:hover {
    background-color: #f8fafc;
}

details[open] .faq-question {
    background-color: #f8fafc;
    border-bottom: 1px solid #eef2f6;
}

.faq-question::-webkit-details-marker {
    display: none;
}

/* Remove ugly Q icon box */
.faq-q-icon {
    display: none !important;
}

.faq-q-text {
    flex: 1;
    font-size: 0.95rem;
    font-weight: 600;
    color: #0b1f3a;
    line-height: 1.5;
}

.faq-sno {
    color: #F58732;
    font-size: 0.95rem;
    font-weight: 700;
    margin-right: 0.35rem;
}

.faq-expand-icon {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    color: #475569;
    transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.faq-question:hover .faq-expand-icon {
    background: #e2e8f0;
    color: #1a3358;
}

details[open] .faq-expand-icon {
    transform: rotate(180deg);
    background: #1a3358;
    color: #ffffff;
}

.faq-topic-tag {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #F58732;
    background: #fff8ee;
    border: 1px solid #f6d860;
    border-radius: 0.25rem;
    padding: 0.07rem 0.4rem;
    margin-left: 0.4rem;
    vertical-align: middle;
}

.faq-admin-edit {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.7rem;
    font-weight: 700;
    color: #b7791f;
    background: #fffbeb;
    border: 1px solid #f6d860;
    border-radius: 0.3rem;
    padding: 0.1rem 0.45rem;
    margin-left: 0.5rem;
    text-decoration: none;
    cursor: not-allowed;
    opacity: 0.85;
    vertical-align: middle;
    transition: background 0.12s;
}

.faq-admin-edit:hover {
    background: #f6d860;
    color: #744210;
    text-decoration: none;
}

.faq-answer {
    padding: 1.1rem 1.25rem 1.25rem;
    font-size: 0.9rem;
    color: #334155;
    line-height: 1.7;
    margin-top: 0;
}

/* ── Pagination ───────────────────────────────────────────────── */
.faq-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.3rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.faq-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 2rem;
    padding: 0 0.65rem;
    border-radius: 0.375rem;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #4a5568;
    font-size: 0.8rem;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    font-family: 'DM Sans', sans-serif;
}

.faq-page-btn:hover {
    background: #eef2ff;
    color: #1a3358;
    border-color: #a3b4e0;
    text-decoration: none;
}

.faq-page-btn.faq-page-active {
    background: #1a3358;
    color: #fff;
    border-color: #1a3358;
    font-weight: 700;
    pointer-events: none;
}

.faq-page-btn.faq-page-disabled {
    opacity: 0.35;
    pointer-events: none;
}

/* ── Empty state ──────────────────────────────────────────────── */
.faq-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3.5rem 1.5rem;
    color: #718096;
    text-align: center;
    gap: 0.85rem;
}

.faq-empty i {
    font-size: 2.8rem;
    color: #a0aec0;
}

.faq-empty p {
    margin: 0;
    font-size: 0.95rem;
}

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 640px) {
    .faq-topics-grid {
        grid-template-columns: 1fr 1fr;
    }

    .faq-search-form {
        flex-direction: column;
        align-items: stretch;
    }

    .faq-search-btn {
        justify-content: center;
    }

    .faq-results-header {
        flex-wrap: wrap;
    }

    .faq-back-btn {
        margin-left: 0;
    }
}
