/**
 * 高级分类筛选样式
 * 与 category.css 风格统一
 * @package Developer_Starter
 */

/* ==========================================
   高级分类筛选区域
   ========================================== */

.adv-filter-section {
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

/* 筛选行 */
.adv-filter-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
}

.adv-filter-row:last-child {
    margin-bottom: 0;
}

/* 筛选标签 */
.adv-filter-label {
    font-weight: 600;
    font-size: 0.9rem;
    color: #1e293b;
    min-width: 70px;
    flex-shrink: 0;
}

/* 筛选按钮组 */
.adv-filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* 筛选按钮 - 与分类标签风格统一 */
.adv-filter-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 20px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #64748b;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.adv-filter-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--color-primary, #3b82f6) 0%, var(--color-primary-dark, #2563eb) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.adv-filter-btn span,
.adv-filter-btn {
    position: relative;
    z-index: 1;
}

.adv-filter-btn:hover {
    color: #1e293b;
    background: #e2e8f0;
    border-color: #cbd5e1;
    transform: translateY(-1px);
}

.adv-filter-btn.active {
    color: #fff;
    background: linear-gradient(135deg, var(--color-primary, #3b82f6) 0%, var(--color-primary-dark, #2563eb) 100%);
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
}

.adv-filter-btn.active:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

/* 加载状态 */
.adv-filter-loading {
    display: none;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #94a3b8;
}

.adv-filter-loading.show {
    display: flex;
}

.adv-filter-loading .spinner {
    width: 24px;
    height: 24px;
    border: 2px solid #e2e8f0;
    border-top-color: var(--color-primary, #2563eb);
    border-radius: 50%;
    animation: adv-filter-spin 0.8s linear infinite;
    margin-right: 10px;
}

@keyframes adv-filter-spin {
    to {
        transform: rotate(360deg);
    }
}

/* 筛选结果统计 */
.adv-filter-result-info {
    text-align: center;
    padding: 12px 20px;
    margin-bottom: 20px;
    background: #f8fafc;
    border-radius: 10px;
    font-size: 0.9rem;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

.adv-filter-result-info strong {
    color: var(--color-primary, #2563eb);
}

/* 无结果提示 */
.adv-filter-no-results {
    text-align: center;
    padding: 80px 20px;
    color: #94a3b8;
}

.adv-filter-no-results svg {
    width: 64px;
    height: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.adv-filter-no-results p {
    font-size: 1.1rem;
    margin: 0;
}

/* ==========================================
   响应式适配
   ========================================== */

@media (max-width: 992px) {
    .adv-filter-section {
        padding: 16px 0;
    }

    .adv-filter-row {
        gap: 10px;
    }

    .adv-filter-btn {
        padding: 7px 16px;
        font-size: 0.85rem;
    }
}

@media (max-width: 768px) {
    .adv-filter-section {
        padding: 14px 0;
        position: relative;
        top: auto;
    }

    .adv-filter-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .adv-filter-label {
        min-width: auto;
        font-size: 0.85rem;
    }

    .adv-filter-buttons {
        width: 100%;
        gap: 8px;
    }

    .adv-filter-btn {
        padding: 6px 14px;
        font-size: 0.8rem;
        border-radius: 20px;
    }
}

@media (max-width: 576px) {
    .adv-filter-btn {
        padding: 5px 12px;
        font-size: 0.75rem;
    }
}

/* ==========================================
   暗黑模式 - 与 category.css 保持一致
   ========================================== */

html.dark-mode .adv-filter-section {
    background: var(--dm-bg-card, #1e293b);
    border-color: var(--dm-border, #334155);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

html.dark-mode .adv-filter-label {
    color: var(--dm-text, #e2e8f0);
}

html.dark-mode .adv-filter-btn {
    background: var(--dm-bg-card, #1e293b);
    color: var(--dm-text-muted, #94a3b8);
    border-color: var(--dm-border, #334155);
}

html.dark-mode .adv-filter-btn:hover {
    background: #334155;
    color: var(--dm-text, #e2e8f0);
    border-color: #475569;
}

html.dark-mode .adv-filter-btn.active {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #fff;
    border-color: transparent;
}

html.dark-mode .adv-filter-result-info {
    background: rgba(30, 41, 59, 0.5);
    border-color: var(--dm-border, #334155);
    color: var(--dm-text-muted, #94a3b8);
}

html.dark-mode .adv-filter-no-results {
    color: var(--dm-text-muted, #94a3b8);
}