/* Modern Pagination Styles - Higher Specificity Override */

.pagination-wrapper {
    text-align: center !important;
    display: block !important;
    margin: 2rem 0 !important;
    padding: 1rem 0 !important;
}

/* Reset all pagination styles */
.pagination-wrapper * {
    box-sizing: border-box !important;
}

/* Main navigation container */
.pagination-wrapper nav[role="navigation"] {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 1rem !important;
    flex-wrap: wrap !important;
}

/* Mobile pagination (sm:hidden) */
.pagination-wrapper .flex.justify-between.flex-1.sm\:hidden {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    width: 100% !important;
    margin-bottom: 1rem !important;
}

/* Desktop pagination container */
.pagination-wrapper .hidden.sm\:flex-1 {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 1rem !important;
    width: 100% !important;
}

.pagination-wrapper .sm\:flex.sm\:items-center.sm\:justify-between {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 1rem !important;
    width: 100% !important;
}

/* Results info styling */
.pagination-wrapper .text-sm.text-gray-700 {
    font-size: 0.875rem !important;
    color: #374151 !important;
    margin-bottom: 0.5rem !important;
    font-weight: 500 !important;
}

.pagination-wrapper .text-sm.text-gray-700 .font-medium {
    font-weight: 600 !important;
    color: #1f2937 !important;
}

/* Main pagination buttons container */
.pagination-wrapper .relative.z-0.inline-flex.shadow-sm.rounded-md {
    display: inline-flex !important;
    align-items: center !important;
    background: white !important;
    border-radius: 0.5rem !important;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06) !important;
    overflow: hidden !important;
    border: 1px solid #e5e7eb !important;
}

/* Common button styles */
.pagination-wrapper .relative.inline-flex.items-center {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0.5rem 0.75rem !important;
    font-size: 0.875rem !important;
    font-weight: 500 !important;
    line-height: 1.25 !important;
    text-decoration: none !important;
    transition: all 0.15s ease-in-out !important;
    border: none !important;
    border-right: 1px solid #e5e7eb !important;
    margin: 0 !important;
    min-width: 2.5rem !important;
    height: 2.5rem !important;
}

/* Remove border from last item */
.pagination-wrapper .relative.inline-flex.items-center:last-child {
    border-right: none !important;
}

/* Previous button (disabled) */
.pagination-wrapper span[aria-disabled="true"] .relative.inline-flex.items-center {
    background-color: #f9fafb !important;
    color: #9ca3af !important;
    cursor: not-allowed !important;
}

/* Active page button */
.pagination-wrapper span[aria-current="page"] .relative.inline-flex.items-center {
    background-color: #3b82f6 !important;
    color: white !important;
    font-weight: 600 !important;
    cursor: default !important;
}

/* Regular page buttons */
.pagination-wrapper a.relative.inline-flex.items-center {
    background-color: white !important;
    color: #374151 !important;
    cursor: pointer !important;
}

/* Hover effects */
.pagination-wrapper a.relative.inline-flex.items-center:hover {
    background-color: #f3f4f6 !important;
    color: #1f2937 !important;
}

/* Focus styles */
.pagination-wrapper a.relative.inline-flex.items-center:focus {
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1) !important;
    z-index: 10 !important;
}

/* Ellipsis styling */
.pagination-wrapper span[aria-disabled="true"] span:not([aria-hidden="true"]) {
    background-color: white !important;
    color: #6b7280 !important;
    cursor: default !important;
}

/* SVG icons */
.pagination-wrapper .w-5.h-5 {
    width: 1.25rem !important;
    height: 1.25rem !important;
}

/* Mobile-specific styles */
@media (max-width: 639px) {
    .pagination-wrapper .hidden.sm\:flex-1 {
        display: none !important;
    }
    
    .pagination-wrapper .flex.justify-between.flex-1.sm\:hidden {
        display: flex !important;
    }
    
    .pagination-wrapper .relative.z-0.inline-flex.shadow-sm.rounded-md {
        display: none !important;
    }
    
    /* Mobile buttons */
    .pagination-wrapper .relative.inline-flex.items-center.px-4.py-2 {
        padding: 0.75rem 1rem !important;
        border-radius: 0.375rem !important;
        font-size: 0.875rem !important;
        font-weight: 500 !important;
        border: 1px solid #d1d5db !important;
        background-color: white !important;
        color: #374151 !important;
        text-decoration: none !important;
        transition: all 0.15s ease-in-out !important;
        min-width: auto !important;
        height: auto !important;
    }
    
    .pagination-wrapper .relative.inline-flex.items-center.px-4.py-2:hover {
        background-color: #f3f4f6 !important;
        color: #1f2937 !important;
    }
    
    /* Disabled previous button on mobile */
    .pagination-wrapper span.relative.inline-flex.items-center.px-4.py-2 {
        background-color: #f9fafb !important;
        color: #9ca3af !important;
        cursor: not-allowed !important;
        border: 1px solid #d1d5db !important;
    }
}

/* Desktop-specific styles */
@media (min-width: 640px) {
    .pagination-wrapper .flex.justify-between.flex-1.sm\:hidden {
        display: none !important;
    }
    
    .pagination-wrapper .hidden.sm\:flex-1 {
        display: flex !important;
    }
    
    .pagination-wrapper .sm\:flex.sm\:items-center.sm\:justify-between {
        flex-direction: column !important;
        align-items: center !important;
        gap: 1rem !important;
    }
}

/* Enhanced visual improvements */
.pagination-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif !important;
}

/* Add subtle animation */
.pagination-wrapper .relative.inline-flex.items-center {
    transform: translateY(0) !important;
    transition: all 0.2s ease-in-out !important;
}

.pagination-wrapper a.relative.inline-flex.items-center:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.1) !important;
}

/* Improved spacing */
.pagination-wrapper .text-sm.text-gray-700 {
    margin-bottom: 1rem !important;
}

/* Better focus indicators */
.pagination-wrapper a.relative.inline-flex.items-center:focus-visible {
    outline: 2px solid #3b82f6 !important;
    outline-offset: 2px !important;
}

/* Accessibility improvements */
.pagination-wrapper [aria-label] {
    position: relative !important;
}

/* Custom scrollbar for mobile if needed */
.pagination-wrapper .relative.z-0.inline-flex.shadow-sm.rounded-md {
    overflow-x: auto !important;
    scrollbar-width: thin !important;
    scrollbar-color: #d1d5db transparent !important;
}

.pagination-wrapper .relative.z-0.inline-flex.shadow-sm.rounded-md::-webkit-scrollbar {
    height: 4px !important;
}

.pagination-wrapper .relative.z-0.inline-flex.shadow-sm.rounded-md::-webkit-scrollbar-track {
    background: transparent !important;
}

.pagination-wrapper .relative.z-0.inline-flex.shadow-sm.rounded-md::-webkit-scrollbar-thumb {
    background-color: #d1d5db !important;
    border-radius: 2px !important;
}

/* Alternative modern design option - uncomment if you prefer */
/*
.pagination-wrapper .relative.z-0.inline-flex.shadow-sm.rounded-md {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    padding: 2px !important;
    border-radius: 0.75rem !important;
}

.pagination-wrapper .relative.inline-flex.items-center {
    background-color: white !important;
    margin: 1px !important;
    border-radius: 0.5rem !important;
}

.pagination-wrapper span[aria-current="page"] .relative.inline-flex.items-center {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
}
*/