/* رست پایه و تعریف فونت‌ها */
/* @import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@100;200;300;400;500;600;700;800;900&display=swap'); */
@font-face {
    font-family: 'Vazir';
    src: url('../content/font/Vazir-Black.woff2');
    font-display: swap;
}

/* رست استایل‌های پیش‌فرض مرورگر */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Vazir', sans-serif;
    font-weight: 100;
}

/* تعریف متغیرهای رنگ و سایر تنظیمات */
:root {
    /* رنگ‌های اصلی */
    --primary-color: #4f0dca;
    --primary-light: #7a3aff;
    --primary-dark: #3a0a9a;
    --accent-color: #b565ff;
    --accent-light: #ff8fa3;
    --accent-dark: #e64c6d;


    /* رنگ‌های متن */
    --text-color: #333;
    --text-light: #6c757d;

    /* رنگ‌های وضعیت */
    --success-color: #4cc9f0;
    --warning-color: #f8961e;
    --danger-color: #f72585;

    /* رنگ‌های پس‌زمینه */
    --bg-color: #0f0f1a;

    /* استایل‌های شیشه‌ای */
    --glass-bg: rgba(255, 255, 255, 0.15);
    --glass-border: 1px solid rgba(255, 255, 255, 0.18);

    /* سایه‌ها و انیمیشن */
    --shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
    --transition: all 0.3s ease;
}

/* استایل‌های پایه بدنه سایت */
body {
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    padding: 2rem;
    direction: rtl;
    /* جهت راست به چپ برای فارسی */
}

/* ذرات پس‌زمینه */
.particles-background {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

/* اشکال دکوراتیو */
.background {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.shape {
    position: absolute;
    border-radius: 30%;
    filter: blur(5px);
    opacity: 0.5;
}

.shape:nth-child(1) {
    width: 500px;
    height: 500px;
    background-color: #4f0dca;
    top: -100px;
    right: -100px;
}

.shape:nth-child(2) {
    width: 300px;
    height: 300px;
    background-color: #4f0dca;
    bottom: -100px;
    left: -100px;
}

/* اسکرول بار */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: rgb(0, 0, 0);
}

::-webkit-scrollbar-thumb {
    background-color: #3a0a9a;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-color);
}

/* استایل هدر صفحه */
.header {
    text-align: center;
    margin-bottom: 2.5rem;
    animation: fadeIn 0.8s ease;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.2);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.805);
    background-color: #05000479;
    backdrop-filter: blur(3px);
    border: 1px solid rgb(255, 255, 255);
    border-radius: 10px;
    border: none;
    outline: none;
    scroll-behavior: smooth;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    -moz-tap-highlight-color: transparent;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* عنوان اصلی هدر */
