﻿/* ════════════════════════════════════════════════════════════════════════════
   FAQ PAGE — UNIFIED & MOBILE-SAFE STYLESHEET
   ════════════════════════════════════════════════════════════════════════════ */

/* ━━━━━━━━━━━━━━━━━━━━ Fallbacks للمتغيّرات ━━━━━━━━━━━━━━━━━━━━ */
:root {
    --neon-violet: #7c4dff;
    --neon-cyan: #00e5ff;
    --neon-pink: #ff4dd2;
    --neon-amber: #ffb547;
    --text: #f4f5fb;
    --text-soft: rgba(244,245,251,.78);
    --text-muted: rgba(244,245,251,.55);
    --border: rgba(255,255,255,.08);
    --border-glow: rgba(124,77,255,.25);
    --grad-cta: linear-gradient(135deg, #7c4dff, #00e5ff);
    --ease: cubic-bezier(.2,.8,.2,1);
    --font-en: 'Space Grotesk', 'Inter', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', ui-monospace, monospace;
}

/* منع overflow أفقي */
html, body {
    overflow-x: hidden;
    max-width: 100%;
}

.faq-hero,
.faq-tabs-section,
.faq-list-section,
.faq-cta-section {
    overflow-x: hidden;
    max-width: 100vw;
}

/* ━━━━━━━━━━━━━━━━━━━━ HERO ━━━━━━━━━━━━━━━━━━━━ */
.faq-hero {
    min-height: 65vh;
    display: flex;
    align-items: center;
    position: relative;
    padding: 8rem 0 4rem;
    overflow: hidden;
}

.hero-particles {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle at 20% 50%, rgba(124,77,255,.15), transparent 50%), radial-gradient(circle at 80% 30%, rgba(0,229,255,.12), transparent 50%), radial-gradient(circle at 50% 80%, rgba(255,77,210,.1), transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.faq-hero-inner {
    position: relative;
    z-index: 2;
}

.faq-hero-content {
    max-width: 760px;
    margin: 0 auto;
    text-align: center;
}

.faq-hero-title {
    font-size: clamp(2rem, 5vw, 3.6rem);
    font-weight: 800;
    line-height: 1.15;
    margin: 1.5rem 0;
    color: var(--text);
}

    .faq-hero-title .line {
        display: block;
    }

.faq-hero-desc {
    font-size: 1.05rem;
    line-height: 1.85;
    color: var(--text-soft);
    margin-bottom: 2.25rem;
}

/* Search Box */
.faq-search-box {
    display: flex;
    align-items: center;
    gap: .5rem;
    max-width: 640px;
    margin: 0 auto 2rem;
    padding: .55rem .55rem .55rem 1.5rem;
    background: linear-gradient(145deg, rgba(13,15,36,.85), rgba(20,21,48,.7));
    border: 1px solid var(--border-glow);
    border-radius: 100px;
    backdrop-filter: blur(20px);
    box-shadow: 0 12px 40px rgba(0,0,0,.4);
    transition: all .4s var(--ease);
}

    .faq-search-box:focus-within {
        border-color: var(--neon-cyan);
        box-shadow: 0 12px 40px rgba(0,229,255,.18);
    }

    .faq-search-box > i {
        color: var(--neon-cyan);
        font-size: 1.1rem;
        flex-shrink: 0;
    }

.faq-search-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text);
    font-size: 1rem;
    font-family: inherit;
    padding: .85rem 0;
    min-width: 0;
}

    .faq-search-input::placeholder {
        color: var(--text-muted);
    }

.faq-search-btn {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .85rem 1.5rem;
    background: var(--grad-cta);
    color: #fff;
    border: none;
    border-radius: 100px;
    font-weight: 600;
    font-size: .92rem;
    cursor: pointer;
    transition: all .4s var(--ease);
    flex-shrink: 0;
    font-family: inherit;
}

    .faq-search-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 24px rgba(124,77,255,.4);
    }

/* Hero stats */
.faq-hero-stats {
    display: inline-flex;
    align-items: center;
    gap: 2rem;
    padding: 1.25rem 2rem;
    background: linear-gradient(145deg, rgba(13,15,36,.7), rgba(20,21,48,.5));
    border: 1px solid var(--border-glow);
    border-radius: 20px;
    backdrop-filter: blur(20px);
    flex-wrap: wrap;
    justify-content: center;
    max-width: 100%;
}

