﻿/* متغیرهای طراحی لوکس */
:root {
    --primary-a: #1a73e8;
    --primary-light-a: #4285f4;
    --primary-dark-a: #0d47a1;
    --primary-gradient-a: linear-gradient(135deg, #1a73e8 0%, #4285f4 100%);
    --primary-gradient-hover-a: linear-gradient(135deg, #4285f4 0%, #5c9dff 100%);
    --secondary: #34a853;
    --accent: #ea4335;
    --gold: #ffb300;
    --silver: #f1f3f4;
    --dark: #202124;
    --light: #ffffff;
    --gray-50: #f8f9fa;
    --gray-100: #f1f3f4;
    --gray-200: #e8eaed;
    --gray-300: #dadce0;
    --gray-400: #bdc1c6;
    --gray-500: #9aa0a6;
    --gray-600: #80868b;
    --gray-700: #5f6368;
    --gray-800: #3c4043;
    --gray-900: #202124;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.12);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.15);
    --shadow-xl: 0 20px 40px rgba(0,0,0,0.2);
    --shadow-xxl: 0 30px 60px rgba(0,0,0,0.3);
    --border-radius-sm: 8px;
    --border-radius-md: 12px;
    --border-radius-lg: 20px;
    --border-radius-xl: 30px;
    --border-radius-2xl: 40px;
}

/* تنظیمات پایه برای اسکرول */
html {
    overflow-x: hidden;
    overflow-y: auto;
}

body {
    overflow-x: hidden;
    overflow-y: auto;
    position: relative;
    width: 100%;
    min-height: 100vh;
}

/* هدر لوکس و منحصربفرد */
.articles-header {
    background: linear-gradient(135deg, #1a237e 0%, #283593 25%, #3949ab 50%, #5c6bc0 75%, #7986cb 100%);
    color: white;
    padding: 6rem 0 5rem;
    position: relative;
    overflow: hidden;
    margin-bottom: 3rem;
    direction: rtl;
    border-bottom-left-radius: 60px;
    border-bottom-right-radius: 60px;
    min-height: 600px;
    display: flex;
    align-items: center;
    /* جلوگیری از overflow */
    overflow: clip;
}

/* افکت شیشه‌ای */
.glass-effect {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* شناورهای هدر - بهبود یافته */
.header-floater {
    position: absolute;
    border-radius: 50%;
    opacity: 0.4;
    pointer-events: none;
    z-index: 1;
    filter: blur(20px);
    animation: float 20s infinite ease-in-out;
}

/* Floater 1 - کاملاً خارج از هدر قرار می‌گیرد */
.floater-1 {
    width: 400px;
    height: 400px;
    top: -150px;
    right: -150px;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0.1) 40%, transparent 70%);
    animation-duration: 25s;
    /* در موبایل حذف یا کوچک می‌شود */
}

/* Floater 2 - بهبود یافته */
.floater-2 {
    width: 500px;
    height: 500px;
    bottom: -200px;
    left: -200px;
    background: radial-gradient(circle at 70% 70%, rgba(52, 168, 83, 0.2) 0%, rgba(52, 168, 83, 0.05) 30%, transparent 70%);
    animation-duration: 30s;
    animation-direction: reverse;
}

/* Floater 3 - بهبود یافته */
.floater-3 {
    width: 300px;
    height: 300px;
    top: 50%;
    left: 10%;
    transform: translateY(-50%);
    background: radial-gradient(circle at 50% 50%, rgba(234, 67, 53, 0.15) 0%, rgba(234, 67, 53, 0.05) 30%, transparent 70%);
    animation-duration: 15s;
}

.header-content {
    position: relative;
    z-index: 10;
    text-align: center;
    width: 100%;
}

/* Medical Badge - اصلاح موقعیت */
.medical-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    padding: 12px 24px;
    border-radius: 50px;
    margin-bottom: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    z-index: 2;
    animation: fadeIn 0.8s ease-out;
    /* موقعیت ثابت در دسکتاپ */
    position: relative;
    transform: none;
}

    .medical-badge i {
        color: var(--gold);
        font-size: 1.5rem;
    }

.header-title {
    font-size: 4rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    line-height: 1.1;
    background: linear-gradient(to right, #ffffff, #e3f2fd);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 10px 30px rgba(0,0,0,0.3);
    position: relative;
    display: inline-block;
    animation: slideInUp 0.8s ease-out 0.2s both;
}

    .header-title::after {
        content: '';
        position: absolute;
        bottom: -15px;
        right: 25%;
        left: 25%;
        height: 4px;
        background: linear-gradient(to right, transparent, var(--gold), transparent);
        border-radius: 2px;
        animation: expandWidth 1s ease-out 0.5s both;
    }

.header-subtitle {
    font-size: 1.4rem;
    opacity: 0.9;
    margin-bottom: 3rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.7;
    font-weight: 300;
    letter-spacing: 0.3px;
    animation: slideInUp 0.8s ease-out 0.4s both;
}

/* جستجوی پزشکی لوکس */
.search-container {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
    animation: slideInUp 0.8s ease-out 0.6s both;
}

.medical-search {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(25px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--border-radius-xl);
    padding: 1.2rem 2rem;
    display: flex;
    align-items: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-xl);
    position: relative;
    overflow: hidden;
}

    .medical-search::before {
        content: '';
        position: absolute;
        top: 0;
        right: 0;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.1) 50%, transparent 100%);
        transform: translateX(-100%);
        transition: transform 0.6s ease;
    }

    .medical-search:hover::before {
        transform: translateX(100%);
    }

    .medical-search:focus-within {
        background: rgba(255, 255, 255, 0.25);
        border-color: var(--gold);
        box-shadow: 0 25px 50px rgba(0,0,0,0.3);
        transform: translateY(-5px);
    }

