/**
 * Arena Grid
 *
 * Sirf filter bar, search box aur show/hide ka CSS. Cards ki styling theme ki
 * apni CSS se aati hai (.gt-gaming-card-item-5, .gt-popular-game-items) — usse
 * chheda nahi gaya.
 *
 * Saare colors CSS variables se aate hain, isliye scheme badalne par ek hi
 * jagah value badalti hai:
 *
 *   --agrid-accent        active button ka background
 *   --agrid-accent-text   active button par text
 *   --agrid-text          normal button / input ka text
 *   --agrid-muted         placeholder, icon, empty message
 *   --agrid-surface       button / input ka background
 *   --agrid-border        button / input ka border
 */

/* ------------------------------------------------------------------
 * Schemes
 * ---------------------------------------------------------------- */
.agrid-wrap {
	--agrid-accent: #c8f560;
	--agrid-accent-text: #0b0e13;
}

.agrid-scheme-dark {
	--agrid-text: #ffffff;
	--agrid-muted: rgba(255, 255, 255, 0.55);
	--agrid-surface: rgba(255, 255, 255, 0.06);
	--agrid-border: rgba(255, 255, 255, 0.16);
	--agrid-badge: rgba(0, 0, 0, 0.24);
}

.agrid-scheme-light {
	--agrid-text: #101418;
	--agrid-muted: rgba(16, 20, 24, 0.55);
	--agrid-surface: rgba(16, 20, 24, 0.04);
	--agrid-border: rgba(16, 20, 24, 0.16);
	--agrid-badge: rgba(16, 20, 24, 0.1);
}

/* ------------------------------------------------------------------
 * Toolbar — filter + search ka layout
 * ---------------------------------------------------------------- */
.agrid-toolbar {
	display: flex;
	flex-direction: column;
	gap: 20px;
	margin: 0 0 40px;
}

.agrid-toolbar--inline {
	flex-direction: row;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 16px 24px;
}

.agrid-toolbar--inline .agrid-filter {
	flex: 1 1 auto;
	margin: 0;
}

.agrid-toolbar--inline .agrid-search {
	flex: 0 0 auto;
}

/* Toolbar ke andar filter ka apna margin nahi chahiye — gap sambhal leta hai. */
.agrid-toolbar .agrid-filter {
	margin-bottom: 0;
}

/* Search akela ho to use bhi alignment mile. */
.agrid-toolbar--above .agrid-search,
.agrid-toolbar--below .agrid-search {
	margin-left: auto;
	margin-right: auto;
}

/* ------------------------------------------------------------------
 * Filter bar
 * ---------------------------------------------------------------- */
.agrid-filter {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 12px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.agrid-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	padding: 10px 24px;
	font: inherit;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.2;
	color: var(--agrid-text);
	background-color: transparent;
	border: 1px solid transparent;
	border-radius: 6px;
	cursor: pointer;
	transition: color 0.25s ease, background-color 0.25s ease, border-color 0.25s ease;
	-webkit-appearance: none;
	appearance: none;
}

.agrid-count {
	display: inline-block;
	min-width: 1.6em;
	padding: 1px 6px;
	font-size: 0.8em;
	font-weight: 700;
	text-align: center;
	border-radius: 999px;
	background-color: var(--agrid-badge);
}

.agrid-btn.is-active .agrid-count,
.agrid-btn:hover .agrid-count {
	background-color: rgba(0, 0, 0, 0.14);
}

/* --- Filter Style: Pills (default) --- */
.agrid-style-pills .agrid-btn {
	background-color: var(--agrid-surface);
	border-color: var(--agrid-border);
}

.agrid-style-pills .agrid-btn:hover,
.agrid-style-pills .agrid-btn:focus-visible,
.agrid-style-pills .agrid-btn.is-active {
	color: var(--agrid-accent-text);
	background-color: var(--agrid-accent);
	border-color: var(--agrid-accent);
}

/* --- Filter Style: Outline --- */
.agrid-style-outline .agrid-btn {
	background-color: transparent;
	border-color: var(--agrid-border);
	border-radius: 999px;
}

.agrid-style-outline .agrid-btn:hover,
.agrid-style-outline .agrid-btn:focus-visible,
.agrid-style-outline .agrid-btn.is-active {
	color: var(--agrid-accent-text);
	background-color: var(--agrid-accent);
	border-color: var(--agrid-accent);
}

/* --- Filter Style: Underline --- */
.agrid-style-underline .agrid-filter {
	gap: 28px;
}

.agrid-style-underline .agrid-btn {
	position: relative;
	padding: 6px 0 10px;
	color: var(--agrid-muted);
	background-color: transparent;
	border: 0;
	border-radius: 0;
}

.agrid-style-underline .agrid-btn::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 2px;
	background-color: var(--agrid-accent);
	transform: scaleX(0);
	transform-origin: left center;
	transition: transform 0.25s ease;
}

.agrid-style-underline .agrid-btn:hover,
.agrid-style-underline .agrid-btn:focus-visible,
.agrid-style-underline .agrid-btn.is-active {
	color: var(--agrid-text);
	background-color: transparent;
}

.agrid-style-underline .agrid-btn.is-active::after {
	transform: scaleX(1);
}

.agrid-style-underline .agrid-count {
	background-color: var(--agrid-badge);
}

/* --- Filter Style: Tabs ---
   Bar khud inline-flex hai taaki content jitni hi chaudi rahe. Alignment
   wrapper ke text-align se hota hai, isliye is style par Alignment control
   hide kar diya gaya hai. */
.agrid-style-tabs .agrid-toolbar {
	text-align: center;
}

