/* ============================================
   Item Components
   ============================================ */

/* ---- Item Buttons ---- */

.itembutton {
	cursor: pointer;
}

/* ---- Left Panel: Item Slots ---- */

.itemslot {
	width: 84px;
	height: 84px;
	background: var(--bg-recessed);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	overflow: hidden;
}

.itempanel {
	display: grid;
	grid-template-columns: repeat(3, 84px);
	gap: 6px;
	justify-content: center;
}

.itemselect {
	width: 84px;
	height: 81px;
}

/* ---- Middle Panel: Rarity Columns ---- */

.rarity-container {
	flex: 0 0 auto;
	background: var(--bg-surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	display: grid;
	grid-template-columns: repeat(3, 96px);
	gap: 6px;
	padding: 10px;
	align-content: start;
	justify-content: center;
}

/* ---- Item Container (wrapper for icon + price + dropdown) ---- */

.itembutton.container {
	display: inline-block;
	position: relative;
}

.itembutton.container.middle {
	width: 84px;
	height: 84px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--bg-elevated);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	transition: border-color 0.15s, background 0.15s;
}

.itembutton.container.middle:hover {
	border-color: var(--accent);
	background: rgba(245, 158, 11, 0.06);
}

.itembutton.container.middle.dimmed {
	opacity: 0.35;
	transition: opacity 0.2s, border-color 0.15s, background 0.15s;
}

.itembutton.container.middle.dimmed:hover {
	opacity: 1;
}

/* ---- Item Images ---- */

.itemimage {
	display: block;
	width: 72px;
	height: 72px;
	border-radius: 4px;
}

.itemimage:hover {
	width: 76px;
	height: 76px;
}

.itemimage.recommend:hover {
	width: 72px;
	height: 72px;
	cursor: auto;
}

/* ---- Category-Colored Borders (left panel) ---- */

.itemslot[data-category="weapon"]   { border-bottom: 3px solid var(--cat-weapon); }
.itemslot[data-category="ability"]  { border-bottom: 3px solid var(--cat-ability); }
.itemslot[data-category="survival"] { border-bottom: 3px solid var(--cat-survival); }
.itemslot[data-category="gadget"]   { border-bottom: 3px solid var(--cat-gadget); }

/* ---- Item Containers by Location ---- */

.item.container {
	text-align: center;
}

.item.container.middle {
	width: 96px;
	display: flex;
	flex-direction: column;
	align-items: center;
}

.item.container.left {
	width: 84px;
	padding: 0;
	margin: auto;
}

/* ---- Item Price Label ---- */

.item.price {
	font-family: 'Rajdhani', 'Segoe UI', sans-serif;
	font-size: 1rem;
	font-weight: 600;
	color: var(--text-muted);
	margin-top: 2px;
	text-align: center;
	width: 100%;
}

.price-value {
	color: #ffffff;
	font-weight: 700;
}

.item.price.left {
	display: none;
}

/* ---- Stat Dropdown Tooltip ---- */

.placeholder.stats {
	position: relative;
}

.dropdown.stats {
	position: fixed;
	background: var(--bg-elevated);
	border: 1px solid var(--border-light);
	border-radius: var(--radius);
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
	z-index: 100;
	padding: 10px 14px;
	white-space: nowrap;
	color: var(--text);
	font-size: 1rem;
	pointer-events: none;
}

.dropdownitem.itemtitle {
	font-family: 'Rajdhani', 'Segoe UI', sans-serif;
	font-weight: 700;
	font-size: 1.2rem;
	color: var(--accent);
	margin-bottom: 4px;
}

.dropdownitem.cost {
	color: var(--accent-hover);
	font-weight: 600;
	margin-bottom: 4px;
}

.dropdownitem.itemtext {
	max-width: 280px;
	white-space: normal;
	color: var(--text-muted);
	font-size: 0.95rem;
	line-height: 1.4;
	margin-top: 6px;
	padding-top: 6px;
	border-top: 1px solid var(--border);
}

.stat-name {
	color: #f9d9a0;
	font-weight: 600;
}

/* ---- Right Panel: Stat Sliders ---- */

.item.container.right.slider {
	width: 28px;
	padding-right: 0;
}

.itembutton.container.right.slider {
	width: 32px;
	height: 32px;
}

