/* ==========================================================================
   TECHNICAL ACCESSIBLE FAQ STYLES — Premium Glassmorphic Accordion (v7)
   ========================================================================== */

.faq-section,
#faq {
    position: relative;
    background-color: #ffffff !important;
    background: #ffffff !important;
    overflow: hidden;
}

body.bg-dark-faq {
    background-color: var(--color-bg-dark);
    color: var(--color-text-light);
}

.faq-container {
    max-width: 850px;
    margin: 0 auto;
}

.faq-accordion {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin-bottom: var(--spacing-xl);
}

.faq-item {
    background: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
    overflow: hidden;
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Glassmorphic dark version for dark pages */
body.bg-dark-faq .faq-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.faq-item:hover {
    transform: translateY(-2px);
    border-color: rgba(0, 98, 184, 0.3);
    box-shadow: 0 8px 30px rgba(0, 98, 184, 0.06);
}

body.bg-dark-faq .faq-item:hover {
    border-color: rgba(255, 106, 0, 0.3);
    box-shadow: 0 10px 35px rgba(255, 106, 0, 0.08);
}

/* Active Glow States */
.faq-item.active {
    border-color: var(--color-primary);
    box-shadow: 0 10px 35px rgba(0, 98, 184, 0.08);
}

body.bg-dark-faq .faq-item.active {
    border-color: var(--color-accent);
    box-shadow: 0 12px 40px rgba(255, 106, 0, 0.15);
}

/* Accordion Question (Toggle Button) */
.faq-question {
    width: 100%;
    text-align: inherit;
    padding: 1.4rem 1.8rem;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--color-text-dark);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    background: none;
    border: none;
    cursor: pointer;
    outline: none;
}

body.bg-dark-faq .faq-question {
    color: var(--color-text-light);
}

.faq-question-text {
    font-family: inherit;
    line-height: 1.4;
}

/* Beautiful custom chevron icon */
.faq-chevron {
    width: 20px;
    height: 20px;
    color: var(--color-text-muted);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), color 0.3s ease;
    flex-shrink: 0;
}

body.bg-dark-faq .faq-chevron {
    color: var(--color-text-light-muted);
}

.faq-item.active .faq-chevron {
    transform: rotate(180deg);
    color: var(--color-primary);
}

body.bg-dark-faq .faq-item.active .faq-chevron {
    color: var(--color-accent);
}

/* Dynamic Smooth CSS Grid Accordion Height Transition */
.faq-answer-wrapper {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.35s cubic-bezier(0.25, 1, 0.3, 1), padding 0.35s ease;
    overflow: hidden;
    padding: 0 1.8rem;
}

.faq-item.active .faq-answer-wrapper {
    grid-template-rows: 1fr;
    padding: 0 1.8rem 1.6rem 1.8rem;
}

.faq-answer-inner {
    min-height: 0;
    font-size: 1.02rem;
    color: var(--color-text-muted);
    line-height: 1.8;
}

body.bg-dark-faq .faq-answer-inner {
    color: var(--color-text-light-muted);
}

/* Standalone FAQ page styles */
body.bg-light-faq {
    background-color: #ffffff !important;
    color: var(--color-text-dark) !important;
}

/* Force site header to look scrolled/dark on light FAQ pages even at the very top */
body.bg-light-faq .site-header:not(.scrolled) {
    background-color: rgba(255, 255, 255, 0.95) !important;
    border-bottom: 1px solid rgba(226, 232, 240, 0.8) !important;
    box-shadow: 0 10px 30px rgba(0, 98, 184, 0.04) !important;
}

body.bg-light-faq .site-header:not(.scrolled) .nav-link {
    color: var(--color-text-dark) !important;
}

body.bg-light-faq .site-header:not(.scrolled) .nav-link.active {
    color: var(--color-primary) !important;
}

body.bg-light-faq .site-header:not(.scrolled) .logo-text-blue {
    color: var(--color-primary) !important;
}

body.bg-light-faq .site-header:not(.scrolled) .logo-link {
    color: var(--color-text-dark) !important;
}

body.bg-light-faq .site-header:not(.scrolled) .lang-toggle {
    color: var(--color-primary) !important;
    border-color: rgba(0, 98, 184, 0.2) !important;
    background-color: var(--color-primary-light) !important;
}

body.bg-light-faq .site-header:not(.scrolled) .mobile-menu-toggle span {
    background-color: var(--color-text-dark) !important;
}

.faq-hero {
    position: relative;
    background: radial-gradient(circle at top right, rgba(0, 98, 184, 0.06) 0%, transparent 45%),
                radial-gradient(circle at bottom left, rgba(255, 106, 0, 0.04) 0%, transparent 45%),
                #ffffff;
    padding-top: 170px;
    padding-bottom: 70px;
    color: var(--color-text-dark) !important;
    text-align: center;
    overflow: hidden;
    border-bottom: 1px solid var(--color-border);
}

.faq-hero::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: radial-gradient(rgba(0, 98, 184, 0.06) 1px, transparent 0);
    background-size: 24px 24px;
    opacity: 0.8;
    pointer-events: none;
}

