/* ============================================
   BTrade AI - FAQ Section
   ============================================ */

/* FAQ Section Container */
.btrade-faq-section {
    position: relative;
    width: 100%;
    background: var(--btrade-bg-dark, #0a0a0f);
    padding: 20px 40px 60px;
    font-family: "Inter", "IBM Plex Sans Arabic", sans-serif;
    color: var(--btrade-text-primary, #ffffff);
    overflow: hidden;
}

.btrade-faq-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(33, 150, 243, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(33, 150, 243, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
    z-index: 0;
}

.btrade-faq-container {
    position: relative;
    max-width: 1400px;
    margin: 0 auto;
    z-index: 1;
}

/* ============================================
   HEADER SECTION
   ============================================ */
.btrade-faq-header {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 60px;
    margin-bottom: 60px;
    align-items: start;
}

.btrade-faq-title {
    font-family: "Poppins", "Cairo", sans-serif;
    font-size: 42px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--btrade-text-primary, #ffffff);
    margin-bottom: 30px;
}

.btrade-faq-title .gradient-text {
    background: linear-gradient(135deg, var(--btrade-primary, #2196F3), var(--btrade-accent, #00BCD4));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Search Box */
.btrade-faq-search {
    position: relative;
    max-width: 500px;
}

.btrade-faq-search .search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--btrade-text-muted, #5a5a6e);
    transition: color 0.3s;
}

.btrade-faq-search input {
    width: 100%;
    padding: 14px 16px 14px 48px;
    background: rgba(17, 17, 24, 0.8);
    border: 1px solid rgba(33, 150, 243, 0.2);
    border-radius: 12px;
    color: var(--btrade-text-primary, #ffffff);
    font-size: 14px;
    font-family: "Inter", sans-serif;
    outline: none;
    transition: all 0.3s;
    backdrop-filter: blur(10px);
}

.btrade-faq-search input::placeholder {
    color: var(--btrade-text-muted, #5a5a6e);
}

.btrade-faq-search input:focus {
    border-color: var(--btrade-primary, #2196F3);
    box-shadow: 0 0 20px rgba(33, 150, 243, 0.15);
}

.btrade-faq-search input:focus + .search-icon {
    color: var(--btrade-primary, #2196F3);
}

/* Support Text */
.btrade-faq-support {
    position: relative;
    padding-top: 10px;
}

.btrade-faq-support p {
    font-size: 14px;
    line-height: 1.7;
    color: var(--btrade-text-secondary, #8b8b9e);
}

.btrade-faq-support .support-link {
    color: var(--btrade-primary-light, #64B5F6);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.btrade-faq-support .support-link:hover {
    color: var(--btrade-primary, #2196F3);
    text-decoration: underline;
}

.btrade-faq-support .arrow-icon {
    position: absolute;
    top: 50%;
    right: -20px;
    transform: translateY(-50%) rotate(-45deg);
    color: var(--btrade-primary, #2196F3);
    opacity: 0.6;
}

/* ============================================
   BODY SECTION - Categories & FAQs
   ============================================ */
.btrade-faq-body {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 40px;
    margin-bottom: 60px;
}

/* Categories Sidebar */
.btrade-faq-categories {
    background: rgba(17, 17, 24, 0.6);
    border: 1px solid rgba(33, 150, 243, 0.1);
    border-radius: 16px;
    padding: 24px;
    height: fit-content;
    backdrop-filter: blur(10px);
}

.categories-title {
    font-family: "Poppins", "Cairo", sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: var(--btrade-text-primary, #ffffff);
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.categories-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.category-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    color: var(--btrade-text-secondary, #8b8b9e);
    font-size: 13px;
    font-weight: 500;
    font-family: "Inter", sans-serif;
    cursor: pointer;
    transition: all 0.3s;
    text-align: left;
}

.category-btn:hover {
    background: rgba(33, 150, 243, 0.1);
    border-color: rgba(33, 150, 243, 0.2);
    color: var(--btrade-text-primary, #ffffff);
}

.category-btn.active {
    background: linear-gradient(135deg, var(--btrade-primary, #2196F3), var(--btrade-primary-dark, #1976D2));
    border-color: transparent;
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(33, 150, 243, 0.3);
}

.category-btn svg {
    opacity: 0.5;
    transition: transform 0.3s;
}

.category-btn:hover svg,
.category-btn.active svg {
    opacity: 1;
    transform: translateX(3px);
}

/* ============================================
   FAQ CONTENT AREA
   ============================================ */
.btrade-faq-content {
    background: rgba(17, 17, 24, 0.6);
    border: 1px solid rgba(33, 150, 243, 0.1);
    border-radius: 16px;
    padding: 32px;
    backdrop-filter: blur(10px);
}

.faq-content-title {
    font-family: "Poppins", "Cairo", sans-serif;
    font-size: 18px;
    font-weight: 600;
    color: var(--btrade-text-primary, #ffffff);
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* FAQ Category Groups */
.faq-category-group {
    display: none;
}

.faq-category-group.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Individual FAQ Item */
.faq-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    overflow: hidden;
}

.faq-item:last-child {
    border-bottom: none;
}

.faq-question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 20px 0;
    background: none;
    border: none;
    color: var(--btrade-text-primary, #ffffff);
    font-size: 15px;
    font-weight: 500;
    font-family: "Inter", sans-serif;
    text-align: left;
    cursor: pointer;
    transition: color 0.3s;
}

.faq-question:hover {
    color: var(--btrade-primary-light, #64B5F6);
}

.faq-question span {
    flex: 1;
    padding-right: 20px;
}

.faq-icon {
    flex-shrink: 0;
    color: var(--btrade-text-muted, #5a5a6e);
    transition: all 0.3s;
}

.faq-item.active .faq-icon {
    transform: rotate(45deg);
    color: var(--btrade-primary, #2196F3);
}

/* FAQ Answer */
.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.4s ease;
}

.faq-item.active .faq-answer {
    max-height: 500px;
    padding-bottom: 20px;
}

.faq-answer-content {
    font-size: 14px;
    line-height: 1.8;
    color: var(--btrade-text-secondary, #8b8b9e);
    padding-right: 40px;
}

/* Search Highlight */
.faq-answer-content .highlight {
    background: rgba(33, 150, 243, 0.3);
    color: var(--btrade-text-primary, #ffffff);
    padding: 2px 4px;
    border-radius: 4px;
}

/* No Results Message */
.no-results {
    text-align: center;
    padding: 60px 20px;
    color: var(--btrade-text-muted, #5a5a6e);
}

.no-results svg {
    width: 48px;
    height: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* ============================================
   FOOTER CTA SECTION
   ============================================ */
.btrade-faq-footer {
    background: rgba(17, 17, 24, 0.8);
    border: 1px solid rgba(33, 150, 243, 0.15);
    border-radius: 16px;
    padding: 32px 40px;
    backdrop-filter: blur(20px);
}

.faq-footer-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
}

.faq-footer-text h4 {
    font-family: "Poppins", "Cairo", sans-serif;
    font-size: 18px;
    font-weight: 600;
    color: var(--btrade-text-primary, #ffffff);
    margin-bottom: 8px;
}

.faq-footer-text p {
    font-size: 14px;
    color: var(--btrade-text-secondary, #8b8b9e);
}

.faq-footer-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    background: linear-gradient(135deg, var(--btrade-primary, #2196F3), var(--btrade-primary-dark, #1976D2));
    border: none;
    border-radius: 12px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    font-family: "Inter", sans-serif;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(33, 150, 243, 0.3);
    white-space: nowrap;
}

.faq-footer-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(33, 150, 243, 0.4);
}

.faq-footer-btn svg {
    transition: transform 0.3s;
}

.faq-footer-btn:hover svg {
    transform: translateX(3px);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 1024px) {
    .btrade-faq-section {
        padding: 60px 20px;
    }

    .btrade-faq-header {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .btrade-faq-support .arrow-icon {
        display: none;
    }

    .btrade-faq-body {
        grid-template-columns: 1fr;
    }

    .btrade-faq-categories {
        order: 2;
    }

    .btrade-faq-content {
        order: 1;
    }

    .categories-nav {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .category-btn {
        flex: 1;
        min-width: 200px;
    }
}

@media (max-width: 768px) {
    .btrade-faq-title {
        font-size: 32px;
    }

    .btrade-faq-content {
        padding: 24px;
    }

    .faq-question {
        font-size: 14px;
        padding: 16px 0;
    }

    .faq-answer-content {
        font-size: 13px;
        padding-right: 20px;
    }

    .faq-footer-content {
        flex-direction: column;
        text-align: center;
    }

    .faq-footer-btn {
        width: 100%;
        justify-content: center;
    }

    .categories-nav {
        flex-direction: column;
    }

    .category-btn {
        min-width: 100%;
    }
}

/* RTL Support for Arabic */
[dir="rtl"] .btrade-faq-search .search-icon {
    left: auto;
    right: 16px;
}

[dir="rtl"] .btrade-faq-search input {
    padding: 14px 48px 14px 16px;
}

[dir="rtl"] .btrade-faq-support .arrow-icon {
    right: auto;
    left: -20px;
    transform: translateY(-50%) rotate(135deg);
}

[dir="rtl"] .faq-question span {
    padding-right: 0;
    padding-left: 20px;
}

[dir="rtl"] .faq-answer-content {
    padding-right: 0;
    padding-left: 40px;
}

[dir="rtl"] .category-btn svg {
    transform: scaleX(-1);
}

[dir="rtl"] .category-btn:hover svg,
[dir="rtl"] .category-btn.active svg {
    transform: scaleX(-1) translateX(3px);
}