:root {
    /* --- متغیرهای پیش‌فرض (Dark Mode) --- */
    --faq-bg: #1A1D2E;
    --faq-card-bg: rgba(34, 38, 57, 0.5); /* شیشه‌ای تیره */
    --faq-card-active: rgba(34, 38, 57, 0.95);
    --faq-border: rgba(255, 255, 255, 0.08);
    --faq-icon-bg: rgba(255, 255, 255, 0.05);
    --faq-text-main: #ffffff;
    --faq-text-sub: #A0A3B1;
    --faq-title-gradient: linear-gradient(135deg, #fff 30%, var(--primary-blue) 100%);
    --faq-shadow-active: 0 10px 40px -10px rgba(62, 105, 254, 0.2);
    --faq-alert-bg: rgba(255, 193, 7, 0.08);
    
    /* متغیرهای سراسری (فرض بر این است که در style.css تعریف شده‌اند، اینجا مقداردهی اولیه می‌کنیم) */
    --primary-blue: #3E69FE;
    --bg-dark: #0d0d12; 
}

/* --- تنظیمات مخصوص حالت لایت (Light Mode) --- */
:root[data-theme="light"] {
    --bg-dark: #f3f4f6; /* پس‌زمینه کلی روشن */
    --faq-card-bg: #ffffff; /* کارت سفید */
    --faq-card-active: #ffffff;
    --faq-border: rgba(0, 0, 0, 0.08);
    --faq-icon-bg: rgba(62, 105, 254, 0.1);
    --faq-text-main: #1f2937; /* متن تیره */
    --faq-text-sub: #4b5563; /* متن خاکستری */
    --faq-title-gradient: linear-gradient(135deg, var(--primary-blue) 0%, #111827 100%); /* گرادینت تیره برای دیده شدن روی سفید */
    --faq-shadow-active: 0 15px 30px -5px rgba(62, 105, 254, 0.15);
    --faq-alert-bg: rgba(255, 193, 7, 0.15);
}

/* --- Layout & Background --- */
.faq-page-main {
    background-color: var(--bg-dark);
    padding: clamp(3rem, 8vw, 5rem) 1rem;
    min-height: 80vh;
    background-image: 
        radial-gradient(circle at 0% 0%, rgba(62, 105, 254, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 100% 100%, rgba(147, 51, 234, 0.08) 0%, transparent 50%);
    transition: background-color 0.4s ease;
}

.faq-container {
    max-width: 850px;
    margin: 0 auto;
}

/* --- Header --- */
.faq-header {
    text-align: center;
    margin-bottom: 3.5rem;
}

.faq-title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 900;
    margin-bottom: 1rem;
    /* استفاده از متغیر گرادینت هوشمند */
    background: var(--faq-title-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.faq-subtitle {
    color: var(--faq-text-sub);
    font-size: 1.1rem;
}

/* --- Sections Animation --- */
.faq-section {
    margin-bottom: 3rem;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.faq-section:nth-child(2) { animation-delay: 0.1s; }
.faq-section:nth-child(3) { animation-delay: 0.2s; }
.faq-section:nth-child(4) { animation-delay: 0.3s; }

@keyframes fadeInUp {
    to { opacity: 1; transform: translateY(0); }
}

.faq-section-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--faq-text-main);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 12px;
}

.faq-section-title i {
    color: var(--primary-blue);
    background: rgba(62, 105, 254, 0.1);
    padding: 8px;
    border-radius: 8px;
    font-size: 1.1rem;
}

/* --- Accordion Items --- */
.faq-item {
    background: var(--faq-card-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--faq-border);
    border-radius: 16px;
    margin-bottom: 1rem;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05); /* سایه ملایم برای لایت مود */
}

.faq-item.active {
    background: var(--faq-card-active);
    border-color: rgba(62, 105, 254, 0.4);
    box-shadow: var(--faq-shadow-active);
    transform: scale(1.01);
}

/* --- Question Header --- */
.faq-question {
    padding: 1.5rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--faq-text-main);
    user-select: none;
    transition: color 0.3s;
}

.faq-item.active .faq-question {
    color: var(--primary-blue);
}

.faq-icon {
    width: 32px;
    height: 32px;
    background: var(--faq-icon-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--faq-text-sub);
    font-size: 0.9rem;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.faq-item.active .faq-icon {
    transform: rotate(180deg);
    background: var(--primary-blue);
    color: white;
    box-shadow: 0 0 15px rgba(62, 105, 254, 0.4);
}

/* --- Smooth Content Animation --- */
.faq-answer-wrapper {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.faq-item.active .faq-answer-wrapper {
    grid-template-rows: 1fr;
}

.faq-answer {
    overflow: hidden;
    color: var(--faq-text-sub);
    line-height: 1.8;
    font-size: 0.95rem;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.faq-item.active .faq-answer {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.1s;
}

.faq-answer-inner {
    padding: 0 1.5rem 1.5rem 1.5rem;
    border-top: 1px solid var(--faq-border);
    padding-top: 1rem;
}

/* --- Lists & Alerts --- */
.faq-answer ul, .faq-answer ol {
    margin-top: 0.8rem;
    padding-right: 1.2rem;
    border-right: 2px solid rgba(62, 105, 254, 0.3);
}

.faq-answer li {
    margin-bottom: 0.5rem;
}

.faq-alert {
    background: var(--faq-alert-bg);
    border: 1px dashed #ffc107;
    padding: 1rem;
    border-radius: 10px;
    margin-top: 1rem;
    color: #eab308; /* رنگ طلایی تیره‌تر برای خوانایی روی سفید */
    font-weight: 500;
}

/* در حالت دارک مود، رنگ متن آلرت روشن‌تر باشد */
:root:not([data-theme="light"]) .faq-alert {
    color: #ffd04e;
}

/* --- Text Highlight Effect --- */
.highlight {
    font-weight: 800;
    background: linear-gradient(90deg, #3E69FE 0%, #4facfe 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

/* در لایت مود سایه متن حذف شود تا تمیزتر دیده شود */
:root:not([data-theme="light"]) .highlight {
    text-shadow: 0 0 20px rgba(62, 105, 254, 0.4);
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .faq-question { padding: 1.2rem; font-size: 1rem; }
    .faq-answer-inner { padding: 0 1.2rem 1.2rem 1.2rem; }
}