/**
 * Jexi Taxonomy Filter Pagination Styles
 * Version: 1.2.0 - Fixed selectors + transitions
 */

/* =========================
   Pagination Container
   ========================= */
.jexi-tfp-wrapper {
    position: relative;
    width: 100%;
}

.jexi-tfp-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 20px 0;
    transition: opacity 0.3s ease;
}

.jexi-tfp-pagination.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* =========================
   Button Base Styles
   ========================= */
.jexi-tfp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    min-width: 40px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    text-decoration: none !important;
    color: #333;
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.25s ease;
    box-sizing: border-box;
}

/* Hover State */
.jexi-tfp-btn:hover:not(.disabled):not(.current) {
    color: #000;
    background-color: #e5e5e5;
    border-color: #ccc;
    text-decoration: none !important;
}

/* Focus State */
.jexi-tfp-btn:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* Active/Current State */
.jexi-tfp-btn.current {
    color: #fff;
    background-color: #333;
    border-color: #333;
    cursor: default;
}

/* Disabled State */
.jexi-tfp-btn.disabled {
    color: #aaa;
    background-color: #f9f9f9;
    border-color: #eee;
    cursor: not-allowed;
    pointer-events: none;
    opacity: 0.6;
}

/* =========================
   Page Numbers Container
   ========================= */
.jexi-tfp-numbers {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.jexi-tfp-numbers .jexi-tfp-btn {
    min-width: 36px;
    padding: 8px 12px;
}

/* Dots/Ellipsis */
.jexi-tfp-dots {
    padding: 8px 4px;
    color: #999;
    cursor: default;
}

/* =========================
   Loader / Spinner
   ========================= */
.jexi-tfp-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
}

.jexi-tfp-spinner {
    display: inline-block;
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #333;
    border-radius: 50%;
    animation: jexi-tfp-spin 0.8s linear infinite;
}

@keyframes jexi-tfp-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* =========================
   Loop Grid Transition States
   ========================= */
.elementor-loop-container {
    transition-property: transform, opacity;
    transition-timing-function: ease-out;
}

/* Loading overlay on grid */
.jexi-tfp-loading {
    position: relative;
    min-height: 200px;
}

.jexi-tfp-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #333;
    border-radius: 50%;
    animation: jexi-tfp-spin 0.8s linear infinite;
    z-index: 100;
}

/* =========================
   No Posts Message
   ========================= */
.jexi-tfp-no-posts {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-size: 16px;
}

/* =========================
   Fallback Item Styles
   ========================= */
.jexi-tfp-fallback-item {
    display: flex;
    flex-direction: column;
    padding: 20px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    margin-bottom: 20px;
}

.jexi-tfp-fallback-item .jexi-tfp-thumbnail {
    margin-bottom: 15px;
}

.jexi-tfp-fallback-item .jexi-tfp-thumbnail img {
    width: 100%;
    height: auto;
    border-radius: 4px;
}

.jexi-tfp-fallback-item .jexi-tfp-title {
    margin: 0 0 10px 0;
    font-size: 18px;
    line-height: 1.3;
}

.jexi-tfp-fallback-item .jexi-tfp-title a {
    color: #333;
    text-decoration: none;
}

.jexi-tfp-fallback-item .jexi-tfp-title a:hover {
    color: #0073aa;
}

.jexi-tfp-fallback-item .jexi-tfp-excerpt {
    color: #666;
    font-size: 14px;
    line-height: 1.6;
}

/* =========================
   Responsive Styles
   ========================= */
@media (max-width: 767px) {
    .jexi-tfp-pagination {
        gap: 8px;
        padding: 15px 0;
    }
    
    .jexi-tfp-btn {
        padding: 8px 14px;
        min-width: 36px;
        font-size: 13px;
    }
    
    .jexi-tfp-numbers .jexi-tfp-btn {
        padding: 6px 10px;
        min-width: 32px;
    }
}

@media (max-width: 480px) {
    .jexi-tfp-pagination {
        gap: 6px;
    }
    
    .jexi-tfp-prev,
    .jexi-tfp-next {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    /* Hide page numbers on very small screens */
    .jexi-tfp-numbers {
        display: none;
    }
}

/* =========================
   Accessibility
   ========================= */
.jexi-tfp-btn:focus-visible {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

.jexi-tfp-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