.hero-stat {
    text-align: center;
    min-width: 80px;
}

.hero-stat-value {
    font-family: var(--font-en);
    font-weight: 800;
    font-size: 1.75rem;
    line-height: 1;
    background: var(--grad-cta);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: .35rem;
}

.hero-stat-label {
    color: var(--text-soft);
    font-size: .82rem;
    font-weight: 500;
}

.hero-stat-divider {
    width: 1px;
    height: 36px;
    background: var(--border);
}

/* ━━━━━━━━━━━━━━━━━━━━ TABS ━━━━━━━━━━━━━━━━━━━━ */
.faq-tabs-section {
    padding: 2rem 0;
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(8,10,28,.85);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
}

.faq-tabs {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: .75rem;
}

.faq-tab {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    padding: .65rem 1.15rem;
    background: rgba(13,15,36,.6);
    border: 1px solid var(--border);
    border-radius: 100px;
    color: var(--text-soft);
    font-size: .88rem;
    font-weight: 600;
    text-decoration: none;
    transition: all .4s var(--ease);
}

    .faq-tab:hover {
        border-color: var(--border-glow);
        color: var(--text);
        transform: translateY(-2px);
    }

    .faq-tab.active {
        background: var(--grad-cta);
        border-color: transparent;
        color: #fff;
        box-shadow: 0 8px 20px rgba(124,77,255,.3);
    }

    .faq-tab i {
        font-size: .82rem;
        opacity: .85;
    }

    .faq-tab .tab-count {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 22px;
        height: 22px;
        padding: 0 .45rem;
        background: rgba(255,255,255,.12);
        border-radius: 100px;
        font-family: var(--font-en);
        font-size: .72rem;
        font-weight: 700;
    }

    .faq-tab.active .tab-count {
        background: rgba(255,255,255,.25);
    }

/* ━━━━━━━━━━━━━━━━━━━━ FAQ LIST ━━━━━━━━━━━━━━━━━━━━ */
.faq-list-section {
    padding: 5rem 0;
    position: relative;
}

.search-result-info {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
    padding: 1rem 1.25rem;
    margin-bottom: 2rem;
    background: rgba(124,77,255,.08);
    border: 1px solid var(--border-glow);
    border-radius: 14px;
    color: var(--text-soft);
    font-size: .92rem;
}

    .search-result-info > i {
        color: var(--neon-cyan);
    }

    .search-result-info strong {
        color: var(--text);
    }

.clear-search {
    margin-right: auto;
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .35rem .75rem;
    background: rgba(255,255,255,.06);
    border: 1px solid var(--border);
    border-radius: 100px;
    color: var(--text-soft);
    font-size: .82rem;
    text-decoration: none;
    transition: all .35s;
}

    .clear-search:hover {
        background: rgba(255,77,210,.1);
        border-color: var(--neon-pink);
        color: var(--text);
    }

/* Category block */
.faq-category-block {
    margin-bottom: 3.5rem;
}

    .faq-category-block:last-child {
        margin-bottom: 0;
    }

.faq-category-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px dashed var(--border);
}

.cat-header-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: var(--grad-cta);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: #fff;
    box-shadow: 0 8px 24px rgba(124,77,255,.3);
    flex-shrink: 0;
}

.cat-header-text {
    flex: 1;
    min-width: 0;
}

.cat-header-title {
    margin: 0 0 .2rem;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -.01em;
}

.cat-header-count {
    margin: 0;
    color: var(--text-muted);
    font-size: .82rem;
    font-family: var(--font-mono);
}

/* FAQ list */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: .75rem;
}

.faq-item {
    background: linear-gradient(145deg, rgba(13,15,36,.65), rgba(20,21,48,.5));
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    transition: all .45s var(--ease);
    backdrop-filter: blur(8px);
}

    .faq-item:hover {
        border-color: var(--border-glow);
        background: linear-gradient(145deg, rgba(13,15,36,.85), rgba(20,21,48,.7));
    }

    .faq-item[open] {
        border-color: var(--neon-cyan);
        background: linear-gradient(145deg, rgba(124,77,255,.06), rgba(0,229,255,.04));
        box-shadow: 0 12px 32px rgba(124,77,255,.12);
    }

