/* ============================================
   FAQ PAGE - FINAL COMPLETE STYLES
   ============================================ */

/* ===== PAGE HERO ===== */
.faq-hero {
    background: url('../images/project-team.jpg') center/cover no-repeat;
    min-height: 550px;
    padding-top: 130px;
    position: relative;
}

.faq-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(6, 20, 46, 0.95) 0%, rgba(6, 20, 46, 0.7) 100%);
}

.faq-hero .container {
    position: relative;
    z-index: 2;
}

.faq-hero .page-hero-content {
    max-width: 750px;
    color: var(--white);
}

/* ===== SEARCH SECTION ===== */
.faq-search-section {
    padding: 60px 0 40px;
    background: var(--bg-light);
    margin-top: -40px;
    position: relative;
    z-index: 3;
}

.search-box {
    position: relative;
    max-width: 700px;
    margin: 0 auto;
    background: var(--white);
    border-radius: 60px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    border: 2px solid var(--border);
    transition: all 0.3s ease;
    overflow: hidden;
}

.search-box:focus-within {
    border-color: var(--primary);
    box-shadow: 0 10px 40px rgba(246, 199, 68, 0.15);
}

.search-icon {
    position: absolute;
    top: 50%;
    right: 25px;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.2rem;
    transition: color 0.3s ease;
    z-index: 2;
}

.search-box:focus-within .search-icon {
    color: var(--primary);
}

.search-box input {
    width: 100%;
    padding: 20px 60px 20px 60px;
    border: none;
    outline: none;
    font-family: var(--font);
    font-size: 1.05rem;
    color: var(--text);
    background: transparent;
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.search-clear {
    position: absolute;
    top: 50%;
    left: 20px;
    transform: translateY(-50%);
    background: var(--bg-light);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    color: var(--text-muted);
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 2;
}

.search-clear:hover {
    background: var(--primary);
    color: var(--white);
}

.search-clear.visible {
    display: flex;
}

.search-stats {
    text-align: center;
    margin-top: 20px;
    font-size: 0.92rem;
    color: var(--text-light);
}

.search-stats span {
    background: var(--white);
    padding: 6px 18px;
    border-radius: 50px;
    border: 1px solid var(--border);
}

/* ===== FAQ MAIN SECTION ===== */
.faq-main-section {
    padding: 80px 0;
    background: var(--white);
}

.faq-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 50px;
    align-items: start;
}

/* --- Sidebar --- */
.faq-sidebar {
    position: sticky;
    top: 100px;
}

.sidebar-card {
    background: var(--white);
    padding: 25px;
    border-radius: 16px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.06);
    border: 1px solid var(--border);
    margin-bottom: 20px;
}

.sidebar-card h3,
.sidebar-card h4 {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--dark);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-card h3 i,
.sidebar-card h4 i {
    color: var(--primary);
}

.category-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.category-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: var(--bg-light);
    border: 2px solid transparent;
    border-radius: 10px;
    font-family: var(--font);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: right;
    width: 100%;
}

.category-btn i {
    color: var(--text-muted);
    font-size: 1rem;
    width: 20px;
    text-align: center;
    transition: color 0.3s ease;
}

.category-btn span {
    flex: 1;
}

.category-count {
    background: var(--white);
    padding: 3px 10px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    transition: all 0.3s ease;
}

.category-btn:hover {
    background: var(--primary-light);
    border-color: var(--primary);
}

.category-btn:hover i {
    color: var(--primary);
}

.category-btn.active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.category-btn.active i {
    color: var(--white);
}

.category-btn.active .category-count {
    background: var(--white);
    color: var(--primary);
}

.help-card p {
    font-size: 0.92rem;
    color: var(--text-light);
    line-height: 1.7;
    margin-bottom: 18px;
}

.help-card .btn {
    width: 100%;
    justify-content: center;
}

/* --- FAQ Content --- */
.faq-header {
    margin-bottom: 35px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--bg-light);
}

.faq-header h2 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--dark);
    margin-bottom: 8px;
}

