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

/* ── Taxonomy Accordion Filter ─────────────────────────────────────────────── */
.ubdsc-filter-accordion-wrap {
    margin-bottom: 24px;
    width: 100%;
}

.ubdsc-filter-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
}

.ubdsc-filter-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 1;
    padding: 5px 20px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
    margin: 0 !important;
}

.ubdsc-filter-toggle:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.ubdsc-filter-toggle-title {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.ubdsc-filter-toggle-title i {
    color: var(--primary-color, #00B0FF);
    font-size: 15px;
}

.ubdsc-filter-toggle-icon {
    font-size: 13px;
    color: #64748b;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ubdsc-filter-toggle.active {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-color: #cbd5e1;
}

.ubdsc-filter-toggle.active .ubdsc-filter-toggle-icon {
    transform: rotate(180deg);
}

.ubdsc-filter-reset-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: #fef2f2;
    border: 1px solid #fecdd3;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #e11d48;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1;
    margin: 0 !important;
}

.ubdsc-filter-reset-btn:hover {
    background: #ffe4e6;
    border-color: #fda4af;
    transform: translateY(-1px);
}

.ubdsc-filter-content {
    padding: 20px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-top: none;
    border-radius: 0 0 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.04);
}

.ubdsc-filter-group {
    display: flex;
    flex-direction: column;
    background: #f8fafc;
    border: 1px solid #f1f5f9;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.2s ease;
}

.ubdsc-filter-group.active {
    border-color: #e2e8f0;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.ubdsc-filter-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 6px 16px;
    background: #f8fafc;
    border: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    color: #334155;
    text-align: left;
    outline: none;
    box-shadow: none;
    transition: background 0.15s ease;
    margin: 0 !important;
}

.ubdsc-filter-group-header:hover {
    background: #f1f5f9;
}

.ubdsc-filter-group-title-wrap {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.ubdsc-filter-group-label {
    font-size: 13px;
    font-weight: 700;
    color: #1e293b;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.ubdsc-filter-group-badge {
    padding: 3px 8px;
    background: #e2e8f0;
    color: #475569;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
}

.ubdsc-filter-group-icon {
    font-size: 11px;
    color: #64748b;
    transition: transform 0.25s ease;
}

.ubdsc-filter-group.active .ubdsc-filter-group-icon {
    transform: rotate(180deg);
}

.ubdsc-filter-terms {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 16px;
    background: #ffffff;
    border-top: 1px solid #f1f5f9;
}

.ubdsc-filter-term-btn {
    display: inline-flex;
    align-items: center;
    padding: 7px 16px;
    background: #f1f5f9;
    border: 1px solid transparent;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #334155;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    line-height: 1.4;
    outline: none;
    box-shadow: none;
    margin: 0 !important;
}

.ubdsc-filter-term-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
    transform: translateY(-1px);
}

.ubdsc-filter-term-btn.active {
    background: var(--primary-color, #00B0FF);
    border-color: var(--primary-color, #00B0FF);
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 176, 255, 0.25);
    transform: translateY(-1px);
}

/* 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):not(.active) {
    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); }
}

/* ── No Posts Message ──────────────────────────────────────────────────────── */
.ubdsc-no-posts-msg {
    margin: 0px 0;
    padding: 22px 8px;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    text-align: center;
    color: #475569;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    box-sizing: border-box;
    transition: all 0.25s ease-in-out;
}

.ubdsc-no-posts-msg:hover {
    border-color: #94a3b8;
    background: #f1f5f9;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.ubdsc-no-posts-text {
    max-width: 500px;
    margin: 0 auto;
}

