:root {
    --primary-red: #dc2626;
    --primary-red-dark: #b91c1c;
    --primary-red-light: #ef4444;
    --primary-red-soft: #fecaca;
    --white: #ffffff;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --shadow: 0 4px 20px rgba(220, 38, 38, 0.08);
    --shadow-strong: 0 8px 25px rgba(220, 38, 38, 0.12);
    --border-radius: 12px;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Vazirmatn', system-ui, -apple-system, 'Segoe UI', sans-serif;
    background: var(--gray-50);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* انیمیشن لودینگ */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--white);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-overlay.hidden {
    opacity: 0;
    visibility: hidden;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--gray-200);
    border-top: 4px solid var(--primary-red);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

.loading-text {
    font-size: 1.1rem;
    color: var(--gray-600);
    font-weight: 500;
}

.loading-progress {
    width: 200px;
    height: 4px;
    background: var(--gray-200);
    border-radius: 2px;
    margin-top: 15px;
    overflow: hidden;
}

.loading-progress-bar {
    height: 100%;
    background: var(--primary-red);
    width: 0%;
    border-radius: 2px;
    animation: progress 2s ease-in-out infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes progress {
    0% {
        width: 0%;
    }

    100% {
        width: 100%;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate3d(0, 40px, 0);
    }

    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@keyframes shimmer {
    0% {
        background-position: -468px 0;
    }

    100% {
        background-position: 468px 0;
    }
}

/* اسکلت لودینگ */
.skeleton {
    background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-300) 50%, var(--gray-200) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}

.skeleton-image {
    height: 200px;
    width: 100%;
}

.skeleton-title {
    height: 20px;
    width: 80%;
    margin-bottom: 10px;
}

.skeleton-text {
    height: 14px;
    width: 100%;
    margin-bottom: 8px;
}

.skeleton-text.short {
    width: 60%;
}

.skeleton-meta {
    height: 12px;
    width: 40%;
}

/* هدر ساده و زیبا */
.article-header {
    background: linear-gradient(135deg, var(--primary-red) 0%, var(--primary-red-dark) 100%);
    color: var(--white);
    padding: 80px 0 50px;
    text-align: center;
    position: relative;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.article-header.loaded {
    opacity: 1;
    transform: translateY(0);
}

.article-header::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 100" preserveAspectRatio="none"><path d="M0,70 C200,20 500,0 800,30 L1000,70 L1000,100 L0,100 Z" fill="rgba(255,255,255,0.1)"/></svg>');
    background-size: 100% auto;
    background-repeat: no-repeat;
}

.header-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

.header-title {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 20px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header-subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    line-height: 1.6;
    max-width: 600px;
    margin: 0 auto;
}

/* محتوای اصلی */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.content-section {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 30px;
    margin: 30px 0;
    box-shadow: var(--shadow);
    position: relative;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.content-section.loaded {
    opacity: 1;
    transform: translateY(0);
}

.content-section::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 4px;
    background: var(--primary-red);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--gray-200);
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
}

.articles-count {
    background: var(--primary-red-soft);
    color: var(--primary-red);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

/* استایل کارت مقاله با قابلیت کلیک کامل */
.article-card {
    background: var(--white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease forwards;
}

.article-card.loaded {
    opacity: 1;
    transform: translateY(0);
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-strong);
}

.article-link {
    display: block;
    text-decoration: none;
    color: inherit;
    height: 100%;
}

.article-image {
    position: relative;
    height: 200px;
    overflow: hidden;
    background: var(--gray-200);
}

.article-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.article-card:hover .article-image img {
    transform: scale(1.05);
}

.article-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--primary-red);
    color: var(--white);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 2;
}

.article-content {
    padding: 20px;
}

.article-title {
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 10px;
    color: var(--gray-900);
}

.article-description {
    font-size: 0.875rem;
    color: var(--gray-600);
    line-height: 1.5;
    margin-bottom: 15px;
    display: -webkit-box;
    line-clamp: 3;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: var(--gray-500);
}

.article-meta i {
    margin-left: 4px;
}

/* افکت کلیک */
.article-card:active {
    transform: translateY(-2px);
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    border: 2px solid var(--gray-300);
    background: var(--white);
    color: var(--gray-700);
    font-size: 0.875rem;
}

.pagination a:hover {
    border-color: var(--primary-red);
    color: var(--primary-red);
}

.pagination .current {
    background: var(--primary-red);
    color: var(--white);
    border-color: var(--primary-red);
}

.pagination .prev-next {
    gap: 6px;
}

/* رسپانسیو */
@media (max-width: 768px) {
    .article-header {
        padding: 60px 0 40px;
    }

    .header-title {
        font-size: 2rem;
    }

    .header-subtitle {
        font-size: 1.1rem;
    }

    .content-section {
        padding: 20px;
        margin: 20px 0;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .articles-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .pagination {
        gap: 6px;
    }

    .pagination a,
    .pagination span {
        min-width: 36px;
        height: 36px;
        padding: 0 10px;
        font-size: 0.8rem;
    }
}