.hero-title {
    color: white;
    font-size: 1.9rem;
    margin-bottom: 1rem;
    border: none;
    outline: none;
    scroll-behavior: smooth;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    -moz-tap-highlight-color: transparent;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* بخشی از عنوان که رنگ متفاوت دارد */
.hero-title span {
    color: var(--primary-color);
    border-bottom: 2px solid white;
}

/* متن توضیحی هدر */
.header p {
    font-size: 1.1rem;
    color: white;
    max-width: 700px;
    margin: 0 auto;
}

/* استایل دکمه‌های هدر */
.hero-buttons {
    display: flex;
    gap: 1rem;
    border: none;
    outline: none;
    scroll-behavior: smooth;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    -moz-tap-highlight-color: transparent;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    margin-bottom: 20px;
}

/* استایل پایه دکمه‌ها */
.btn {
    display: inline-block;
    padding: 0.8rem 1.8rem;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    border: none;
    outline: none;
    scroll-behavior: smooth;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    -moz-tap-highlight-color: transparent;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* دکمه اصلی */
.btn-primary {
    background-color: var(--primary-color);
    color: rgb(255, 255, 255);
    border: 2px solid rgb(0, 0, 0);
}

/* افکت هنگام هاور روی دکمه */
.btn-primary:hover {
    background: transparent;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    color: white;
    border: 2px solid rgb(255, 255, 255);
}

/* استایل بخش جستجو */
.search-container {
    position: relative;
    max-width: 600px;
    margin: 0 auto 2rem;
    animation: slideUp 0.6s ease;
    border: none;
    outline: none;
    scroll-behavior: smooth;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    -moz-tap-highlight-color: transparent;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* آیکون جستجو */
.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    font-size: 1.1rem;
}

/* کادر جستجو */
.search-box {
    width: 100%;
    padding: 0.8rem 1rem 0.8rem 2.5rem;
    border: none;
    border-radius: 10px;
    background-color: rgba(0, 0, 0, 0.8);
    box-shadow: var(--shadow);
    font-size: 1rem;
    transition: var(--transition);
    border: 1px solid rgb(255, 255, 255);
    color: white;
}

/* استایل placeholder */
::placeholder {
    color: white;
}

/* استایل هنگام فوکوس روی کادر جستجو */
.search-box:focus {
    outline: none;
    background-color: var(--primary-color);
}

/* بخش فیلترها */
.filters {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-bottom: 2.5rem;
    animation: fadeIn 0.8s ease 0.2s both;
    border: none;
    outline: none;
    scroll-behavior: smooth;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    -moz-tap-highlight-color: transparent;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* دکمه‌های فیلتر */
.filter-btn {
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 10px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

/* افکت هاور روی دکمه فیلتر */
.filter-btn:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* استایل دکمه فیلتر فعال */
.filter-btn.active {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 5px 15px rgba(67, 97, 238, 0.3);
}

/* استایل کانتینر مقالات */
.articles-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* کارت مقاله */
.article-card {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.805);
    background-color: #05000479;
    backdrop-filter: blur(3px);
    border: 1px solid rgb(255, 255, 255);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
    border: var(--glass-border);
    transition: var(--transition);
    animation: fadeIn 0.8s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* افکت هاور روی کارت */
.article-card:hover {
    box-shadow: 0 15px 30px rgba(31, 38, 135, 0.2);
}

/* بخش تصویر کارت */
.article-image {
    height: 200px;
    background-size: cover;
    background-position: center;
    position: relative;
    overflow: hidden;
    border: none;
    outline: none;
    scroll-behavior: smooth;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    -moz-tap-highlight-color: transparent;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* افکت روی تصویر */
.article-image::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.3));
}

/* استایل تصویر */
.article-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

/* افکت زوم هنگام هاور روی تصویر */
.article-card:hover .article-image img {
    transform: scale(1.05);
}

/* محتوای کارت */
.article-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

/* تاریخ مقاله */
.article-date {
    font-size: 0.8rem;
    color: white;
    margin-bottom: 0.5rem;
    border: none;
    outline: none;
    scroll-behavior: smooth;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    -moz-tap-highlight-color: transparent;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* عنوان مقاله */
.article-title {
    font-size: 1.3rem;
    font-weight: 100;
    margin-bottom: 0.8rem;
    line-height: 1.4;
}

/* خلاصه مقاله */
.article-excerpt {
    color: white;
    margin-bottom: 1.5rem;
    flex-grow: 1;
    word-wrap: break-word;
    /* شکستن کلمات طولانی */
    overflow-wrap: break-word;
    /* استاندارد جدیدتر برای شکستن کلمات */
    white-space: normal;
    /* پیش‌فرض - متن در صورت نیاز خط را می‌شکند */
}

/* لینک مقاله */
.article-link {
    display: inline-flex;
    align-items: center;
    color: rgb(172, 81, 242);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    width: 110px;
    border: none;
    outline: none;
    scroll-behavior: smooth;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    -moz-tap-highlight-color: transparent;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* آیکون لینک */
.article-link i {
    margin-right: 0.5rem;
    font-size: 0.8rem;
}

/* افکت هاور روی لینک */
.article-link:hover {
    color: var(--secondary-color);
    transform: translateX(-5px);
}

/* استایل‌های مختلف برای دسته‌بندی‌ها */
.article-card[data-category="technology"] .article-image {
    background: linear-gradient(135deg, #ff9a9e 0%, #fad0c4 100%);
}

.article-card[data-category="programming"] .article-image {
    background: linear-gradient(135deg, #a1c4fd 0%, #c2e9fb 100%);
}

.article-card[data-category="design"] .article-image {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
}

.article-card[data-category="ai"] .article-image {
    background: linear-gradient(135deg, #84fab0 0%, #8fd3f4 100%);
}

/* پیام عدم وجود نتیجه */
.no-results {
    text-align: center;
    grid-column: 1 / -1;
    padding: 2rem;
    background-color: rgba(0, 0, 0, 0.8);
    border-radius: 10px;
    box-shadow: var(--shadow);
    display: none;
}

/* متن پیام عدم وجود نتیجه */
.no-results p {
    margin-bottom: 1rem;
    color: white;
    font-size: 1.1rem;
}

/* انیمیشن‌ها */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* رسپانسیو برای صفحه‌نمایش متوسط (تبلت) */
@media (max-width: 768px) {
    body {
        padding: 1rem;
    }

    .header h1 {
        font-size: 2rem;
    }

    .header p {
        font-size: 1rem;
    }

    .articles-container {
        grid-template-columns: 1fr;
    }

    .filters {
        gap: 0.5rem;
    }

    .filter-btn {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }
}

/* رسپانسیو برای صفحه‌نمایش کوچک (موبایل) */
@media (max-width: 480px) {
    .header h1 {
        font-size: 1.8rem;
    }

    .search-box {
        padding: 0.7rem 1rem 0.7rem 2.2rem;
    }

    .search-icon {
        left: 12px;
        font-size: 1rem;
    }

    .article-title {
        font-size: 1.2rem;
        font-weight: 100;
    }

    .article-excerpt {
        font-size: 0.9rem;
    }
}

/* استایل‌های ویژه برای دسکتاپ بزرگ */
@media screen and (min-width: 1024px) {
    .hero-buttons {
        margin-right: 620px;
    }
}

/* افکت‌های ویژه برای کارت‌های شیشه‌ای */
.glass-card {
    position: relative;
    z-index: 1;
}

.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: inherit;
    border-radius: inherit;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.glass-card:hover::before {
    opacity: 1;
}

/* افکت ریپل برای دکمه‌ها */
.filter-btn {
    position: relative;
    overflow: hidden;
}

.filter-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%, -50%);
    transform-origin: 50% 50%;
}

.filter-btn:focus:not(:active)::after {
    animation: ripple 0.6s ease-out;
}

/* انیمیشن ریپل */
@keyframes ripple {
    0% {
        transform: scale(0, 0);
        opacity: 0.5;
    }

    100% {
        transform: scale(20, 20);
        opacity: 0;
    }
}