.faq-header p {
    font-size: 1rem;
    color: var(--text-light);
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.faq-category-group {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ===== FAQ ITEM - آکاردئون ===== */
.faq-item {
    background: var(--white);
    border: 2px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.faq-item:hover {
    border-color: var(--primary);
}

.faq-item.active {
    border-color: var(--primary);
    background: #fffdf8;
    box-shadow: 0 10px 30px rgba(246, 199, 68, 0.12);
}

.faq-question {
    width: 100%;
    padding: 22px 25px;
    background: none;
    border: none;
    font-family: var(--font);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s ease;
    text-align: right;
}

.question-text {
    flex: 1;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--dark);
    text-align: right;
    transition: color 0.3s ease;
}

.faq-item.active .question-text {
    color: var(--primary);
}

.question-badge {
    background: var(--primary-light);
    color: var(--primary);
    padding: 4px 14px;
    border-radius: 50px;
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}

.faq-question > i {
    color: var(--primary);
    font-size: 0.85rem;
    width: 32px;
    height: 32px;
    background: var(--primary-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s ease;
    flex-shrink: 0;
}

.faq-item.active .faq-question > i {
    transform: rotate(180deg);
    background: var(--primary);
    color: var(--white);
}

/* ===== پاسخ آکاردئون - اصلاح کامل ===== */
.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.6s ease;
}

.faq-item.active .faq-answer {
    max-height: 1000px;  /* ← افزایش برای نمایش کامل متن */
}

.answer-content {
    padding: 20px 30px 30px 30px;
    color: var(--text);  /* ← رنگ تیره برای خوانایی */
    font-size: 1rem;
    line-height: 2;
    text-align: right;
    direction: rtl;
}

.answer-content p {
    margin-bottom: 18px;
    text-align: right;
    color: var(--text);  /* ← تضمین رنگ متن */
    font-size: 1rem;
    line-height: 2;
}

.answer-content p:last-child {
    margin-bottom: 0;
}

.answer-content strong {
    color: var(--dark);
    font-weight: 700;
}

/* ===== لیست‌ها - اصلاح کامل ===== */
.answer-content ul,
.answer-content ol {
    list-style: none !important;
    padding: 0 !important;
    margin: 20px 0 !important;
}

.answer-content ul li,
.answer-content ol li {
    position: relative;
    padding: 12px 40px 12px 15px !important;
    margin-bottom: 10px !important;
    font-size: 0.98rem !important;
    line-height: 1.9 !important;
    color: var(--text) !important;
    text-align: right !important;
    background: var(--bg-light) !important;
    border-radius: 8px !important;
    border-right: 3px solid var(--primary) !important;
}

/* Bullet سفارشی برای ul */
.answer-content ul li::before {
    content: '✓';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary);
    font-weight: bold;
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

/* شماره‌گذاری سفارشی برای ol */
.answer-content ol {
    counter-reset: faq-counter;
}

.answer-content ol li {
    counter-increment: faq-counter;
}

.answer-content ol li::before {
    content: counter(faq-counter);
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary);
    color: var(--white);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 800;
}

.answer-content ul li:hover,
.answer-content ol li:hover {
    background: var(--primary-light) !important;
    transform: translateX(-5px);
    transition: all 0.3s ease;
}

.answer-content ul li:last-child,
.answer-content ol li:last-child {
    margin-bottom: 0 !important;
}

/* --- No Results --- */
.no-results {
    text-align: center;
    padding: 60px 30px;
    background: var(--bg-light);
    border-radius: 16px;
    border: 2px dashed var(--border);
}

.no-results-icon {
    width: 80px;
    height: 80px;
    background: var(--primary-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 2rem;
    color: var(--primary);
}

.no-results h3 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--dark);
    margin-bottom: 12px;
}

.no-results p {
    font-size: 1rem;
    color: var(--text-light);
    margin-bottom: 25px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

/* ===== ASK QUESTION SECTION ===== */
.ask-question {
    padding: 100px 0;
    background: var(--bg-light);
}

.ask-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.ask-content .section-subtitle {
    padding: 0;
    display: inline-block;
}

.ask-content .section-subtitle::before,
.ask-content .section-subtitle::after {
    display: none;
}

.ask-content h2 {
    font-size: 2.3rem;
    font-weight: 800;
    color: var(--dark);
    margin: 15px 0 20px;
    line-height: 1.4;
}

.ask-content p {
    font-size: 1.05rem;
    color: var(--text-light);
    line-height: 2;
    margin-bottom: 30px;
}

.ask-features {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.ask-feature {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--dark);
}

.ask-feature i {
    color: var(--primary);
    font-size: 1.3rem;
}

/* --- Ask Form --- */
.ask-form-container {
    background: var(--white);
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--border);
}