.search-input {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.2rem;
    flex: 1;
    padding: 0.8rem 1.5rem;
    outline: none;
    font-weight: 400;
    letter-spacing: 0.5px;
}

    .search-input::placeholder {
        color: rgba(255,255,255,0.7);
        font-weight: 300;
    }

.search-btn {
    background: var(--gold);
    color: var(--dark);
    border: none;
    width: 55px;
    height: 55px;
    min-width: 55px;
    min-height: 55px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.4s ease;
    font-size: 1.4rem;
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
    position: relative;
    overflow: hidden;
    padding: 0;
    margin-right: 0;
    margin-left: 1rem;
    flex-shrink: 0;
}

    .search-btn::before {
        content: '';
        position: absolute;
        top: 0;
        right: 0;
        width: 100%;
        height: 100%;
        background: linear-gradient(135deg, var(--gold) 0%, #ffca28 100%);
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .search-btn:hover {
        transform: scale(1.15) rotate(10deg);
        box-shadow: 0 15px 30px rgba(0,0,0,0.4);
    }

        .search-btn:hover::before {
            opacity: 1;
        }

    .search-btn i {
        position: relative;
        z-index: 1;
    }
.border-radius-50 {
    border-radius: 50px;
}
/* آمار پزشکی */
.medical-stats {
    display: flex;
    justify-content: center;
    gap: 2.5rem;
    margin-top: 4rem;
    flex-wrap: wrap;
    position: relative;
    z-index: 2;
    animation: slideInUp 0.8s ease-out 0.8s both;
}

.stat-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
    padding: 2rem 3rem;
    border-radius: var(--border-radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.4s ease;
    text-align: center;
    min-width: 180px;
    position: relative;
    overflow: hidden;
}

    .stat-card::before {
        content: '';
        position: absolute;
        top: 0;
        right: 0;
        width: 100%;
        height: 100%;
        background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 100%);
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .stat-card:hover {
        background: rgba(255, 255, 255, 0.2);
        transform: translateY(-10px);
        border-color: var(--gold);
        box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    }

        .stat-card:hover::before {
            opacity: 1;
        }

.stat-number-a {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    display: block;
    background: linear-gradient(to right, var(--gold), #ffecb3);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label-a {
    font-size: 1rem;
    opacity: 0.9;
    font-weight: 300;
    letter-spacing: 1px;
}

/* محتوای اصلی */
.articles-container {
    padding: 0 0 6rem 0;
    direction: rtl;
    position: relative;
    background: linear-gradient(to bottom, #f8f9fa, #ffffff);
    width: 100%;
    /* فعال کردن اسکرول عمودی */
    overflow-y: visible;
    overflow-x: hidden;
}

/* سایدبار دسته‌بندی‌ها - کاملاً بهینه شده */
.categories-sidebar {
    position: sticky;
    top: 100px;
    z-index: 100;
    width: 100%;
    box-sizing: border-box;
}

.categories-card {
    background: white;
    border-radius: var(--border-radius-xl);
    padding: 1.8rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--gray-200);
    margin-bottom: 2rem;
    transition: all 0.3s ease;
    height: fit-content;
    max-height: none;
    overflow: visible;
    width: 100%;
    box-sizing: border-box;
    position: relative;
}

    .categories-card:hover {
        box-shadow: var(--shadow-xl);
        transform: translateY(-5px);
    }

.categories-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--gray-100);
    width: 100%;
}

    .categories-header h3 {
        font-size: 1.4rem;
        font-weight: 700;
        color: var(--gray-900);
        margin: 0;
        display: flex;
        align-items: center;
        gap: 10px;
    }

        .categories-header h3 i {
            color: var(--primary-a);
        }

/* لیست دسته‌بندی‌ها - کاملاً منطبق */
.categories-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    overflow: visible;
    max-height: none;
    width: 100%;
}

