/* ============================================
   Cumulative Filters - Editions SED
   ============================================ */

/* Filter group container */
.cumulative-filter-group {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e5e5e5;
}

.cumulative-filter-group:last-child {
    border-bottom: none;
}

/* Filter title */
.cumulative-filter-title {
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 10px 0;
    padding: 0;
    color: #333;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    position: relative;
    padding-right: 20px;
}

/* Filter list */
.cumulative-filter-list {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    max-height: 250px;
    overflow-y: auto;
}

.cumulative-filter-list li {
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

/* Filter label */
.cumulative-filter-label {
    display: flex;
    align-items: center;
    padding: 6px 8px;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    font-size: 14px;
    line-height: 1.4;
    gap: 8px;
}

.cumulative-filter-label:hover {
    background-color: #f5f5f5;
}

/* Checkbox styling */
.cumulative-filter-checkbox {
    width: 16px;
    height: 16px;
    min-width: 16px;
    margin: 0 !important;
    cursor: pointer;
    accent-color: #2563eb;
    flex-shrink: 0;
}

.cumulative-filter-checkbox:checked + .filter-term-name {
    font-weight: 600;
    color: #2563eb;
}

/* Term name */
.filter-term-name {
    flex: 1;
    color: #444;
    transition: color 0.2s, font-weight 0.2s;
}

/* Term count */
.filter-term-count {
    font-size: 12px;
    color: #999;
    margin-left: auto;
    flex-shrink: 0;
}

/* ============================================
   Active filter tags
   ============================================ */
.cumulative-filters-active-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 12px 0;
    margin-bottom: 15px;
    border-bottom: 1px solid #e5e5e5;
    align-items: center;
}

.cumulative-filter-tag {
    display: inline-flex;
    align-items: center;
    background: #2563eb;
    color: #fff;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    gap: 6px;
    line-height: 1.4;
}

.filter-tag-label {
    white-space: nowrap;
}

.cumulative-filter-tag-remove {
    color: #fff !important;
    text-decoration: none !important;
    font-size: 16px;
    font-weight: bold;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.cumulative-filter-tag-remove:hover {
    opacity: 1;
    color: #fff !important;
}

/* Reset button */
.cumulative-filters-reset {
    font-size: 12px;
    color: #e53e3e !important;
    text-decoration: underline !important;
    cursor: pointer;
    margin-left: 8px;
    white-space: nowrap;
}

.cumulative-filters-reset:hover {
    color: #c53030 !important;
}

/* ============================================
   Loading state
   ============================================ */
.cumulative-filter-loading {
    position: relative;
    min-height: 200px;
    opacity: 0.5;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.cumulative-filter-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 3px solid #e5e5e5;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: sed-filter-spin 0.8s linear infinite;
    z-index: 100;
}

@keyframes sed-filter-spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   No results
   ============================================ */
.cumulative-filter-no-results {
    padding: 40px 20px;
    text-align: center;
    width: 100%;
}

.cumulative-filter-no-results p {
    font-size: 16px;
    color: #666;
    margin: 0;
}

/* ============================================
   Pagination
   ============================================ */
.cumulative-filter-pagination {
    width: 100%;
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
}

.cumulative-filter-pagination ul.page-numbers {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.cumulative-filter-pagination .page-numbers li {
    list-style: none;
}

.cumulative-filter-pagination a.page-numbers,
.cumulative-filter-pagination span.page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
    font-size: 14px;
    transition: all 0.2s;
}

.cumulative-filter-pagination a.page-numbers:hover {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}

.cumulative-filter-pagination span.page-numbers.current {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
    font-weight: 600;
}

.cumulative-filter-pagination span.page-numbers.dots {
    border: none;
}

/* ============================================
   Scrollbar for filter lists
   ============================================ */
.cumulative-filter-list::-webkit-scrollbar {
    width: 4px;
}

.cumulative-filter-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 2px;
}

.cumulative-filter-list::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 2px;
}

.cumulative-filter-list::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
    .cumulative-filter-list {
        max-height: 200px;
    }

    .cumulative-filter-label {
        padding: 8px;
        font-size: 13px;
    }

    .cumulative-filters-active-tags {
        padding: 8px 0;
    }

    .cumulative-filter-tag {
        font-size: 11px;
        padding: 3px 8px;
    }
}
