/**
 * ==========================================================================
 * STIQ ZAD — Enterprise Public Pagination Design System
 * Institutional Green & Modern Accessible Pagination Component
 * ==========================================================================
 */

:root {
    --stiq-page-primary: #015f3f;
    --stiq-page-primary-dark: #014c32;
    --stiq-page-hover-bg: #f0fdf4;
    --stiq-page-text: #334155;
    --stiq-page-border: #e2e8f0;
    --stiq-page-disabled-text: #94a3b8;
    --stiq-page-disabled-bg: #f8fafc;
    --stiq-page-radius: 8px;
    --stiq-page-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
    --stiq-page-active-shadow: 0 3px 10px rgba(1, 95, 63, 0.28);
}

/* Wrapper Container */
.stiq-pagination-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin-top: 2.25rem;
    margin-bottom: 1.5rem;
    clear: both;
}

/* Base List Structure */
.stiq-pagination {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0;
    margin: 0;
    list-style: none;
}

.stiq-pagination .page-item {
    display: inline-flex;
    align-items: center;
    margin: 0;
    padding: 0;
}

/* Individual Link & Button Base */
.stiq-pagination .page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    padding: 0 14px;
    font-family: 'Work Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1;
    color: var(--stiq-page-text);
    background-color: #ffffff;
    border: 1px solid var(--stiq-page-border);
    border-radius: var(--stiq-page-radius);
    text-decoration: none;
    box-shadow: var(--stiq-page-shadow);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.stiq-pagination .page-link i {
    font-size: 1.15rem;
    line-height: 1;
    vertical-align: middle;
}

/* Hover State */
.stiq-pagination .page-item:not(.active):not(.disabled) .page-link:hover {
    color: var(--stiq-page-primary);
    background-color: var(--stiq-page-hover-bg);
    border-color: var(--stiq-page-primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(1, 95, 63, 0.12);
}

/* Keyboard Accessible Focus Ring */
.stiq-pagination .page-link:focus-visible {
    outline: 2px solid var(--stiq-page-primary);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(1, 95, 63, 0.18);
}

/* Active State */
.stiq-pagination .page-item.active .page-link {
    color: #ffffff;
    background: linear-gradient(135deg, var(--stiq-page-primary) 0%, var(--stiq-page-primary-dark) 100%);
    border-color: var(--stiq-page-primary-dark);
    box-shadow: var(--stiq-page-active-shadow);
    font-weight: 700;
    cursor: default;
    pointer-events: none;
}

/* Disabled State */
.stiq-pagination .page-item.disabled .page-link {
    color: var(--stiq-page-disabled-text);
    background-color: var(--stiq-page-disabled-bg);
    border-color: var(--stiq-page-border);
    box-shadow: none;
    cursor: not-allowed;
    opacity: 0.75;
    pointer-events: none;
}

/* Ellipsis Separator */
.stiq-pagination .page-item.ellipsis .page-link {
    background: transparent;
    border-color: transparent;
    color: #64748b;
    box-shadow: none;
    cursor: default;
    font-weight: 700;
    letter-spacing: 1.5px;
    pointer-events: none;
    min-width: 32px;
    padding: 0 4px;
}

/* Compact Mobile Screens */
@media (max-width: 576px) {
    .stiq-pagination-wrapper {
        margin-top: 1.5rem;
        margin-bottom: 1rem;
    }

    .stiq-pagination {
        gap: 4px;
    }

    .stiq-pagination .page-link {
        min-width: 36px;
        height: 36px;
        padding: 0 10px;
        font-size: 0.875rem;
        border-radius: 6px;
    }

    .stiq-pagination .page-link i {
        font-size: 1rem;
    }
}

/* Compact Sidebar Layout (Widget Sidebar / P3M Sidebar) */
.widget-sidebar .stiq-pagination-wrapper,
.p3m-sidebar .stiq-pagination-wrapper {
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

.widget-sidebar .stiq-pagination,
.p3m-sidebar .stiq-pagination {
    gap: 4px;
}

.widget-sidebar .stiq-pagination .page-link,
.p3m-sidebar .stiq-pagination .page-link {
    min-width: 34px;
    height: 34px;
    padding: 0 8px;
    font-size: 0.8125rem;
    border-radius: 6px;
}

.widget-sidebar .stiq-pagination .page-link .d-sm-inline,
.p3m-sidebar .stiq-pagination .page-link .d-sm-inline {
    display: none !important;
}

