/* === Shra2.com - Pagination & Dark Mode Fix (2026-03-07) === */

/* ========================================
   1. DARK MODE FIX
   ======================================== */

/* Force dark mode styles to apply */
[data-bs-theme="dark"] {
    color-scheme: dark;
}

[data-bs-theme="dark"] body {
    background-color: #181d25 !important;
    color: #cad0d9 !important;
}

[data-bs-theme="dark"] .bg-white,
[data-bs-theme="dark"] .bg-body {
    background-color: #1e2430 !important;
}

[data-bs-theme="dark"] .text-dark {
    color: #cad0d9 !important;
}

[data-bs-theme="dark"] .card,
[data-bs-theme="dark"] .dropdown-menu {
    background-color: #1e2430 !important;
    border-color: #2d3748 !important;
}

[data-bs-theme="dark"] input,
[data-bs-theme="dark"] select,
[data-bs-theme="dark"] textarea {
    background-color: #1e2430 !important;
    border-color: #2d3748 !important;
    color: #cad0d9 !important;
}

/* ========================================
   2. PAGINATION FIX - CLEAN UNIFIED STYLE
   ======================================== */

/* Remove ALL previous pagination styles */
/* This is a complete reset */

/* Container */
span.relative.z-0.inline-flex,
.relative.z-0.inline-flex {
    display: inline-flex !important;
    flex-wrap: wrap !important;
    gap: 4px !important;
    justify-content: center !important;
    align-items: stretch !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* ALL buttons - uniform styling */
span.relative.z-0.inline-flex > a,
span.relative.z-0.inline-flex > span {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 36px !important;
    height: 36px !important;
    padding: 0 10px !important;
    margin: 0 !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    line-height: 1 !important;
    border-radius: 6px !important;
    border: 1px solid #dee2e6 !important;
    background-color: #fff !important;
    color: #3490dc !important;
    text-decoration: none !important;
    transition: all 0.15s ease !important;
    box-sizing: border-box !important;
    vertical-align: top !important;
}

/* Inner span (for current page) */
span.relative.z-0.inline-flex > span > span {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 36px !important;
    height: 36px !important;
    padding: 0 10px !important;
    margin: 0 !important;
}

/* Remove negative margin causing overlap */
.-ml-px {
    margin-left: 0 !important;
}

/* Hover state */
span.relative.z-0.inline-flex > a:hover {
    background-color: #3490dc !important;
    color: #fff !important;
    border-color: #3490dc !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 2px 4px rgba(52, 144, 220, 0.2) !important;
}

/* Current page */
span[aria-current="page"],
span[aria-current="page"] > span {
    background-color: #3490dc !important;
    color: #fff !important;
    border-color: #3490dc !important;
}

/* Disabled state */
span.relative.z-0.inline-flex > span[aria-disabled="true"],
span.relative.z-0.inline-flex > span.disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
}

/* SVG icons */
span.relative.z-0.inline-flex svg {
    width: 16px !important;
    height: 16px !important;
    flex-shrink: 0 !important;
}

/* ========================================
   3. MOBILE PAGINATION
   ======================================== */
@media (max-width: 767.98px) {
    span.relative.z-0.inline-flex,
    .relative.z-0.inline-flex {
        gap: 3px !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        flex-wrap: nowrap !important;
        justify-content: flex-start !important;
        max-width: 100% !important;
        padding-bottom: 5px !important;
    }
    
    span.relative.z-0.inline-flex > a,
    span.relative.z-0.inline-flex > span,
    span.relative.z-0.inline-flex > span > span {
        min-width: 32px !important;
        height: 32px !important;
        padding: 0 6px !important;
        font-size: 12px !important;
        border-radius: 4px !important;
        flex-shrink: 0 !important;
    }
    
    /* Hide extra page numbers on mobile (keep only first 5 + last) */
    span.relative.z-0.inline-flex > *:nth-child(n+7):not(:last-child) {
        display: none !important;
    }
    
    span.relative.z-0.inline-flex svg {
        width: 12px !important;
        height: 12px !important;
    }
}

/* ========================================
   4. DARK MODE PAGINATION
   ======================================== */
[data-bs-theme="dark"] span.relative.z-0.inline-flex > a,
[data-bs-theme="dark"] span.relative.z-0.inline-flex > span {
    background-color: #1e2430 !important;
    border-color: #2d3748 !important;
    color: #3490dc !important;
}

[data-bs-theme="dark"] span.relative.z-0.inline-flex > a:hover {
    background-color: #3490dc !important;
    color: #fff !important;
    border-color: #3490dc !important;
}

[data-bs-theme="dark"] span[aria-current="page"],
[data-bs-theme="dark"] span[aria-current="page"] > span {
    background-color: #3490dc !important;
    color: #fff !important;
    border-color: #3490dc !important;
}

/* ========================================
   5. SAFARI SMOOTH SCROLL
   ======================================== */
@supports (-webkit-touch-callout: none) {
    span.relative.z-0.inline-flex {
        -webkit-overflow-scrolling: touch !important;
    }
}
