/* =============================================================================
   UBDSC Pagination Styles
   ============================================================================= */

/* Wrapper */
.ubdsc-pagination-wrap {
    margin-top: 36px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: 16px;
}

/* ── Load More Button ──────────────────────────────────────────────────────── */
.ubdsc-load-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 32px;
    background: var(--primary-color, #00B0FF);
    color: #fff;
    border: none;
    border-radius: 99px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s, opacity 0.2s;
    line-height: 1.4;
}

.ubdsc-load-more-btn:hover {
    background: var(--primary-dark, #0096d6);
    transform: translateY(-1px);
}

.ubdsc-load-more-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.ubdsc-load-more-btn .ubdsc-spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: ubdsc-spin 0.7s linear infinite;
}

.ubdsc-load-more-btn.loading .ubdsc-spinner {
    display: inline-block;
}

/* ── Numbered Pagination ───────────────────────────────────────────────────── */
.ubdsc-numbers-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
}

.ubdsc-page-btn {
    min-width: 40px;
    height: 40px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #dce1f5;
    background: #fff;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    line-height: 1;
    margin: 0;
}

.ubdsc-page-btn:hover:not(:disabled) {
    border-color: var(--primary-color, #00B0FF);
    color: var(--primary-color, #00B0FF);
}

.ubdsc-page-btn.active {
    background: var(--primary-color, #00B0FF);
    border-color: var(--primary-color, #00B0FF);
    color: #fff;
}

.ubdsc-page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.ubdsc-page-btn.loading {
    pointer-events: none;
    opacity: 0.6;
}

/* ── Infinite Scroll ───────────────────────────────────────────────────────── */
.ubdsc-infinite-sentinel {
    width: 100%;
    height: 1px;
    display: block;
}

.ubdsc-infinite-loading {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #666;
    font-size: 14px;
    padding: 12px 0;
}

.ubdsc-infinite-loading.visible {
    display: flex;
}

.ubdsc-infinite-loading .ubdsc-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #dce1f5;
    border-top-color: var(--primary-color, #00B0FF);
    border-radius: 50%;
    animation: ubdsc-spin 0.7s linear infinite;
}

/* ── Shared spinner animation ──────────────────────────────────────────────── */
@keyframes ubdsc-spin {
    to { transform: rotate(360deg); }
}

/* ── Post grid loading state overlay ──────────────────────────────────────── */
.ubdsc-posts-grid.ubdsc-loading {
    opacity: 0.5;
    pointer-events: none;
    transition: opacity 0.2s;
}

/* ── Post enter animation ──────────────────────────────────────────────────── */
.ubdsc-post-enter {
    animation: ubdsc-fadein 0.35s ease both;
}

@keyframes ubdsc-fadein {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}
