/* Pagination محسن ومتجاوب */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    margin: 20px 0;
    padding: 0;
    list-style: none;
}

.pagination li {
    margin: 0 2px;
}

.pagination .page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 8px 12px;
    color: #007bff;
    text-decoration: none;
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
}

.pagination .page-link:hover {
    color: #0056b3;
    background-color: #e9ecef;
    border-color: #adb5bd;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.pagination .page-item.active .page-link {
    background-color: #007bff;
    border-color: #007bff;
    color: #fff;
    box-shadow: 0 2px 8px rgba(0,123,255,0.3);
}

.pagination .page-item.disabled .page-link {
    color: #6c757d;
    background-color: #fff;
    border-color: #dee2e6;
    cursor: not-allowed;
    opacity: 0.6;
}

.pagination .page-item.disabled .page-link:hover {
    transform: none;
    box-shadow: none;
}

/* تصميم متجاوب للموبايل */
@media (max-width: 768px) {
    .pagination {
        gap: 3px;
        margin: 15px 0;
    }
    
    .pagination .page-link {
        min-width: 35px;
        height: 35px;
        padding: 6px 8px;
        font-size: 12px;
    }
    
    .pagination li {
        margin: 0 1px;
    }
    
    /* إخفاء بعض الأرقام في الموبايل لتوفير المساحة */
    .pagination .page-item:not(.active):not(.disabled):not(:first-child):not(:last-child):not(:nth-child(2)):not(:nth-last-child(2)) {
        display: none;
    }
}

@media (max-width: 480px) {
    .pagination .page-link {
        min-width: 32px;
        height: 32px;
        padding: 4px 6px;
        font-size: 11px;
    }
    
    /* إظهار الأرقام الأساسية فقط في الشاشات الصغيرة */
    .pagination .page-item:not(.active):not(.disabled):not(:first-child):not(:last-child):not(:nth-child(2)):not(:nth-last-child(2)):not(:nth-child(3)):not(:nth-last-child(3)) {
        display: none;
    }
}

/* تحسين للوضع المظلم */
@media (prefers-color-scheme: dark) {
    .pagination .page-link {
        background-color: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .pagination .page-link:hover {
        background-color: #4a5568;
        border-color: #718096;
        color: #f7fafc;
    }
    
    .pagination .page-item.active .page-link {
        background-color: #3182ce;
        border-color: #3182ce;
        color: #fff;
    }
    
    .pagination .page-item.disabled .page-link {
        background-color: #2d3748;
        border-color: #4a5568;
        color: #718096;
    }
}

/* تأثيرات إضافية */
.pagination .page-link:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.25);
}

/* تحسين للغة العربية */
[dir="rtl"] .pagination {
    flex-direction: row-reverse;
}

/* إضافة مساحة للعنصر المحتوي */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px 0;
    padding: 10px;
    background-color: rgba(248, 249, 250, 0.8);
    border-radius: 8px;
    backdrop-filter: blur(10px);
}

@media (max-width: 768px) {
    .pagination-container {
        margin: 15px 0;
        padding: 8px;
    }
}
