/* ====== فونت‌های سفارشی ====== */
@font-face {
    font-family: 'Dana';
    src: url('../fonts/Dana-Regular.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Morabba';
    src: url('../fonts/Morabba-Heavy.woff2') format('woff2');
    font-weight: 800;
    font-style: normal;
    font-display: swap;
}

/* متغیرهای رنگی */
:root {
    --bg-color: #0b0b13;
    --card-bg: #161625;
    --purple: #8a4af3;
    --purple-hover: #7234d6;
    --text-main: #ffffff;
    --text-muted: #a0a0b0;
    --border-color: #2a2a3e;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Dana', 'Vazirmatn', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.8;
    overflow-x: hidden;
}

h1, h2, h3, h4 {
    font-family: 'Morabba', 'Vazirmatn', sans-serif;
    font-weight: 800;
    line-height: 1.4;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; padding-right: 0; }

/* ====== ذرات پس‌زمینه ====== */
#particles-js {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* همه بخش‌ها بالای ذرات */
nav, header, main, article, section, footer {
    position: relative;
    z-index: 1;
}

/* ====== کرسر سفارشی ====== */
body.has-custom-cursor,
body.has-custom-cursor * {
    cursor: none !important;
}

body.no-custom-cursor,
body.no-custom-cursor * {
    cursor: auto;
}

.cursor-dot {
    position: fixed;
    top: 0;
    left: 0;
    width: 8px;
    height: 8px;
    background-color: var(--purple);
    border-radius: 50%;
    pointer-events: none;
    z-index: 99999;
    transition: opacity 0.3s ease, width 0.2s ease, height 0.2s ease, background-color 0.2s ease;
    box-shadow: 0 0 10px rgba(138, 74, 243, 0.8), 0 0 20px rgba(138, 74, 243, 0.5);
    will-change: transform;
}

.cursor-outline {
    position: fixed;
    top: 0;
    left: 0;
    width: 40px;
    height: 40px;
    border: 2px solid rgba(138, 74, 243, 0.6);
    border-radius: 50%;
    pointer-events: none;
    z-index: 99998;
    transition: opacity 0.3s ease, width 0.3s cubic-bezier(0.25, 1, 0.5, 1),
                height 0.3s cubic-bezier(0.25, 1, 0.5, 1),
                background-color 0.3s ease, border-color 0.3s ease;
    will-change: transform;
}

.cursor-outline.cursor-hover {
    width: 60px;
    height: 60px;
    background-color: rgba(138, 74, 243, 0.15);
    border-color: rgba(138, 74, 243, 1);
    box-shadow: 0 0 25px rgba(138, 74, 243, 0.6);
}

.cursor-dot.cursor-hover-dot {
    width: 12px;
    height: 12px;
    background-color: #b06ab3;
    box-shadow: 0 0 15px rgba(176, 106, 179, 0.9);
}

.cursor-outline.cursor-clicking {
    width: 30px;
    height: 30px;
    background-color: rgba(138, 74, 243, 0.3);
}

@media (hover: none) and (pointer: coarse) {
    .cursor-dot, .cursor-outline { display: none !important; }
    body, body * { cursor: auto !important; }
}

/* ====== منوی ناوبری ====== */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(11, 11, 19, 0.9);
    backdrop-filter: blur(10px);
    z-index: 1000;
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.logo img {
    height: 45px;
    width: auto;
    display: block;
}

.nav-links {
    display: flex;
    gap: 25px;
}

.nav-links a {
    color: var(--text-muted);
    transition: color 0.3s;
    font-weight: 500;
    font-size: 0.95rem;
    font-family: 'Dana', 'Vazirmatn', sans-serif;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--purple);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* دکمه تغییر زبان */
.lang-btn {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 45px;
    height: 45px;
    min-width: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    padding: 3px;
    overflow: hidden;
    flex-shrink: 0;
}
.lang-btn:hover {
    border-color: var(--purple);
    transform: scale(1.08);
}
.lang-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

.btn-icon {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: #fff;
    width: 45px;
    height: 45px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 1.2rem;
    border-radius: 50%;
}

.btn-icon:hover {
    border-color: var(--purple);
    color: var(--purple);
    box-shadow: 0 0 15px rgba(138, 74, 243, 0.5);
}

/* دکمه بازگشت به بالا */
.scroll-top {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 45px;
    height: 45px;
    background: var(--purple);
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 4px 15px rgba(138, 74, 243, 0.4);
    transition: all 0.3s;
    z-index: 1000;
}

.scroll-top:hover {
    background: var(--purple-hover);
    transform: translateY(-3px);
    box-shadow: 0 0 25px rgba(138, 74, 243, 0.7);
}

[dir="ltr"] .scroll-top {
    left: auto;
    right: 30px;
}

/* ====== هدر بلاگ ====== */
.blog-header {
    padding: 140px 0 60px;
    text-align: center;
    background: linear-gradient(180deg, rgba(138, 74, 243, 0.1) 0%, transparent 100%);
}

.blog-header h1 {
    font-size: 3rem;
    margin-bottom: 15px;
    background: linear-gradient(135deg, #fff, var(--purple));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.blog-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* ====== گرید مقالات ====== */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    padding: 40px 0 80px;
}

.post-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    overflow: hidden;
    transition: all 0.3s ease;
    transform-style: preserve-3d;
    will-change: transform;
}

.post-card:hover {
    border-color: var(--purple);
    box-shadow: 0 15px 40px rgba(138, 74, 243, 0.25);
}

.post-card a { display: block; }

.post-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.post-card:hover .post-image img {
    transform: scale(1.08);
}

.post-content { padding: 25px; }

.post-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 0.85rem;
    flex-wrap: wrap;
    gap: 8px;
}