.category-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 1rem;
    border-radius: var(--border-radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    text-decoration: none;
    color: var(--gray-700);
    width: 100%;
    box-sizing: border-box;
    position: relative;
}

    .category-item:hover {
        background: var(--gray-50);
        border-color: var(--gray-200);
        transform: translateX(-5px);
    }

    .category-item.active {
        background: linear-gradient(135deg, var(--primary-a) 0%, var(--primary-light-a) 100%);
        color: white;
        border-color: var(--primary-a);
        box-shadow: 0 5px 15px rgba(26, 115, 232, 0.3);
    }

        .category-item.active .category-icon {
            background: white;
            color: var(--primary-a);
        }

        .category-item.active .category-count {
            background: rgba(255, 255, 255, 0.2);
            color: white;
        }

.category-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--primary-a);
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.category-content {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.category-name {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.category-desc {
    font-size: 0.8rem;
    color: var(--gray-500);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.category-count {
    background: var(--gray-100);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--gray-700);
    flex-shrink: 0;
    transition: all 0.3s ease;
    margin-right: auto;
}

/* فیلترهای بالایی */
.filters-container {
    background: white;
    border-radius: var(--border-radius-xl);
    padding: 1.8rem;
    margin-bottom: 2.5rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--gray-200);
    position: relative;
    overflow: hidden; /* تغییر از visible به hidden */
    width: 100%;
    box-sizing: border-box;
}

    .filters-container::before {
        content: '';
        position: absolute;
        top: 0;
        right: 0;
        width: 6px; /* کمی ضخیم‌تر */
        height: 100%;
        background: linear-gradient(to bottom, var(--primary-a), var(--secondary));
        border-radius: 0 var(--border-radius-xl) var(--border-radius-xl) 0; /* رادیوس برای سمت چپ */
    }

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    align-items: center;
    width: 100%;
}

.filters-left {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--gray-50);
    border: 2px solid var(--gray-200);
    color: var(--gray-700);
    padding: 0.8rem 1.5rem;
    border-radius: var(--border-radius-lg);
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
}

    .filter-chip.active,
    .filter-chip:hover {
        background: var(--primary-gradient-a);
        color: white;
        border-color: transparent;
        transform: translateY(-2px);
        box-shadow: 0 8px 20px rgba(26, 115, 232, 0.25);
    }

.filters-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    justify-content: flex-end;
}

.sort-select {
    padding: 0.9rem 1.8rem 0.9rem 3.5rem; /* padding برای RTL */
    border: 2px solid var(--gray-200);
    border-radius: var(--border-radius-lg);
    background: white;
    color: var(--gray-700);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 180px;
    font-size: 0.95rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%231a73e8' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 1.2rem center;
    background-size: 14px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    box-sizing: border-box;
    outline: none;
    direction: rtl;
}

    .sort-select:focus {
        outline: none;
        border-color: var(--primary-a);
        box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
    }

