/* 高级筛选样式 */

/* ==================== 高级筛选按钮 ==================== */

.btn-advanced-filter {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-advanced-filter:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.btn-advanced-filter i {
    font-size: 14px;
}

.btn-advanced-filter.active {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.btn-advanced-filter .filter-count {
    display: inline-block;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    font-size: 12px;
    font-weight: 700;
    line-height: 20px;
    text-align: center;
}

/* ==================== 高级筛选面板 ==================== */

.advanced-filter-modal {
    max-width: 700px;
}

.current-filters-section,
.presets-section {
    margin-bottom: 24px;
}

.current-filters-section h4,
.presets-section h4 {
    margin: 0 0 12px 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

/* ==================== 当前筛选条件标签 ==================== */

.current-filters-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 40px;
    padding: 12px;
    background: var(--bg-secondary, #f9fafb);
    border-radius: 8px;
}

.filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 13px;
    transition: all 0.2s ease;
}

.filter-tag:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.15);
}

.filter-tag-key {
    color: var(--text-secondary);
    font-weight: 500;
}

.filter-tag-value {
    color: var(--text-primary);
    font-weight: 600;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.filter-tag-remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    padding: 0;
    background: var(--danger-color, #ef4444);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 10px;
    transition: all 0.2s ease;
}

.filter-tag-remove:hover {
    background: #dc2626;
    transform: scale(1.1);
}

/* ==================== 筛选预设 ==================== */

.presets-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.presets-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 500px;
    overflow-y: auto;
}

.preset-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-secondary, #f9fafb);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.preset-item:hover {
    border-color: var(--primary-color);
    background: rgba(79, 70, 229, 0.05);
}

.preset-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.preset-info strong {
    font-size: 14px;
    color: var(--text-primary);
}

.preset-info .text-secondary {
    font-size: 12px;
}

.preset-actions {
    display: flex;
    gap: 8px;
}

/* ==================== 筛选统计 ==================== */

.filter-stats {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background: var(--bg-secondary, #f9fafb);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 16px;
}

.filter-stats-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.filter-stats-label {
    color: var(--text-secondary);
}

.filter-stats-value {
    color: var(--text-primary);
    font-weight: 600;
}

.filter-stats-value.highlight {
    color: var(--primary-color);
}

/* ==================== 筛选器组 ==================== */

.filter-group-advanced {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.filter-group-advanced label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.filter-row-advanced {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

/* ==================== 日期范围选择器 ==================== */

.date-range-picker {
    display: flex;
    gap: 12px;
    align-items: center;
}

.date-range-picker input[type="date"] {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    color: var(--text-primary);
}

.date-range-picker input[type="date"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.date-range-separator {
    color: var(--text-secondary);
    font-weight: 500;
}

/* ==================== 快速日期选择 ==================== */

.quick-date-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.btn-quick-date {
    padding: 6px 12px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 13px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-quick-date:hover {
    border-color: var(--primary-color);
    background: rgba(79, 70, 229, 0.05);
    color: var(--primary-color);
}

.btn-quick-date.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* ==================== 筛选提示 ==================== */

.filter-hint {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: rgba(59, 130, 246, 0.1);
    border-left: 4px solid #3b82f6;
    border-radius: 6px;
    margin-bottom: 16px;
}

.filter-hint i {
    color: #3b82f6;
    font-size: 18px;
}

.filter-hint-text {
    flex: 1;
    font-size: 13px;
    color: var(--text-primary);
}

/* ==================== 筛选结果为空 ==================== */

.filter-no-results {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.filter-no-results i {
    font-size: 64px;
    color: var(--text-tertiary);
    margin-bottom: 16px;
}

.filter-no-results h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.filter-no-results p {
    margin: 0 0 20px 0;
    font-size: 14px;
    color: var(--text-secondary);
}

/* ==================== 响应式设计 ==================== */

@media (max-width: 768px) {
    .advanced-filter-modal {
        max-width: 95vw;
    }

    .filter-row-advanced {
        grid-template-columns: 1fr;
    }

    .date-range-picker {
        flex-direction: column;
        align-items: stretch;
    }

    .date-range-separator {
        text-align: center;
    }

    .filter-tag-value {
        max-width: 120px;
    }

    .preset-item {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .preset-actions {
        justify-content: space-between;
    }

    .filter-stats {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .quick-date-buttons {
        flex-direction: column;
    }

    .btn-quick-date {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .btn-advanced-filter {
        padding: 6px 12px;
        font-size: 13px;
    }

    .filter-tag {
        font-size: 12px;
        padding: 4px 10px;
    }

    .preset-info strong {
        font-size: 13px;
    }
}

/* ==================== 深色模式 ==================== */

@media (prefers-color-scheme: dark) {
    .current-filters-list,
    .preset-item {
        background: rgba(255, 255, 255, 0.05);
        border-color: rgba(255, 255, 255, 0.1);
    }

    .filter-tag {
        background: rgba(255, 255, 255, 0.08);
        border-color: rgba(255, 255, 255, 0.15);
    }

    .filter-tag:hover {
        background: rgba(255, 255, 255, 0.12);
    }

    .preset-item:hover {
        background: rgba(255, 255, 255, 0.08);
    }

    .date-range-picker input[type="date"],
    .btn-quick-date {
        background: rgba(255, 255, 255, 0.05);
        border-color: rgba(255, 255, 255, 0.15);
        color: white;
    }

    .btn-quick-date:hover {
        background: rgba(255, 255, 255, 0.1);
    }

    .filter-stats {
        background: rgba(255, 255, 255, 0.05);
        border-color: rgba(255, 255, 255, 0.1);
    }
}

/* ==================== 动画效果 ==================== */

.filter-tag {
    animation: fadeInScale 0.3s ease-out backwards;
}

.filter-tag:nth-child(1) { animation-delay: 0.05s; }
.filter-tag:nth-child(2) { animation-delay: 0.1s; }
.filter-tag:nth-child(3) { animation-delay: 0.15s; }
.filter-tag:nth-child(4) { animation-delay: 0.2s; }
.filter-tag:nth-child(5) { animation-delay: 0.25s; }

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.preset-item {
    animation: slideInRight 0.3s ease-out backwards;
}

.preset-item:nth-child(1) { animation-delay: 0.05s; }
.preset-item:nth-child(2) { animation-delay: 0.1s; }
.preset-item:nth-child(3) { animation-delay: 0.15s; }

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 减少动画(辅助功能) */
@media (prefers-reduced-motion: reduce) {
    .filter-tag,
    .preset-item {
        animation: none;
    }
}
