/**
 * Filter Controls Styles - 优化过滤器体验
 * 增强交互、视觉层次和响应式设计
 * @version 2.0.0
 */

/* ===== Variables ===== */
:root {
	--filter-bg: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
	--filter-border: rgba(0, 0, 0, 0.08);
	--filter-hover: rgba(99, 102, 241, 0.08);
	--filter-active: linear-gradient(135deg, #6366f1, #a855f7);
	--filter-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
	--filter-shadow-hover: 0 6px 24px rgba(99, 102, 241, 0.2);
}

/* ===== 过滤器容器 ===== */
.agent-filters {
	background: var(--filter-bg);
	padding: 2rem;
	border-radius: 18px;
	margin-bottom: 2.5rem;
	max-width: 1280px;
	margin-left: auto;
	margin-right: auto;
	box-shadow: var(--filter-shadow);
	border: 1px solid var(--filter-border);
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.agent-filters:hover {
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

/* ===== 搜索框 ===== */
.filter-search {
	position: relative;
	margin-bottom: 2rem;
}

.filter-search input {
	width: 100%;
	padding: 1rem 1.25rem 1rem 3.5rem;
	border: 2px solid var(--filter-border);
	border-radius: 16px;
	font-size: 1rem;
	font-weight: 500;
	color: #1f2937;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	background: white;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.filter-search input::placeholder {
	color: #9ca3af;
	font-weight: 400;
}

.filter-search input:focus {
	outline: none;
	border-color: #6366f1;
	box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
	transform: translateY(-2px);
}

.filter-search::before {
	content: "🔍";
	position: absolute;
	left: 1.25rem;
	top: 50%;
	transform: translateY(-50%);
	font-size: 1.25rem;
	opacity: 0.6;
	transition: all 0.3s ease;
	pointer-events: none;
}

.filter-search:focus-within::before {
	opacity: 0.9;
	transform: translateY(-50%) scale(1.1);
}

/* ===== 过滤器组 ===== */
.filter-group {
	margin-bottom: 2rem;
}

.filter-group:last-child {
	margin-bottom: 0;
}

.filter-label {
	display: flex;
	align-items: center;
	gap: 0.625rem;
	font-weight: 700;
	font-size: 0.9375rem;
	color: #111827;
	margin-bottom: 1rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.filter-label::before {
	content: "";
	width: 4px;
	height: 18px;
	background: var(--filter-active);
	border-radius: 2px;
	flex-shrink: 0;
}

/* ===== 过滤器按钮 ===== */
.filter-buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
}

.filter-btn {
	position: relative;
	padding: 0.75rem 1.5rem;
	border: 2px solid rgba(0, 0, 0, 0.1);
	background: white;
	border-radius: 12px;
	font-size: 0.9375rem;
	font-weight: 600;
	color: #4b5563;
	cursor: pointer;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	white-space: nowrap;
	overflow: hidden;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.filter-btn::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: var(--filter-hover);
	opacity: 0;
	transition: opacity 0.3s ease;
	pointer-events: none;
}

.filter-btn:hover {
	border-color: #6366f1;
	color: #6366f1;
	transform: translateY(-3px) scale(1.02);
	box-shadow: var(--filter-shadow-hover);
}

.filter-btn:hover::before {
	opacity: 1;
}

.filter-btn.active {
	background: var(--filter-active);
	color: white;
	border-color: transparent;
	box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
	transform: translateY(-2px);
}

.filter-btn.active::before {
	opacity: 0;
}

.filter-btn:active {
	transform: translateY(0) scale(0.98);
}

/* Badge显示数量 */
.filter-btn .count {
	display: inline-block;
	margin-left: 0.5rem;
	padding: 0.125rem 0.5rem;
	background: rgba(0, 0, 0, 0.1);
	border-radius: 8px;
	font-size: 0.75rem;
	font-weight: 700;
}

.filter-btn.active .count {
	background: rgba(255, 255, 255, 0.3);
}

/* ===== 排序控制 ===== */
.filter-sort {
	display: flex;
	align-items: center;
	gap: 1rem;
	margin-top: 2rem;
	padding-top: 2rem;
	border-top: 2px solid rgba(0, 0, 0, 0.06);
}

.filter-sort-label {
	font-weight: 700;
	font-size: 0.875rem;
	color: #374151;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.filter-sort select {
	padding: 0.625rem 2.5rem 0.625rem 1rem;
	border: 2px solid var(--filter-border);
	border-radius: 10px;
	font-size: 0.9375rem;
	font-weight: 600;
	color: #1f2937;
	background: white;
	cursor: pointer;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='%234B5563' d='M4.427 6.573L8 10.146l3.573-3.573a.8.8 0 111.132 1.132l-4.139 4.138a.8.8 0 01-1.132 0L3.295 7.705a.8.8 0 011.132-1.132z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 0.75rem center;
}

.filter-sort select:hover {
	border-color: #6366f1;
	box-shadow: 0 2px 8px rgba(99, 102, 241, 0.15);
}

.filter-sort select:focus {
	outline: none;
	border-color: #6366f1;
	box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* ===== 清除按钮 ===== */
.filter-clear {
	margin-left: auto;
	padding: 0.625rem 1.25rem;
	border: 2px solid rgba(239, 68, 68, 0.3);
	background: white;
	border-radius: 10px;
	font-size: 0.875rem;
	font-weight: 700;
	color: #ef4444;
	cursor: pointer;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.filter-clear:hover {
	background: #ef4444;
	color: white;
	border-color: #ef4444;
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.filter-clear:active {
	transform: translateY(0);
}

/* ===== 结果计数 ===== */
.filter-results-count {
	margin-top: 1.5rem;
	padding: 1rem 1.5rem;
	background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
	border-radius: 12px;
	text-align: center;
	font-size: 0.9375rem;
	font-weight: 600;
	color: #374151;
	border: 1px solid rgba(0, 0, 0, 0.08);
}

.filter-results-count .count-number {
	display: inline-block;
	margin: 0 0.375rem;
	padding: 0.25rem 0.75rem;
	background: white;
	border-radius: 8px;
	font-weight: 800;
	color: #6366f1;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

/* ===== 响应式设计 ===== */
@media (max-width: 767px) {
	.agent-filters {
		padding: 1.5rem;
		margin-bottom: 2rem;
	}

	.filter-search input {
		padding: 0.875rem 1rem 0.875rem 3rem;
		font-size: 0.9375rem;
	}

	.filter-search::before {
		left: 1rem;
		font-size: 1.125rem;
	}

	.filter-buttons {
		gap: 0.75rem;
	}

	.filter-btn {
		padding: 0.625rem 1.25rem;
		font-size: 0.875rem;
	}

	.filter-sort {
		flex-direction: column;
		align-items: stretch;
		gap: 0.75rem;
	}

	.filter-clear {
		margin-left: 0;
		width: 100%;
	}
}

@media (min-width: 768px) and (max-width: 1023px) {
	.agent-filters {
		padding: 2rem;
	}

	.filter-buttons {
		gap: 0.875rem;
	}
}

/* ===== 动画 ===== */
@keyframes fadeIn {
	from {
		opacity: 0;
		transform: translateY(-10px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.agent-filters {
	animation: fadeIn 0.4s ease-out;
}

.filter-btn {
	animation: fadeIn 0.3s ease-out backwards;
}

.filter-btn:nth-child(1) {
	animation-delay: 0.05s;
}
.filter-btn:nth-child(2) {
	animation-delay: 0.1s;
}
.filter-btn:nth-child(3) {
	animation-delay: 0.15s;
}
.filter-btn:nth-child(4) {
	animation-delay: 0.2s;
}
.filter-btn:nth-child(5) {
	animation-delay: 0.25s;
}
.filter-btn:nth-child(6) {
	animation-delay: 0.3s;
}
.filter-btn:nth-child(7) {
	animation-delay: 0.35s;
}
.filter-btn:nth-child(8) {
	animation-delay: 0.4s;
}
