/**
 * CM Pagination Library Styles
 */

.cm-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.cm-page-btn {
    min-width: 40px;
    height: 40px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    background-color: #fff;
    color: #333;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.cm-page-btn:hover:not(:disabled) {
    background-color: #f5f5f5;
    border-color: #999;
}

.cm-page-btn:active:not(:disabled) {
    background-color: #e0e0e0;
}

.cm-page-btn.cm-page-current {
    background-color: #2271b1;
    border-color: #2271b1;
    color: #fff;
    cursor: default;
}

.cm-page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.cm-page-prev,
.cm-page-next {
    font-weight: 600;
}

.cm-page-dots {
    padding: 8px 4px;
    color: #666;
    font-size: 14px;
}

/* Loading state */
.cm-pagination-loading {
    opacity: 0.6;
    pointer-events: none;
}

.cm-pagination-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid #2271b1;
    border-top-color: transparent;
    border-radius: 50%;
    animation: cm-spin 0.6s linear infinite;
}

@keyframes cm-spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Pagination info */
.cm-pagination-info {
    text-align: center;
    margin: 10px 0;
    color: #666;
    font-size: 14px;
}

/* ===========================
   LOAD MORE BUTTON STYLE
   =========================== */

.cm-pagination-load-more {
    display: flex;
    justify-content: center;
    align-items: center;
}

.cm-load-more-btn {
    padding: 12px 32px;
    background-color: #2271b1;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cm-load-more-btn:hover {
    background-color: #135e96;
}

.cm-load-more-btn:active {
    background-color: #0d4a73;
}

.cm-load-more-btn:disabled {
    opacity: 0.6;
    cursor: wait;
}

.cm-pagination-load-more.cm-pagination-loading .cm-load-more-btn {
    opacity: 0.6;
    cursor: wait;
    pointer-events: none;
}

/* ===========================
   INFINITE SCROLL STYLE
   =========================== */

.cm-pagination-infinite-scroll {
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.cm-infinite-scroll-marker {
    min-height: 1px;
    width: 100%;
}

.cm-pagination-infinite-scroll.cm-pagination-loading::before {
    content: 'Loading...';
    color: #666;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cm-pagination-infinite-scroll.cm-pagination-loading .cm-infinite-scroll-marker::before {
    content: '';
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #2271b1;
    border-radius: 50%;
    animation: cm-spin 1s linear infinite;
}

/* ===========================
   RESPONSIVE ADJUSTMENTS
   =========================== */

@media (max-width: 600px) {
    .cm-pagination {
        gap: 4px;
    }

    .cm-page-btn {
        min-width: 36px;
        height: 36px;
        padding: 6px 10px;
        font-size: 13px;
    }

    .cm-page-dots {
        padding: 6px 2px;
        font-size: 13px;
    }

    .cm-load-more-btn {
        padding: 10px 24px;
        font-size: 14px;
    }
}