.faq-question {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    cursor: pointer;
    list-style: none;
    user-select: none;
    transition: background .35s;
}

    .faq-question::-webkit-details-marker {
        display: none;
    }

    .faq-question::marker {
        display: none;
    }

.faq-q-num {
    font-family: var(--font-en);
    font-weight: 800;
    font-size: 1rem;
    background: var(--grad-cta);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    flex-shrink: 0;
    min-width: 32px;
    letter-spacing: -.02em;
}

.faq-q-text {
    flex: 1;
    color: var(--text);
    font-size: 1.02rem;
    font-weight: 600;
    line-height: 1.5;
    word-wrap: break-word;
    overflow-wrap: break-word;
    min-width: 0;
}

.faq-q-cat {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .3rem .7rem;
    background: rgba(124,77,255,.1);
    border: 1px solid var(--border-glow);
    border-radius: 100px;
    color: var(--neon-violet);
    font-size: .72rem;
    font-family: var(--font-mono);
    flex-shrink: 0;
}

    .faq-q-cat i {
        font-size: .65rem;
    }

.faq-q-toggle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(124,77,255,.1);
    border: 1px solid var(--border-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--neon-cyan);
    font-size: .85rem;
    flex-shrink: 0;
    transition: all .45s var(--ease);
}

.faq-item[open] .faq-q-toggle {
    background: var(--grad-cta);
    border-color: transparent;
    color: #fff;
    transform: rotate(45deg);
}

.faq-item:hover .faq-q-toggle {
    transform: scale(1.05);
}

.faq-item[open]:hover .faq-q-toggle {
    transform: rotate(45deg) scale(1.05);
}

/* Answer */
.faq-answer {
    overflow: hidden;
    animation: faqFadeIn .45s var(--ease);
}

@keyframes faqFadeIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.faq-answer-inner {
    padding: 0 1.5rem 1.5rem 1.5rem;
    margin-right: 48px; /* محاذاة مع الرقم */
    color: var(--text-soft);
    line-height: 1.85;
    font-size: .98rem;
    border-top: 1px dashed var(--border);
    padding-top: 1.25rem;
}

    .faq-answer-inner p {
        margin: 0 0 .85rem;
    }

        .faq-answer-inner p:last-child {
            margin-bottom: 0;
        }

    .faq-answer-inner strong {
        color: var(--text);
    }

    .faq-answer-inner a {
        color: var(--neon-cyan);
        text-decoration: none;
        border-bottom: 1px dashed var(--neon-cyan);
        transition: all .3s;
    }

        .faq-answer-inner a:hover {
            color: var(--neon-violet);
            border-bottom-color: var(--neon-violet);
        }

    .faq-answer-inner ul,
    .faq-answer-inner ol {
        margin: 0 0 .85rem;
        padding-right: 1.5rem;
    }

    .faq-answer-inner li {
        margin-bottom: .35rem;
    }

    .faq-answer-inner code {
        padding: .15rem .45rem;
        background: rgba(0,229,255,.08);
        border: 1px solid var(--border-glow);
        border-radius: 6px;
        font-family: var(--font-mono);
        font-size: .88em;
        color: var(--neon-cyan);
    }

/* ━━━━━━━━━━━━━━━━━━━━ EMPTY STATE ━━━━━━━━━━━━━━━━━━━━ */
.faq-empty {
    text-align: center;
    padding: 5rem 1.5rem;
    max-width: 600px;
    margin: 0 auto;
}

    .faq-empty i {
        font-size: 5rem;
        color: var(--neon-violet);
        margin-bottom: 1.5rem;
        opacity: .5;
    }

    .faq-empty h2 {
        font-size: 1.7rem;
        margin: 0 0 1rem;
        color: var(--text);
    }

    .faq-empty p {
        color: var(--text-soft);
        font-size: 1rem;
        line-height: 1.85;
        margin: 0 0 2rem;
    }

.empty-actions {
    display: flex;
    gap: .85rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ━━━━━━━━━━━━━━━━━━━━ CTA ━━━━━━━━━━━━━━━━━━━━ */
.faq-cta-section {
    padding: 6rem 0;
}

.faq-cta-card {
    position: relative;
    padding: 4rem 3rem;
    background: linear-gradient(145deg, rgba(13,15,36,.95), rgba(20,21,48,.85));
    border: 1px solid var(--border-glow);
    border-radius: 28px;
    overflow: hidden;
    text-align: center;
    backdrop-filter: blur(20px);
}

.cta-glow {
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    max-width: 100%;
    max-height: 100%;
    background: radial-gradient(circle, rgba(124,77,255,.18), transparent 60%);
    pointer-events: none;
    animation: pulseBg 4s ease-in-out infinite;
}

@keyframes pulseBg {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.05);
        opacity: .85;
    }
}