.faq-hero-title {
    font-size: clamp(2.2rem, 5vw, 3.4rem);
    font-weight: 900;
    margin-bottom: var(--spacing-sm);
    background: linear-gradient(135deg, var(--color-text-dark) 40%, var(--color-primary-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.faq-hero-desc {
    color: var(--color-text-muted);
    font-size: 1.15rem;
    max-width: 680px;
    margin: 0 auto;
}

/* Real-time search filter styling */
.faq-search-wrapper {
    max-width: 650px;
    margin: -35px auto 40px auto;
    position: relative;
    z-index: 10;
    padding: 0 var(--spacing-sm);
}

.faq-search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.faq-search-icon {
    position: absolute;
    color: #94a3b8;
    pointer-events: none;
    transition: color 0.3s ease;
}

html[lang="ar"] .faq-search-icon { right: 20px; }
html[lang="en"] .faq-search-icon { left: 20px; }

.faq-search-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--color-border);
    border-radius: 100px;
    font-size: 1.05rem;
    color: var(--color-text-dark);
    box-shadow: 0 15px 35px rgba(0, 98, 184, 0.08);
    transition: all 0.3s ease;
    font-family: inherit;
}

html[lang="ar"] .faq-search-input { padding: 1.1rem 3.5rem 1.1rem 1.8rem; }
html[lang="en"] .faq-search-input { padding: 1.1rem 1.8rem 1.1rem 3.5rem; }

.faq-search-input:focus {
    background: #ffffff;
    border-color: var(--color-primary);
    box-shadow: 0 15px 40px rgba(0, 98, 184, 0.15), 0 0 0 4px rgba(0, 98, 184, 0.1);
    outline: none;
}

.faq-search-input:focus + .faq-search-icon {
    color: var(--color-primary);
}

/* Category Filter Tabs styling */
.faq-filter-tabs {
    display: flex;
    justify-content: center;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
    margin-bottom: 3.5rem;
}

.faq-filter-tab {
    padding: 0.65rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--color-text-muted);
    border-radius: 100px;
    border: 1px solid var(--color-border);
    background-color: var(--color-bg-pure);
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.faq-filter-tab:hover {
    color: var(--color-primary);
    border-color: rgba(0, 98, 184, 0.4);
    background-color: var(--color-primary-light);
}

.faq-filter-tab.active {
    background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-dark) 100%);
    color: #ffffff !important;
    border-color: var(--color-accent-dark);
    box-shadow: 0 4px 15px rgba(255, 106, 0, 0.25);
}

/* Category Sections on standalone hub */
.faq-category-section {
    margin-bottom: 4rem;
}

.faq-category-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--color-text-dark);
    margin-bottom: 1.75rem;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 2px solid var(--color-border);
    padding-bottom: 0.75rem;
}

.faq-category-title svg {
    color: var(--color-accent);
}

/* Smooth filtering transition */
.faq-item.hidden {
    display: none !important;
}

/* Bottom CTA section on Homepage FAQ */
.faq-cta-wrap {
    text-align: center;
    margin-top: 2.5rem;
}

@media (max-width: 768px) {
    .faq-question {
        padding: 1.15rem 1.4rem;
        font-size: 1.05rem;
    }
    .faq-answer-wrapper {
        padding: 0 1.4rem;
    }
    .faq-item.active .faq-answer-wrapper {
        padding: 0 1.4rem 1.3rem 1.4rem;
    }
    .faq-search-wrapper {
        margin-top: -25px;
    }
    .faq-filter-tabs {
        gap: 8px;
    }
    .faq-filter-tab {
        padding: 0.5rem 1.15rem;
        font-size: 0.88rem;
    }
}

/* Premium Brand Orange Gradient CTA Banner for the Light FAQ page */
body.bg-light-faq .cta-container {
    background: linear-gradient(135deg, #e04f00 0%, #ff6a00 50%, #ff8c3a 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.25) !important;
    color: #ffffff !important;
    box-shadow: 0 25px 50px rgba(255, 106, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.3) !important;
}

body.bg-light-faq .cta-container::before {
    background-image: radial-gradient(rgba(255, 255, 255, 0.12) 1px, transparent 0) !important;
    background-size: 20px 20px !important;
    opacity: 0.9 !important;
}

body.bg-light-faq .cta-title {
    background: none !important;
    -webkit-text-fill-color: #ffffff !important;
    color: #ffffff !important;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.15) !important;
}

body.bg-light-faq .cta-desc {
    color: rgba(255, 255, 255, 0.95) !important;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.1) !important;
}

body.bg-light-faq .cta-container .btn-outline {
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.4) !important;
    background-color: rgba(255, 255, 255, 0.15) !important;
    backdrop-filter: blur(10px) !important;
}

body.bg-light-faq .cta-container .btn-outline:hover {
    background-color: #ffffff !important;
    color: #e04f00 !important;
    border-color: #ffffff !important;
    box-shadow: 0 10px 25px rgba(255, 106, 0, 0.2) !important;
}
