/**
 * Taxonomy icon picker admin styles.
 *
 * @package ThemeREX\AutoDealer
 */

/* Trigger button — shows current icon + "Choose" */
.trx-ad-icon-trigger {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
	padding: 4px 10px;
	border: 1px solid #8c8f94;
	border-radius: 4px;
	background: #f6f7f7;
	font-size: 13px;
	line-height: 1;
}

.trx-ad-icon-trigger:hover {
	background: #f0f0f1;
	border-color: #2271b1;
}

.trx-ad-icon-trigger__preview {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
}

.trx-ad-icon-trigger__preview svg {
	width: 20px;
	height: 20px;
	color: #3c434a;
}

.trx-ad-icon-trigger__preview img {
	max-width: 20px;
	max-height: 20px;
}

.trx-ad-icon-trigger__label {
	color: #2271b1;
}

/* Modal overlay */
.trx-ad-icon-modal-overlay {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 100100;
	background: rgba(0, 0, 0, 0.5);
	align-items: center;
	justify-content: center;
}

.trx-ad-icon-modal-overlay--open {
	display: flex;
}

/* Modal box */
.trx-ad-icon-modal {
	background: #fff;
	border-radius: 8px;
	box-shadow: 0 8px 40px rgba(0, 0, 0, 0.25);
	width: 520px;
	max-width: 90vw;
	max-height: 80vh;
	display: flex;
	flex-direction: column;
}

.trx-ad-icon-modal__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 18px;
	border-bottom: 1px solid #dcdcde;
}

.trx-ad-icon-modal__header h3 {
	margin: 0;
	font-size: 15px;
}

.trx-ad-icon-modal__close {
	background: none;
	border: none;
	cursor: pointer;
	font-size: 20px;
	color: #666;
	line-height: 1;
	padding: 0 4px;
}

.trx-ad-icon-modal__close:hover {
	color: #d63638;
}

.trx-ad-icon-modal__body {
	padding: 18px;
	overflow-y: auto;
	flex: 1;
}

/* Icon grid inside modal */
.trx-ad-icon-picker {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.trx-ad-icon-picker__item {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border: 2px solid transparent;
	border-radius: 4px;
	cursor: pointer;
	background: #f6f7f7;
	transition: border-color 0.15s, background 0.15s;
}

.trx-ad-icon-picker__item:hover {
	background: #e8f0fe;
	border-color: #a0c4ff;
}

.trx-ad-icon-picker__item--selected {
	border-color: #2271b1;
	background: #e8f0fe;
}

.trx-ad-icon-picker__item svg {
	width: 24px;
	height: 24px;
	color: #3c434a;
}

.trx-ad-icon-picker__item--selected svg {
	color: #2271b1;
}

.trx-ad-icon-picker__none {
	font-size: 11px;
	color: #999;
	line-height: 40px;
}

/* Modal footer */
.trx-ad-icon-modal__footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 18px;
	border-top: 1px solid #dcdcde;
	gap: 10px;
}

/* Custom image upload */
.trx-ad-icon-upload {
	margin: 0;
}

.trx-ad-icon-upload__preview {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 0;
}

.trx-ad-icon-upload__preview img {
	max-width: 36px;
	max-height: 36px;
	border: 1px solid #dcdcde;
	border-radius: 4px;
	background: #f6f7f7;
	padding: 2px;
}

.trx-ad-icon-upload__remove {
	color: #b32d2e;
	cursor: pointer;
	text-decoration: underline;
	font-size: 12px;
}

.trx-ad-icon-upload__remove:hover {
	color: #a00;
}

/* Current icon display in term list table */
.trx-ad-term-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
}

.trx-ad-term-icon svg {
	width: 20px;
	height: 20px;
	color: #3c434a;
}

.trx-ad-term-icon img {
	max-width: 20px;
	max-height: 20px;
}