.cta-content {
    position: relative;
    z-index: 2;
    max-width: 680px;
    margin: 0 auto;
}

.cta-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    border-radius: 22px;
    background: var(--grad-cta);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #fff;
    box-shadow: 0 12px 32px rgba(124,77,255,.4);
    animation: pulseBg 3s ease-in-out infinite;
}

.cta-title {
    font-size: clamp(1.7rem, 3.5vw, 2.6rem);
    font-weight: 800;
    color: var(--text);
    line-height: 1.25;
    margin: 0 0 1rem;
}

.cta-desc {
    color: var(--text-soft);
    font-size: 1.05rem;
    margin-bottom: 2rem;
    line-height: 1.85;
}

.cta-actions {
    display: inline-flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

/* ━━━━━━━━━━━━━━━━━━━━ AOS ━━━━━━━━━━━━━━━━━━━━ */
[data-aos] {
    will-change: transform, opacity;
}

@media (prefers-reduced-motion: reduce) {
    [data-aos] {
        transition: none !important;
        transform: none !important;
        opacity: 1 !important;
    }
}

/* ════════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════════════════════════════════════ */

/* ━━━━━━━━━ Tablet ≤ 991px ━━━━━━━━━ */
@media (max-width: 991px) {
    .faq-hero-title {
        font-size: clamp(1.7rem, 5vw, 2.6rem);
    }
}

/* ━━━━━━━━━ Mobile كبير ≤ 768px ━━━━━━━━━ */
@media (max-width: 768px) {
    .faq-hero {
        padding: 5rem 0 3rem;
        min-height: auto;
    }

    .faq-hero-content {
        padding: 0 .25rem;
    }

    .faq-hero-title {
        font-size: clamp(1.5rem, 6vw, 2.1rem);
        margin: 1rem 0 1.25rem;
    }

    .faq-hero-desc {
        font-size: .92rem;
        line-height: 1.7;
        margin-bottom: 1.75rem;
    }

    /* Search - يتحول لعمودي */
    .faq-search-box {
        flex-direction: column;
        align-items: stretch;
        gap: .5rem;
        padding: .75rem;
        border-radius: 18px;
    }

        .faq-search-box > i {
            display: none;
        }

    .faq-search-input {
        padding: .85rem 1rem;
        background: rgba(255,255,255,.04);
        border-radius: 12px;
        font-size: .95rem;
    }

    .faq-search-btn {
        width: 100%;
        justify-content: center;
        padding: .85rem 1rem;
    }

    .faq-hero-stats {
        gap: 1rem;
        padding: 1rem 1.25rem;
        width: 100%;
    }

    .hero-stat-divider {
        display: none;
    }

    .hero-stat {
        flex: 1 1 calc(33.33% - 1rem);
        min-width: 70px;
    }

    .hero-stat-value {
        font-size: 1.4rem;
    }

    .hero-stat-label {
        font-size: .75rem;
    }

    /* Tabs - scroll أفقي */
    .faq-tabs-section {
        position: relative;
        padding: 1.25rem 0;
        overflow: hidden;
    }

    .faq-tabs {
        gap: .5rem;
        padding: 0 .5rem;
        justify-content: flex-start;
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

        .faq-tabs::-webkit-scrollbar {
            display: none;
        }

    .faq-tab {
        padding: .5rem .85rem;
        font-size: .8rem;
        flex-shrink: 0;
        gap: .4rem;
    }

        .faq-tab .tab-count {
            min-width: 18px;
            height: 18px;
            font-size: .68rem;
        }

    /* List */
    .faq-list-section {
        padding: 3rem 0;
    }

    .faq-category-block {
        margin-bottom: 2.5rem;
    }

    .faq-category-header {
        gap: .85rem;
        margin-bottom: 1.25rem;
        padding-bottom: 1rem;
    }

    .cat-header-icon {
        width: 44px;
        height: 44px;
        font-size: 1.05rem;
        border-radius: 12px;
    }

    .cat-header-title {
        font-size: 1.15rem;
    }

    .cat-header-count {
        font-size: .75rem;
    }

    /* FAQ Item */
    .faq-question {
        padding: 1rem 1.1rem;
        gap: .75rem;
    }

    .faq-q-num {
        font-size: .9rem;
        min-width: 26px;
    }

    .faq-q-text {
        font-size: .95rem;
        line-height: 1.45;
    }

    .faq-q-cat {
        display: none; /* نخفيها على الموبايل لتوفير مساحة */
    }

    .faq-q-toggle {
        width: 30px;
        height: 30px;
        font-size: .75rem;
    }

    .faq-answer-inner {
        padding: 1rem 1.1rem 1.25rem 1.1rem;
        margin-right: 0;
        font-size: .92rem;
        line-height: 1.75;
    }

    /* Search result info */
    .search-result-info {
        flex-direction: column;
        align-items: flex-start;
        text-align: right;
        font-size: .85rem;
        padding: .85rem 1rem;
    }

    .clear-search {
        margin-right: 0;
        margin-top: .35rem;
    }

    /* CTA */
    .faq-cta-section {
        padding: 4rem 0;
    }

    .faq-cta-card {
        padding: 2.5rem 1.5rem;
        border-radius: 22px;
    }

    .cta-icon {
        width: 64px;
        height: 64px;
        font-size: 1.6rem;
    }

    .cta-title {
        font-size: clamp(1.4rem, 5vw, 2rem);
    }

    .cta-desc {
        font-size: .95rem;
    }

    .cta-actions {
        flex-direction: column;
        width: 100%;
        display: flex;
    }

        .cta-actions .btn {
            width: 100%;
            justify-content: center;
        }
}

/* ━━━━━━━━━ Mobile ≤ 480px ━━━━━━━━━ */
@media (max-width: 480px) {
    .faq-hero {
        padding: 4rem 0 2rem;
    }

    .faq-hero-title {
        font-size: clamp(1.3rem, 7vw, 1.7rem);
        line-height: 1.25;
    }

    .faq-hero-desc {
        font-size: .85rem;
    }

    .faq-search-box {
        padding: .65rem;
    }

    .faq-search-input {
        font-size: .9rem;
        padding: .75rem .85rem;
    }

    .faq-search-btn {
        padding: .75rem 1rem;
        font-size: .88rem;
    }

    .faq-hero-stats {
        padding: .85rem 1rem;
        gap: .65rem;
    }

    .hero-stat {
        flex: 1 1 calc(33.33% - .65rem);
        min-width: 60px;
    }

    .hero-stat-value {
        font-size: 1.2rem;
    }

    .hero-stat-label {
        font-size: .7rem;
    }

    /* List */
    .faq-list-section {
        padding: 2.5rem 0;
    }

    .faq-question {
        padding: .9rem 1rem;
        gap: .6rem;
    }

    .faq-q-num {
        font-size: .82rem;
        min-width: 22px;
    }

    .faq-q-text {
        font-size: .9rem;
    }

    .faq-q-toggle {
        width: 26px;
        height: 26px;
        font-size: .7rem;
    }

    .faq-answer-inner {
        padding: .85rem 1rem 1.1rem 1rem;
        font-size: .88rem;
    }

    .cat-header-icon {
        width: 38px;
        height: 38px;
        font-size: .95rem;
        border-radius: 10px;
    }

    .cat-header-title {
        font-size: 1.05rem;
    }

    .empty-actions {
        flex-direction: column;
        width: 100%;
    }

        .empty-actions .btn {
            width: 100%;
            justify-content: center;
        }

    .faq-cta-card {
        padding: 2rem 1.25rem;
    }

    .cta-title {
        font-size: 1.3rem;
    }

    .cta-desc {
        font-size: .88rem;
    }
}

/* ━━━━━━━━━ Extra Small ≤ 360px ━━━━━━━━━ */
@media (max-width: 360px) {
    .faq-hero-title {
        font-size: 1.25rem;
    }

    .faq-hero-stats {
        flex-direction: column;
        align-items: stretch;
    }

    .hero-stat {
        flex: 1 1 100%;
        padding: .35rem 0;
        border-bottom: 1px solid var(--border);
    }

        .hero-stat:last-child {
            border-bottom: none;
        }

    .faq-question {
        padding: .85rem .85rem;
    }

    .faq-q-text {
        font-size: .85rem;
    }
}