.view-toggle {
    background: var(--gray-50);
    border: 2px solid var(--gray-200);
    color: var(--gray-600);
    width: 52px;
    height: 52px;
    border-radius: var(--border-radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.3rem;
    flex-shrink: 0;
    outline: none;
}

    .view-toggle:hover {
        border-color: var(--primary-a);
        color: var(--primary-a);
        transform: translateY(-2px);
        box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    }

/* حالت موبایل */
@media (max-width: 768px) {
    .filters-container {
        padding: 1.5rem;
        margin: 0 0 1.5rem;
        border-radius: var(--border-radius-lg);
        overflow: hidden;
    }

        .filters-container::before {
            width: 6px;
            border-radius: 0 var(--border-radius-lg) var(--border-radius-lg) 0;
        }

    .filters-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .filters-left {
        justify-content: center;
        gap: 0.5rem;
    }

    .filter-chip {
        padding: 0.7rem 1.2rem;
        font-size: 0.9rem;
    }

    .filters-right {
        flex-direction: column;
        gap: 0.8rem;
    }

    .sort-select {
        width: 100%;
        min-width: unset;
        padding: 0.8rem 1.5rem 0.8rem 3rem;
    }

    .view-toggle {
        width: 48px;
        height: 48px;
        align-self: center;
    }
}

@media (max-width: 480px) {
    .filters-container {
        padding: 1.2rem;
        border-radius: var(--border-radius-md);
    }

        .filters-container::before {
            border-radius: 0 var(--border-radius-md) var(--border-radius-md) 0;
        }

    .filter-chip {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
        white-space: nowrap;
    }

    .sort-select {
        font-size: 0.9rem;
        padding: 0.7rem 1.2rem 0.7rem 2.8rem;
    }
}

/* کارت‌های مقاله پزشکی */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
    width: 100%;
}

.article-card {
    background: white;
    border-radius: var(--border-radius-xl);
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-200);
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
    width: 100%;
    box-sizing: border-box;
}

    .article-card:hover {
        transform: translateY(-15px) scale(1.02);
        box-shadow: var(--shadow-xxl);
        border-color: var(--primary-a);
    }

.article-image {
    height: 220px;
    overflow: hidden;
    position: relative;
    width: 100%;
}

    .article-image::after {
        content: '';
        position: absolute;
        bottom: 0;
        right: 0;
        left: 0;
        height: 50%;
        background: linear-gradient(to top, rgba(0,0,0,0.5), transparent);
    }

    .article-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    }

.article-card:hover .article-image img {
    transform: scale(1.15);
}

.article-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: linear-gradient(135deg, var(--gold) 0%, #ffa000 100%);
    color: var(--dark);
    padding: 0.7rem 1.3rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 700;
    z-index: 2;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    gap: 5px;
}

.article-category {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 0.7rem 1.3rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    backdrop-filter: blur(10px);
    z-index: 2;
}

.article-content {
    padding: 1.8rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    box-sizing: border-box;
}

.article-title {
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 1rem;
    line-height: 1.4;
    color: var(--gray-900);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.3s ease;
}

.article-card:hover .article-title {
    color: var(--primary-a);
}

.article-excerpt {
    color: var(--gray-600);
    line-height: 1.7;
    margin-bottom: 1.5rem;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 1rem;
}

.article-meta {
    justify-content: space-between;
    align-items: center;
    padding-top: 1.5rem;
    border-top: 1px solid var(--gray-200);
    margin-top: auto;
    width: 100%;
}

.article-author {
    display: flex;
    align-items: center;
    gap: 12px;
}

.author-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--gray-200);
    transition: all 0.3s ease;
}

.article-card:hover .author-avatar {
    border-color: var(--primary-a);
    transform: scale(1.1);
}

.author-info h6 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-800);
}

.author-info small {
    color: var(--gray-500);
    font-size: 0.9rem;
}

.article-stats {
    display: flex;
    gap: 15px;
    color: var(--gray-600);
    font-size: 0.95rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

    .stat-item i {
        font-size: 1.2rem;
    }

.read-time {
    background: var(--gray-100);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--gray-700);
}

/* پاگینیشن پزشکی */
.pagination-container {
    display: flex;
    justify-content: center;
    margin-top: 4rem;
    padding: 0 1rem;
    width: 100%;
    box-sizing: border-box;
}

.medical-pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 600px;
    overflow: visible;
}

.page-item {
    list-style: none;
    margin: 0;
}

.page-link {
    min-width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius-lg);
    background: white;
    color: var(--gray-700);
    border: 2px solid var(--gray-200);
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    padding: 0 0.5rem;
    box-sizing: border-box;
}

.page-item.active .page-link {
    background: var(--primary-gradient-a);
    color: white;
    border-color: transparent;
    box-shadow: 0 8px 20px rgba(26, 115, 232, 0.25);
    transform: scale(1.1);
}