.post-category {
    background: rgba(138, 74, 243, 0.2);
    color: var(--purple);
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-family: 'Dana', 'Vazirmatn', sans-serif;
}

.post-date {
    color: var(--text-muted);
    font-family: 'Dana', 'Vazirmatn', sans-serif;
}

.post-card h2 {
    font-size: 1.25rem;
    color: #fff;
    margin-bottom: 12px;
    line-height: 1.5;
}

.post-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 18px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.read-more {
    color: var(--purple);
    font-weight: 600;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: gap 0.3s;
}

.post-card:hover .read-more { gap: 14px; }

/* ====== صفحه مقاله تکی ====== */
.post-single { padding: 120px 0 60px; }

.post-header {
    text-align: center;
    margin-bottom: 40px;
}

.back-to-blog {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--purple);
    font-weight: 600;
    margin-bottom: 30px;
    font-family: 'Dana', 'Vazirmatn', sans-serif;
    transition: gap 0.3s;
}

.back-to-blog:hover { gap: 14px; }

.post-header .post-meta {
    justify-content: center;
    gap: 25px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.post-header .post-meta span {
    color: var(--text-muted);
    font-family: 'Dana', 'Vazirmatn', sans-serif;
}

.post-header h1 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    color: #fff;
}

.post-excerpt {
    color: var(--text-muted);
    font-size: 1.15rem;
    max-width: 700px;
    margin: 0 auto;
    font-family: 'Dana', 'Vazirmatn', sans-serif;
}

.post-featured-image {
    width: 100%;
    margin: 40px 0;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.post-featured-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* ====== محتوای مقاله ====== */
.post-body {
    max-width: 800px;
    margin: 0 auto;
    font-size: 1.1rem;
    line-height: 2;
    color: #d0d0dd;
    font-family: 'Dana', 'Vazirmatn', sans-serif;
}

.post-body p { margin-bottom: 25px; }

.post-body h2 {
    font-size: 1.8rem;
    color: #fff;
    margin: 45px 0 20px;
    padding-right: 15px;
    border-right: 4px solid var(--purple);
}

.post-body h3 {
    font-size: 1.4rem;
    color: var(--purple);
    margin: 30px 0 15px;
}

.post-body ul,
.post-body ol {
    margin: 20px 0;
    padding-right: 25px;
}

.post-body ul li,
.post-body ol li {
    margin-bottom: 10px;
    position: relative;
}

.post-body ul li::before {
    content: '•';
    color: var(--purple);
    font-weight: bold;
    position: absolute;
    right: -20px;
}

.post-body blockquote {
    background: rgba(138, 74, 243, 0.1);
    border-right: 4px solid var(--purple);
    padding: 20px 25px;
    margin: 30px 0;
    border-radius: 10px;
    color: #fff;
    font-style: italic;
    font-size: 1.1rem;
}

.post-body a {
    color: var(--purple);
    text-decoration: underline;
    font-weight: 600;
}

.post-body code {
    background: rgba(138, 74, 243, 0.15);
    padding: 3px 8px;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 0.95em;
    color: #b06ab3;
}

.post-body pre {
    background: #07070e;
    border: 1px solid var(--border-color);
    padding: 20px;
    border-radius: 10px;
    overflow-x: auto;
    margin: 25px 0;
    direction: ltr;
    text-align: left;
}

.post-body pre code {
    background: none;
    padding: 0;
    color: #e0e0e0;
}

.post-body img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 25px 0;
}

/* ====== اشتراک‌گذاری ====== */
.post-share {
    max-width: 800px;
    margin: 60px auto 0;
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.post-share p {
    color: var(--text-muted);
    margin-bottom: 15px;
    font-family: 'Dana', 'Vazirmatn', sans-serif;
}

.share-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.share-buttons a {
    width: 45px;
    height: 45px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-main);
    font-size: 1.1rem;
    transition: all 0.3s;
}

