/* ==========================================================================
    FAQ Section – Compact, Attractive, Independent-Toggle Design
   ========================================================================== */

/* ── Section wrapper ─────────────────────────────────────────────────────── */
.faq-modal-container {
    padding: 0;
    display: flex;
    justify-content: center;
}

/* ── Grid: 2 columns, compact gap ─────────────────────────────────────────── */
.faq-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 40px;
    width: 100%;
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
}

/* ── Each accordion item ──────────────────────────────────────────────────── */
.faq-modal-item {
    perspective: 1000px;
}

/* ── Card shell ───────────────────────────────────────────────────────────── */
.faq-card {
    position: relative;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 18px;
    padding: 22px 22px 18px;
    transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    box-shadow: 0 4px 20px rgba(31, 38, 135, 0.06);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    /* NO min-height — card shrinks to content */
}

.faq-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0, 86, 210, 0.06) 0%, rgba(0, 160, 220, 0.02) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    z-index: 0;
}

.faq-card:hover {
    background: rgba(255, 255, 255, 0.13);
    border-color: rgba(0, 86, 210, 0.28);
    box-shadow: 0 10px 36px rgba(0, 86, 210, 0.13), 0 0 20px rgba(0, 160, 220, 0.08);
}

.faq-card:hover::before {
    opacity: 1;
}

/* ── Card header: icon + category label ──────────────────────────────────── */
.faq-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    position: relative;
    z-index: 1;
}

.faq-icon-wrapper {
    width: 40px;
    height: 40px;
    min-width: 40px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.1rem;
    box-shadow: 0 6px 16px rgba(0, 86, 210, 0.22);
    transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.faq-card:hover .faq-icon-wrapper {
    transform: scale(1.1) rotate(8deg);
    box-shadow: 0 10px 24px rgba(0, 86, 210, 0.3);
}

.faq-card-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--primary);
    margin: 0;
    font-family: 'Poppins', sans-serif;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    transition: color 0.3s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.faq-card:hover .faq-card-title {
    color: var(--secondary);
}

/* ── Toggle button (question row) ─────────────────────────────────────────── */
.faq-modal-toggle {
    background: none;
    border: none;
    padding: 10px 0 6px;
    cursor: pointer;
    text-align: left;
    width: 100%;
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.section-title {
    color: white;
}


.faq-modal-toggle:focus {
    outline: none;
}

/* ── Question text: single line with ellipsis until expanded ─────────────── */
.faq-question {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-white);
    line-height: 1.45;
    transition: color 0.3s ease;
    font-family: 'Inter', sans-serif;
    /* single-line clamp when collapsed */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

/* When the item is active, allow the question to wrap fully */
.faq-modal-item.active .faq-question {
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
}

.faq-modal-toggle:hover .faq-question {
    color: var(--primary);
}

/* ── Chevron ──────────────────────────────────────────────────────────────── */
.faq-chevron {
    width: 26px;
    height: 26px;
    min-width: 26px;
    background: rgba(0, 86, 210, 0.08);
    border: 1px solid rgba(0, 86, 210, 0.18);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    color: var(--primary);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    flex-shrink: 0;
}

.faq-modal-item.active .faq-chevron {
    transform: rotate(180deg);
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(0, 86, 210, 0.3);
}

/* ── Answer panel ────────────────────────────────────────────────────────── */
.faq-modal-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.45s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
}

/* JS sets explicit max-height via scrollHeight; this is the fallback */
.faq-modal-item.active .faq-modal-answer {
    max-height: 600px;
}

.answer-content {
    padding: 12px 0 4px;
    color: var(--text-muted);
    line-height: 1.75;
    font-size: 0.92rem;
    font-family: 'Inter', sans-serif;
    animation: slideInAnswer 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideInAnswer {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.answer-content p {
    margin: 0;
    color: rgba(var(--text-muted-rgb, 100, 116, 139), 0.9);
}

/* ── Active card highlight ───────────────────────────────────────────────── */
.faq-modal-item.active .faq-card {
    border-color: rgba(0, 86, 210, 0.35);
    background: rgba(255, 255, 255, 0.14);
    box-shadow: 0 12px 40px rgba(0, 86, 210, 0.14), 0 0 24px rgba(0, 160, 220, 0.08);
}

/* ── Tablet (≤ 992px) ────────────────────────────────────────────────────── */
@media (max-width: 992px) {
    .faq-grid {
        grid-template-columns: repeat(2, 1fr);
        max-width: 100%;
        gap: 16px;
    }

    .faq-card {
        padding: 18px 18px 14px;
    }

    .faq-question {
        font-size: 0.9rem;
    }
}

/* ── Mobile (≤ 640px): single column ─────────────────────────────────────── */
@media (max-width: 640px) {
    .faq-modal-container {
        display: block;
    }

    .faq-grid {
        grid-template-columns: 1fr;
        max-width: 100%;
        gap: 14px;
        margin-top: 28px;
    }

    .faq-card {
        padding: 18px 16px 14px;
        border-radius: 14px;
    }

    .faq-card-header {
        margin-bottom: 10px;
    }

    .faq-icon-wrapper {
        width: 36px;
        height: 36px;
        min-width: 36px;
        font-size: 1rem;
        border-radius: 10px;
    }

    .faq-card-title {
        font-size: 0.78rem;
    }

    .faq-modal-toggle {
        padding: 8px 0 5px;
    }

    .faq-question {
        font-size: 0.88rem;
        /* On mobile allow wrapping — small screen, no space for ellipsis */
        white-space: normal;
        overflow: visible;
        text-overflow: unset;
    }

    .faq-chevron {
        width: 24px;
        height: 24px;
        min-width: 24px;
        font-size: 0.7rem;
    }

    .answer-content {
        font-size: 0.85rem;
        line-height: 1.7;
    }
}

/* ── Extra-small phones (≤ 400px) ────────────────────────────────────────── */
@media (max-width: 400px) {
    .faq-card {
        padding: 15px 13px 12px;
        border-radius: 12px;
    }

    .faq-icon-wrapper {
        width: 32px;
        height: 32px;
        min-width: 32px;
        font-size: 0.9rem;
        border-radius: 9px;
    }

    .faq-card-title {
        font-size: 0.74rem;
    }

    .faq-question {
        font-size: 0.83rem;
    }

    .answer-content {
        font-size: 0.8rem;
    }
}

/* ── Dark Mode ────────────────────────────────────────────────────────────── */
[data-theme="dark"] .faq-card {
    background: rgba(15, 23, 42, 0.5);
    border-color: rgba(0, 160, 220, 0.18);
}

[data-theme="dark"] .faq-card:hover,
[data-theme="dark"] .faq-modal-item.active .faq-card {
    background: rgba(15, 23, 42, 0.7);
    border-color: rgba(0, 86, 210, 0.4);
    box-shadow: 0 15px 50px rgba(0, 86, 210, 0.22), 0 0 30px rgba(0, 160, 220, 0.12);
}

[data-theme="dark"] .faq-modal-toggle {
    border-top-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .faq-question {
    color: rgba(255, 255, 255, 0.88);
}

[data-theme="dark"] .answer-content {
    color: rgba(255, 255, 255, 0.72);
}

[data-theme="dark"] .answer-content p {
    color: rgba(255, 255, 255, 0.65);
}

[data-theme="dark"] .faq-chevron {
    background: rgba(0, 160, 220, 0.1);
    border-color: rgba(0, 160, 220, 0.25);
    color: #00a0dc;
}