.ask-form .form-group {
    margin-bottom: 20px;
}

.ask-form label {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 10px;
}

.required {
    color: #ef4444;
}

.ask-form .input-wrapper {
    position: relative;
}

.ask-form .input-wrapper i {
    position: absolute;
    top: 50%;
    right: 18px;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.95rem;
    pointer-events: none;
}

.textarea-wrapper i {
    top: 20px !important;
    transform: none !important;
}

.ask-form .input-wrapper input,
.ask-form .input-wrapper select,
.ask-form .input-wrapper textarea {
    width: 100%;
    padding: 14px 48px 14px 18px;
    border: 2px solid var(--border);
    border-radius: 10px;
    font-family: var(--font);
    font-size: 0.95rem;
    color: var(--text);
    background: var(--white);
    transition: all 0.3s ease;
    outline: none;
}

.ask-form .input-wrapper textarea {
    padding-top: 18px;
    resize: vertical;
    min-height: 120px;
}

.ask-form .input-wrapper input:focus,
.ask-form .input-wrapper select:focus,
.ask-form .input-wrapper textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(246, 199, 68, 0.1);
}

.ask-form .btn-block {
    width: 100%;
    justify-content: center;
    padding: 15px;
    font-size: 1rem;
    margin-top: 10px;
}

.form-success {
    display: none;
    background: #FFF7DF;
    border: 1px solid #F3DEA0;
    color: #73510A;
    padding: 16px 20px;
    border-radius: 10px;
    margin-top: 20px;
    align-items: center;
    gap: 12px;
    animation: slideDown 0.4s ease;
}

.form-success.show {
    display: flex;
}

.form-success i {
    font-size: 1.5rem;
    color: #F6C744;
}

.form-success p {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 500;
}

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

/* ===== POPULAR QUESTIONS ===== */
.popular-questions {
    padding: 100px 0;
    background: var(--white);
}

.popular-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
}

.popular-card {
    background: var(--white);
    padding: 30px 25px;
    border-radius: 16px;
    border: 1px solid var(--border);
    transition: all 0.4s ease;
    text-align: center;
}

.popular-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
    border-color: var(--primary);
}

.popular-icon {
    width: 65px;
    height: 65px;
    background: var(--primary-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 18px;
    font-size: 1.5rem;
    color: var(--primary);
    transition: all 0.4s ease;
}

.popular-card:hover .popular-icon {
    background: var(--primary);
    color: var(--white);
    transform: rotate(360deg);
}

.popular-card h4 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 15px;
    line-height: 1.6;
}

.popular-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--primary);
    font-size: 0.9rem;
    font-weight: 700;
    transition: gap 0.3s ease;
}

.popular-link:hover {
    gap: 12px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .faq-layout {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .faq-sidebar {
        position: static;
    }

    .category-list {
        flex-direction: row;
        flex-wrap: wrap;
    }

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

    .ask-wrapper {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .popular-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .faq-hero h1 {
        font-size: 2.2rem;
    }

    .faq-header h2 {
        font-size: 1.6rem;
    }

    .faq-question {
        padding: 18px 18px;
        gap: 10px;
    }

    .question-text {
        font-size: 0.95rem;
    }

    .question-badge {
        display: none;
    }

    .faq-question > i {
        width: 28px;
        height: 28px;
    }

    .answer-content {
        padding: 15px 20px 20px 20px;
        font-size: 0.92rem;
    }

    .category-list {
        flex-direction: column;
    }

    .category-btn {
        min-width: auto;
    }

    .ask-content h2 {
        font-size: 1.8rem;
    }

    .ask-form-container {
        padding: 25px;
    }

    .popular-grid {
        grid-template-columns: 1fr;
    }

    .search-box input {
        padding: 16px 50px 16px 50px;
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    .faq-search-section {
        padding: 40px 0 30px;
    }

    .faq-main-section {
        padding: 50px 0;
    }

    .ask-question {
        padding: 60px 0;
    }

    .popular-questions {
        padding: 60px 0;
    }

    .cta-actions {
        flex-direction: column;
        align-items: center;
    }

    .cta-actions .btn {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }
}