.page-item:not(.active, .disabled) .page-link:hover {
    background: var(--gray-50);
    border-color: var(--primary-a);
    color: var(--primary-a);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* دکمه‌های شناور لوکس */
.medical-floaters {
    position: fixed;
    bottom: 40px;
    right: 40px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.medical-floater {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    border: none;
    background: white;
    color: var(--primary-a);
    font-size: 1.4rem;
    cursor: pointer;
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

    .medical-floater::before {
        content: '';
        position: absolute;
        top: 0;
        right: 0;
        width: 100%;
        height: 100%;
        background: var(--primary-gradient-a);
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .medical-floater:hover {
        transform: scale(1.2);
        box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    }

        .medical-floater:hover::before {
            opacity: 1;
        }

    .medical-floater i {
        position: relative;
        z-index: 1;
        transition: color 0.3s ease;
    }

    .medical-floater:hover i {
        color: white;
    }

/* انیمیشن‌های جدید */
@keyframes float {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }

    25% {
        transform: translate(10px, -10px) rotate(5deg);
    }

    50% {
        transform: translate(0, -20px) rotate(0deg);
    }

    75% {
        transform: translate(-10px, -10px) rotate(-5deg);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes expandWidth {
    from {
        width: 0;
        opacity: 0;
    }

    to {
        width: 50%;
        opacity: 1;
    }
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(26, 115, 232, 0.5);
    }

    50% {
        box-shadow: 0 0 40px rgba(26, 115, 232, 0.8);
    }
}

.pulse-glow {
    animation: pulse-glow 2s infinite;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-in {
    animation: slideIn 0.6s ease forwards;
}


/* ریسپانسیو - کاملاً بهبود یافته */
@media (max-width: 768px) {
    .articles-header {
        padding: 4rem 1rem;
        border-bottom-left-radius: 40px;
        border-bottom-right-radius: 40px;
        min-height: 500px;
        /* جلوگیری از پرش در موبایل */
        overflow: hidden;
        position: relative;
    }
    /* حذف یا کوچک کردن floater-1 در موبایل */
    .floater-1 {
        width: 200px;
        height: 200px;
        top: -50px;
        right: -50px;
        opacity: 0.2;
        display: none; /* می‌توانید none بگذارید یا کوچک کنید */
    }

    .floater-2 {
        width: 300px;
        height: 300px;
        bottom: -100px;
        left: -100px;
        opacity: 0.3;
    }

    .floater-3 {
        width: 200px;
        height: 200px;
        top: 30%;
        left: 5%;
        opacity: 0.2;
    }

    .header-title {
        font-size: 2.8rem;
    }

    .header-subtitle {
        font-size: 1.2rem;
        padding: 0;
    }
    /* Medical Badge در موبایل */
    .medical-badge {
        margin-bottom: 1.5rem;
        padding: 10px 20px;
        font-size: 0.9rem;
    }

    .medical-search {
        padding: 1rem 1.5rem;
        margin: 0;
        width: calc(100% - 2rem);
    }

    .search-input {
        font-size: 1.1rem;
    }

    .medical-stats {
        gap: 1rem;
        padding: 0;
        margin-top: 2rem;
    }

    .stat-card {
        padding: 1.2rem 1.5rem;
        min-width: calc(50% - 0.5rem);
    }

    .stat-number-a {
        font-size: 2.2rem;
    }

    .categories-sidebar {
        position: static;
        margin-bottom: 2rem;
        padding: 0;
    }

    .categories-card {
        margin: 0 0 2rem;
        padding: 1.5rem;
        width: 100%;
    }

    .filters-container {
        margin: 0 0 2rem;
        padding: 1.5rem;
        width: 100%;
    }

    .filters-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .filters-left {
        justify-content: center;
    }

    .filters-right {
        justify-content: center;
        flex-wrap: wrap;
        width: 100%;
    }

    .sort-select {
        min-width: unset;
        width: 100%;
    }

    .articles-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 0;
    }

    .pagination-container {
        padding: 0;
    }

    .medical-pagination {
        gap: 0.3rem;
    }

    .page-link {
        min-width: 45px;
        height: 45px;
        font-size: 1rem;
    }

    .medical-floaters {
        bottom: 20px;
        right: 20px;
    }

    .medical-floater {
        width: 55px;
        height: 55px;
        font-size: 1.2rem;
    }

    .article-title {
        font-size: 1.3rem;
    }

    .article-content {
        padding: 1.5rem;
    }
    /* دکمه‌های شناور در موبایل */
    .medical-floaters {
        flex-direction: row;
        gap: 10px;
    }

    .medical-search {
        padding: 1rem 0.1rem;
        margin: 0;
        width: calc(100% - 2rem);
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .articles-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.8rem;
    }

    .filters-grid {
        grid-template-columns: 1fr;
    }

    .header-title {
        font-size: 3.5rem;
    }

    .categories-card {
        padding: 1.5rem;
    }
    /* تنظیم floater‌ها برای تبلت */
    .floater-1 {
        width: 300px;
        height: 300px;
        top: -100px;
        right: -100px;
    }
}

@media (min-width: 1025px) and (max-width: 1200px) {
    .articles-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .categories-card {
        padding: 1.5rem;
    }
}

@media (min-width: 1201px) {
    .articles-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    /* تنظیم موقعیت Medical Badge در دسکتاپ */
    .medical-badge {
        position: relative;
        transform: none;
        margin: 0 auto 2rem;
        display: inline-flex;
    }
}

/* حالت خالی */
.empty-state {
    text-align: center;
    padding: 5rem 2rem;
    color: var(--gray-600);
    background: var(--gray-50);
    border-radius: var(--border-radius-xl);
    border: 2px dashed var(--gray-300);
    margin: 2rem 0;
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
}

    .empty-state i {
        font-size: 5rem;
        color: var(--gray-400);
        margin-bottom: 2rem;
    }

    .empty-state h4 {
        font-size: 1.8rem;
        font-weight: 700;
        margin-bottom: 1rem;
        color: var(--gray-700);
    }

/* پزشکی خاص */
.medical-ribbon {
    position: absolute;
    top: 20px;
    left: -30px;
    background: var(--accent);
    color: white;
    padding: 0.5rem 2rem;
    transform: rotate(-45deg);
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 1px;
    box-shadow: 0 5px 10px rgba(0,0,0,0.2);
    z-index: 1;
}

.featured-indicator {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: var(--gold);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--dark);
    font-size: 1.2rem;
    z-index: 2;
    animation: pulse-glow 2s infinite;
}

/* تایمر جدیدترین مقالات */
.new-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: var(--secondary);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 700;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 5px;
    animation: pulse-glow 2s infinite;
}

/* آمار و فیلتر فعال */
.stats-filter-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: white;
    border-radius: var(--border-radius-xl);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-200);
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
}