.item.container.right.slider .itemimage {
	width: 28px;
	height: 28px;
}

.item.container.right.slider .itemimage:hover {
	width: 28px;
	height: 28px;
}

.item.price.right.slider {
	display: none;
}

.right.stat.container {
	display: flex;
	align-items: center;
	gap: 14px;
	padding-top: 12px;
}

.stat-total {
	font-family: 'Rajdhani', 'Segoe UI', sans-serif;
	font-size: 1rem;
	font-weight: 700;
	color: #ffffff;
	min-width: 30px;
	text-align: right;
}

.slider-wrap {
	position: relative;
	width: 200px;
	height: 20px;
}

.stat-bar {
	position: absolute;
	top: 50%;
	left: 0;
	height: 16px;
	transform: translateY(-50%);
	width: 0%;
	background: rgba(245, 158, 11, 0.4);
	border-radius: 2px;
	transition: width 0.3s ease;
	pointer-events: none;
	z-index: 0;
}

.input.slider {
	-webkit-appearance: none;
	appearance: none;
	width: 200px;
	height: 6px;
	background: transparent;
	border: 1px solid #1e3355;
	border-radius: 0;
	cursor: pointer;
	outline: none;
	position: absolute;
	top: 50%;
	left: 0;
	transform: translateY(-50%);
	margin: 0;
	z-index: 1;
}

/* Track — WebKit */
.input.slider::-webkit-slider-runnable-track {
	height: 6px;
	background: transparent;
	border: 1px solid #1e3355;
	border-radius: 0;
}

/* Track — Firefox */
.input.slider::-moz-range-track {
	height: 6px;
	background: transparent;
	border: 1px solid #1e3355;
	border-radius: 0;
}

/* Thumb — WebKit */
.input.slider::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	width: 14px;
	height: 20px;
	background: var(--accent);
	border: none;
	border-radius: 0;
	margin-top: -8px;
	cursor: pointer;
	box-shadow:
		0 0 6px rgba(245, 158, 11, 0.4),
		inset 0 1px 0 rgba(255, 255, 255, 0.15);
	clip-path: polygon(0 10%, 50% 0, 100% 10%, 100% 90%, 50% 100%, 0 90%);
	transition: box-shadow 0.15s ease, background 0.15s ease;
}

/* Thumb — Firefox */
.input.slider::-moz-range-thumb {
	width: 14px;
	height: 20px;
	background: var(--accent);
	border: none;
	border-radius: 0;
	cursor: pointer;
	box-shadow:
		0 0 6px rgba(245, 158, 11, 0.4),
		inset 0 1px 0 rgba(255, 255, 255, 0.15);
	clip-path: polygon(0 10%, 50% 0, 100% 10%, 100% 90%, 50% 100%, 0 90%);
	transition: box-shadow 0.15s ease, background 0.15s ease;
}

/* Hover state */
.input.slider:hover::-webkit-slider-thumb {
	background: var(--accent-hover);
	box-shadow: 0 0 10px rgba(245, 158, 11, 0.6);
}

.input.slider:hover::-moz-range-thumb {
	background: var(--accent-hover);
	box-shadow: 0 0 10px rgba(245, 158, 11, 0.6);
}

/* Active/dragging state */
.input.slider:active::-webkit-slider-thumb {
	background: #e8920a;
	box-shadow: 0 0 14px rgba(245, 158, 11, 0.8);
}

.input.slider:active::-moz-range-thumb {
	background: #e8920a;
	box-shadow: 0 0 14px rgba(245, 158, 11, 0.8);
}

/* Focus state */
.input.slider:focus-visible {
	outline: 1px solid var(--accent);
	outline-offset: 3px;
}

/* Firefox progress fill */
.input.slider::-moz-range-progress {
	height: 6px;
	background: linear-gradient(90deg, rgba(100, 160, 220, 0.5) 0%, rgba(100, 160, 220, 0.7) 100%);
	border: 1px solid #1e3355;
	border-radius: 0;
}

.dropdownitem.right.slider {
	display: none;
}

.dropdownitem.itemtitle.right.slider {
	display: initial;
	font-family: 'Rajdhani', 'Segoe UI', sans-serif;
	font-size: 1rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	color: var(--text-muted);
}