.agrid-style-tabs .agrid-filter {
	display: inline-flex;
	flex-wrap: nowrap;
	gap: 0;
	width: auto;
	max-width: 100%;
	padding: 5px;
	overflow-x: auto;
	text-align: left;
	background-color: var(--agrid-surface);
	border: 1px solid var(--agrid-border);
	border-radius: 10px;
	scrollbar-width: none;
}

.agrid-style-tabs .agrid-filter::-webkit-scrollbar {
	display: none;
}

.agrid-style-tabs .agrid-btn {
	flex: 0 0 auto;
	white-space: nowrap;
	border-radius: 6px;
}

.agrid-style-tabs .agrid-btn:hover,
.agrid-style-tabs .agrid-btn:focus-visible,
.agrid-style-tabs .agrid-btn.is-active {
	color: var(--agrid-accent-text);
	background-color: var(--agrid-accent);
}

/* --- Filter Style: Dropdown --- */
.agrid-filter--dropdown {
	gap: 10px;
}

.agrid-select-label {
	font-size: 15px;
	font-weight: 600;
	color: var(--agrid-muted);
}

.agrid-select {
	min-width: 220px;
	padding: 11px 44px 11px 18px;
	font: inherit;
	font-size: 15px;
	font-weight: 600;
	color: var(--agrid-text);
	background-color: var(--agrid-surface);
	border: 1px solid var(--agrid-border);
	border-radius: 6px;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23888888' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 16px center;
}

.agrid-select:focus-visible {
	outline: 2px solid var(--agrid-accent);
	outline-offset: 2px;
}

/* Options browser ke native menu me render hote hain — unka color alag se dena
   padta hai, warna dark theme me white par white ho jaata hai. */
.agrid-select option {
	color: #111;
	background-color: #fff;
}

/* ------------------------------------------------------------------
 * Search box
 * ---------------------------------------------------------------- */
.agrid-search {
	position: relative;
	display: block;
	width: 320px;
	max-width: 100%;
}

.agrid-search-input {
	display: block;
	width: 100%;
	margin: 0;
	padding: 12px 18px;
	font: inherit;
	font-size: 15px;
	line-height: 1.4;
	color: var(--agrid-text);
	background-color: var(--agrid-surface);
	border: 1px solid var(--agrid-border);
	border-radius: 6px;
	transition: border-color 0.25s ease, background-color 0.25s ease;
	-webkit-appearance: none;
	appearance: none;
}

.agrid-search--icon .agrid-search-input {
	padding-left: 44px;
}

.agrid-search-input::placeholder {
	color: var(--agrid-muted);
	opacity: 1;
}

.agrid-search-input:focus {
	outline: none;
	border-color: var(--agrid-accent);
}

/* Browser ka apna clear "x" hata dete hain — apna wala button use hota hai. */
.agrid-search-input::-webkit-search-cancel-button,
.agrid-search-input::-webkit-search-decoration {
	-webkit-appearance: none;
	appearance: none;
}

.agrid-search-icon {
	position: absolute;
	top: 50%;
	left: 16px;
	transform: translateY(-50%);
	color: var(--agrid-muted);
	pointer-events: none;
}

.agrid-search-clear {
	position: absolute;
	top: 50%;
	right: 10px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	padding: 0;
	transform: translateY(-50%);
	color: var(--agrid-muted);
	background: none;
	border: 0;
	border-radius: 50%;
	cursor: pointer;
	transition: color 0.2s ease, background-color 0.2s ease;
}

.agrid-search-clear:hover,
.agrid-search-clear:focus-visible {
	color: var(--agrid-text);
	background-color: var(--agrid-badge);
}

.agrid-search-clear[hidden] {
	display: none;
}

/* ------------------------------------------------------------------
 * Grid
 * ---------------------------------------------------------------- */
.agrid-item.agrid-hide {
	display: none !important;
}

.agrid-empty {
	margin: 40px 0 0;
	text-align: center;
	color: var(--agrid-muted);
}

.agrid-empty[hidden] {
	display: none;
}

/* Cards ka fade-up — theme ke wow/fadeInUp jaisa hi effect, par filter ke baad
   dobara chal sake isliye apna rakha hai (WOW.js ek baar chal kar ruk jaata hai). */
.agrid-animate .agrid-item:not(.agrid-hide) {
	animation: agrid-fade-up 0.5s cubic-bezier(0.22, 0.61, 0.36, 1) both;
	animation-delay: calc(var(--agrid-i, 0) * 60ms);
}

@keyframes agrid-fade-up {
	from {
		opacity: 0;
		transform: translateY(24px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

/* Screen-reader-only label — theme me ye class na ho to bhi kaam kare. */
.agrid-wrap .screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

@media (prefers-reduced-motion: reduce) {
	.agrid-animate .agrid-item:not(.agrid-hide) {
		animation: none;
	}

	.agrid-btn,
	.agrid-search-input,
	.agrid-style-underline .agrid-btn::after {
		transition: none;
	}
}

@media (max-width: 767px) {
	.agrid-toolbar--inline {
		flex-direction: column;
		align-items: stretch;
	}

	.agrid-toolbar--inline .agrid-search {
		width: 100% !important;
	}
}

@media (max-width: 575px) {
	.agrid-toolbar {
		gap: 16px;
		margin-bottom: 28px;
	}

	.agrid-filter {
		gap: 8px;
	}

	.agrid-btn {
		padding: 8px 16px;
		font-size: 14px;
	}

	.agrid-style-underline .agrid-filter {
		gap: 18px;
	}

	.agrid-search,
	.agrid-select {
		width: 100% !important;
		min-width: 0;
	}
}