.stats-info {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.filter-badge {
    background: var(--gray-50);
    border: 2px solid var(--gray-200);
    color: var(--gray-700);
    padding: 0.7rem 1.5rem;
    border-radius: var(--border-radius-lg);
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

    .filter-badge.active {
        background: var(--primary-gradient-a);
        color: white;
        border-color: transparent;
    }

.stats-actions {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
}

/* بهبود کلیات برای جلوگیری از بیرون زدگی */
.container {
    max-width: 100%;
    padding-right: 15px;
    padding-left: 15px;
    margin-right: auto;
    margin-left: auto;
    overflow: hidden;
}

.row {
    margin-right: -15px;
    margin-left: -15px;
    overflow: hidden;
}

.col-lg-3, .col-lg-9 {
    padding-right: 15px;
    padding-left: 15px;
    overflow: hidden;
}

/* اسکرول کلی صفحه فعال شود */
.main-content {
    overflow-y: auto;
    overflow-x: hidden;
    width: 100%;
}

/* جلوگیری از overflow-x در کل صفحه */
body, html {
    overflow-x: hidden;
    width: 100%;
    position: relative;
}

/* تنظیم مجدد اسکرول‌بارها */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-a);
    border-radius: 10px;
}

    ::-webkit-scrollbar-thumb:hover {
        background: var(--primary-dark-a);
    }

/* استایل دکمه‌های شناور */
.medical-floater {
    position: relative;
    border-radius: 15px;
    border: none;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    color: #2c3e50;
    font-size: 1.4rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

    .medical-floater:hover {
        background: #3498db;
        color: white;
        transform: scale(1.1);
        border-radius: 15px;
        border: none;
    }


/* افکت شناور بودن برای دکمه اول (اختیاری) */

@keyframes floating {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }

    100% {
        transform: translateY(0px);
    }
}

.floating {
    animation: floating 3s ease-in-out infinite;
}

.custom-tooltip {
    position: absolute;
    right: 80px;
    / فاصله از دکمه / top: 50%;
    transform: translateY(-50%) translateX(15px);
    background: #34495e;
    color: white !important;
    padding: 8px 15px;
    font-size: 14px;
    border-radius: 8px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 2000;
    / بالاتر از همه / box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    pointer-events: none;
}

.custom-tooltip::after {
    content: "";
    position: absolute;
    right: -10px;
    top: 50%;
    transform: translateY(-50%);
    border-width: 5px;
    border-style: solid;
    border-color: transparent transparent transparent #34495e;
}

.medical-floater:hover .custom-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(0);
}


.medical-floater {
    overflow: visible !important; 
}
