/**
 * Vehicle Data meta box styles.
 *
 * @package ThemeREX\AutoDealer
 */

/* === Layout === */
.trx-ad-vdata { display: flex; margin: -6px -12px -12px; min-height: 400px; }

/* === Left nav === */
.trx-ad-vdata-nav {
	display: flex;
	flex-direction: column;
	width: 180px;
	min-width: 180px;
	background: #f6f7f7;
	border-right: 1px solid #c3c4c7;
	padding: 8px 0;
}
.trx-ad-vdata-tab {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px 14px;
	text-decoration: none;
	color: #50575e;
	font-size: 13px;
	font-weight: 500;
	border-left: 3px solid transparent;
	transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.trx-ad-vdata-tab:hover { background: #ececec; color: #1d2327; }
.trx-ad-vdata-tab--active {
	background: #fff;
	color: #1d2327;
	border-left-color: #2271b1;
	font-weight: 600;
}
.trx-ad-vdata-tab .dashicons { font-size: 18px; width: 18px; height: 18px; color: #8c8f94; }
.trx-ad-vdata-tab--active .dashicons { color: #2271b1; }
.trx-ad-vdata-badge {
	display: inline-block;
	background: #dcdcde;
	color: #50575e;
	font-size: 11px;
	font-weight: 600;
	line-height: 1;
	padding: 2px 6px;
	border-radius: 10px;
	min-width: 14px;
	text-align: center;
	margin-left: auto;
}
.trx-ad-vdata-tab--active .trx-ad-vdata-badge {
	background: #2271b1;
	color: #fff;
}

/* === Content === */
.trx-ad-vdata-content { flex: 1; overflow: hidden; }
.trx-ad-vdata-panel { display: none; padding: 16px; }
.trx-ad-vdata-panel--active { display: block; }

/* === Gallery === */
.trx-ad-gallery-toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.trx-ad-gallery-hint { color: #8c8f94; font-size: 12px; font-style: italic; margin-left: auto; }
.trx-ad-gallery-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
	gap: 8px;
	min-height: 40px;
}
.trx-ad-gallery-item {
	position: relative;
	aspect-ratio: 1;
	border-radius: 4px;
	overflow: hidden;
	border: 2px solid transparent;
	cursor: grab;
	background: #f0f0f1;
	transition: border-color 0.15s;
}
.trx-ad-gallery-item:first-child { border-color: #2271b1; }
.trx-ad-gallery-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.trx-ad-gallery-item:hover { border-color: #2271b1; }
.trx-ad-gallery-item.ui-sortable-helper { box-shadow: 0 4px 12px rgba(0,0,0,0.15); opacity: 0.9; }
.trx-ad-gallery-item.ui-sortable-placeholder { visibility: visible !important; background: #e8f0fe; border: 2px dashed #2271b1; }
.trx-ad-gallery-remove {
	position: absolute; top: 4px; right: 4px;
	background: rgba(0,0,0,0.6); border: none; border-radius: 50%;
	width: 24px; height: 24px; cursor: pointer;
	display: none; align-items: center; justify-content: center; padding: 0;
}
.trx-ad-gallery-remove .dashicons { color: #fff; font-size: 16px; width: 16px; height: 16px; }
.trx-ad-gallery-item:hover .trx-ad-gallery-remove { display: flex; }
.trx-ad-gallery-badge {
	display: none; position: absolute; bottom: 4px; left: 4px;
	background: #2271b1; color: #fff; font-size: 10px; font-weight: 700;
	text-transform: uppercase; padding: 2px 6px; border-radius: 3px; letter-spacing: 0.5px;
}
.trx-ad-gallery-item:first-child .trx-ad-gallery-badge { display: block; }
.trx-ad-gallery-empty { text-align: center; padding: 40px 20px; color: #8c8f94; }
.trx-ad-gallery-empty .dashicons { font-size: 48px; width: 48px; height: 48px; color: #c3c4c7; margin-bottom: 8px; }

/* === Video === */
.trx-ad-video-section h4 { margin: 0 0 6px; font-size: 13px; }
.trx-ad-video-section .description { margin: 0 0 8px; }
.trx-ad-video-row {
	display: flex; align-items: center; gap: 8px;
	background: #f0f0f1; padding: 8px 10px; border-radius: 4px; margin-bottom: 6px;
}
.trx-ad-video-row .dashicons-media-video { color: #50575e; flex-shrink: 0; }
.trx-ad-video-filename { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trx-ad-video-row-remove { background: none; border: none; cursor: pointer; padding: 0; }
.trx-ad-video-row-remove .dashicons { color: #b32d2e; font-size: 16px; width: 16px; height: 16px; }
.trx-ad-ext-video-row { margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid #f0f0f1; }
.trx-ad-ext-video-row:last-child { border-bottom: none; }
.trx-ad-ext-video-input-row { display: flex; align-items: center; gap: 8px; }
.trx-ad-ext-video-input-row input { flex: 1; }
.trx-ad-ext-video-remove { background: none; border: none; cursor: pointer; padding: 0; }
.trx-ad-ext-video-remove .dashicons { color: #b32d2e; font-size: 20px; width: 20px; height: 20px; }
.trx-ad-video-embed-preview { margin-top: 8px; }
.trx-ad-video-embed-preview iframe { border-radius: 4px; max-width: 100%; }

/* === Classification === */
.trx-ad-tax-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px 24px; }
.trx-ad-tax-field--full { grid-column: 1 / -1; }
.trx-ad-tax-label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 5px; color: #1d2327; }
.trx-ad-tax-select { width: 100%; max-width: 100%; min-height: 32px; }

/* Native taxonomy multi-selects */
.trx-ad-tax-field .trx-ad-tax-multiselect {
	width: 100%;
	max-width: 100%;
	min-height: 110px;
	border: 1px solid #8c8f94;
	border-radius: 4px;
	background: #fff;
	font-size: 13px;
}
.trx-ad-tax-field .trx-ad-tax-multiselect:focus {
	border-color: #2271b1;
	box-shadow: 0 0 0 1px #2271b1;
	outline: none;
}
.trx-ad-tax-field .trx-ad-tax-multiselect option {
	padding: 3px 8px;
}
.trx-ad-tax-field .trx-ad-tax-multiselect option:checked {
	background: #2271b1 linear-gradient(0deg, #2271b1 0%, #2271b1 100%);
	color: #fff;
}

/* Feature checkboxes */
.trx-ad-feature-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.trx-ad-feature-group { background: #f6f7f7; border: 1px solid #dcdcde; border-radius: 4px; padding: 10px 12px; }
.trx-ad-feature-group-title { margin: 0 0 8px; font-size: 12px; font-weight: 700; text-transform: uppercase; color: #50575e; letter-spacing: 0.5px; }
.trx-ad-feature-checkboxes { display: flex; flex-direction: column; gap: 4px; }
.trx-ad-feature-checkbox { font-size: 13px; cursor: pointer; display: flex; align-items: center; gap: 4px; }
.trx-ad-feature-checkbox input { margin: 0; }
.trx-ad-checkbox-list { max-height: 200px; overflow-y: auto; border: 1px solid #dcdcde; border-radius: 4px; padding: 8px 10px; background: #fff; }
.trx-ad-checkbox-item { display: block; font-size: 13px; padding: 2px 0; cursor: pointer; }
.trx-ad-checkbox-item input { margin: 0 4px 0 0; }

/* === Custom Fields === */
.trx-ad-cf-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 24px; margin-bottom: 16px; }
.trx-ad-cf-field--full { grid-column: 1 / -1; }
.trx-ad-cf-label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 4px; }
.trx-ad-cf-select { width: 100%; }
.trx-ad-cf-group-title { margin: 20px 0 8px; font-size: 14px; border-bottom: 1px solid #dcdcde; padding-bottom: 6px; }
.trx-ad-cf-group-title:first-child { margin-top: 0; }
.trx-ad-cf-panel .description { margin-top: 2px; font-size: 12px; }

/* === Responsive === */
@media (max-width: 782px) {
	.trx-ad-vdata { flex-direction: column; }
	.trx-ad-vdata-nav { flex-direction: row; width: 100%; min-width: 0; overflow-x: auto; border-right: 0; border-bottom: 1px solid #c3c4c7; padding: 0; }
	.trx-ad-vdata-tab { border-left: 0; border-bottom: 3px solid transparent; white-space: nowrap; padding: 10px 12px; }
	.trx-ad-vdata-tab--active { border-bottom-color: #2271b1; border-left-color: transparent; }
	.trx-ad-tax-grid, .trx-ad-cf-grid { grid-template-columns: 1fr; }
}