.share-buttons a:hover {
    background: var(--purple);
    border-color: var(--purple);
    transform: translateY(-3px);
    box-shadow: 0 0 20px rgba(138, 74, 243, 0.5);
}

.share-buttons a i {
    color: #fff !important;
}

/* ====== ناوبری بین مقالات ====== */
.post-navigation {
    max-width: 800px;
    margin: 50px auto 0;
    display: flex;
    gap: 20px;
}

.nav-next, .nav-prev {
    flex: 1;
    padding: 20px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    transition: all 0.3s;
    font-family: 'Dana', 'Vazirmatn', sans-serif;
}

.nav-next { text-align: left; }
.nav-prev { text-align: right; }

.nav-next:hover, .nav-prev:hover {
    border-color: var(--purple);
    box-shadow: 0 10px 30px rgba(138, 74, 243, 0.2);
}

.nav-next span, .nav-prev span {
    display: block;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 6px;
}

.nav-next strong, .nav-prev strong {
    color: #fff;
    font-size: 1rem;
}

/* ====== فوتر ====== */
.footer {
    background: #07070e;
    padding: 30px 0;
    text-align: center;
    border-top: 1px solid var(--border-color);
    margin-top: 60px;
}

.footer p {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-family: 'Dana', 'Vazirmatn', sans-serif;
}

/* ====== فونت انگلیسی ====== */
[lang="en"] body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

[lang="en"] p,
[lang="en"] a,
[lang="en"] span,
[lang="en"] li,
[lang="en"] div,
[lang="en"] button,
[lang="en"] h1,
[lang="en"] h2,
[lang="en"] h3,
[lang="en"] h4 {
    font-family: 'Inter', sans-serif;
}

[lang="en"] h1,
[lang="en"] h2,
[lang="en"] h3,
[lang="en"] h4,
[lang="en"] .blog-header h1,
[lang="en"] .post-card h2 {
    font-family: 'Space Grotesk', 'Inter', sans-serif;
    font-weight: 700;
}

[lang="en"] .fa,
[lang="en"] .fas,
[lang="en"] .fa-solid,
[lang="en"] i.fas,
[lang="en"] i.fa-solid {
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900 !important;
}

[lang="en"] .fab,
[lang="en"] .fa-brands,
[lang="en"] i.fab,
[lang="en"] i.fa-brands {
    font-family: "Font Awesome 6 Brands" !important;
    font-weight: 400 !important;
}

/* واکنش‌گرایی LTR */
[dir="ltr"] .scroll-top {
    left: auto;
    right: 30px;
}

[dir="ltr"] .post-body h2 {
    padding-right: 0;
    padding-left: 15px;
    border-right: none;
    border-left: 4px solid var(--purple);
}

[dir="ltr"] .post-body blockquote {
    border-right: none;
    border-left: 4px solid var(--purple);
}

[dir="ltr"] .post-body ul,
[dir="ltr"] .post-body ol {
    padding-right: 0;
    padding-left: 25px;
}

[dir="ltr"] .post-body ul li::before {
    right: auto;
    left: -20px;
}

/* ====== واکنش‌گرایی ====== */
@media (max-width: 768px) {
    .nav-links { display: none; }
    
    .blog-header {
        padding: 120px 0 40px;
    }
    
    .blog-header h1 { font-size: 2rem; }
    .blog-header p { font-size: 1rem; }
    
    .post-header h1 { font-size: 1.7rem; }
    .post-excerpt { font-size: 1rem; }
    
    .post-body {
        font-size: 1rem;
        line-height: 1.9;
    }
    
    .post-body h2 { font-size: 1.4rem; }
    .post-body h3 { font-size: 1.2rem; }
    
    .post-single { padding: 100px 0 40px; }
    
    .post-navigation { flex-direction: column; }
    
    #particles-js { opacity: 0.7; }
}
/* ========================================== */
/* ====== نشان‌های دانلود فروشگاه‌ها ====== */
/* ========================================== */

.download-badges {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin: 25px 0;
    justify-content: center;
}

.download-badges a {
    display: inline-block;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.download-badges a:hover {
    transform: translateY(-4px);
    opacity: 0.9;
}

.download-badges img {
    height: 65px;
    width: auto;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    display: block;
}

/* نمایش/مخفی کردن بر اساس زبان */
.download-badges .badge-fa {
    display: inline-block;
}

.download-badges .badge-en {
    display: none;
}

[lang="en"] .download-badges .badge-fa {
    display: none;
}

[lang="en"] .download-badges .badge-en {
    display: inline-block;
}

/* موبایل */
@media (max-width: 768px) {
    .download-badges {
        gap: 10px;
    }
    
    .download-badges img {
        height: 55px;
    }
}