/**
 * TTO Bulk Media Editor – bulk bewerken in Media (lijst- en rasterweergave).
 *
 * @package TTO_Bulk_Media_Editor
 */

.media-toolbar .tto-bme-open,
.media-toolbar-secondary .tto-bme-open {
	display: inline-block;
	vertical-align: middle;
	align-self: center;
	margin: 0 8px 0 0;
}

.tto-bme-modal {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	box-sizing: border-box;
}

.tto-bme-modal[hidden] {
	display: none !important;
}

.tto-bme-backdrop {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba( 0, 0, 0, 0.6 );
	cursor: pointer;
}

.tto-bme-content {
	position: relative;
	background: #fff;
	border: 1px solid #c3c4c7;
	box-shadow: 0 4px 24px rgba( 0, 0, 0, 0.15 );
	border-radius: 4px;
	max-width: 640px;
	width: 100%;
	max-height: 85vh;
	display: flex;
	flex-direction: column;
}

.tto-bme-title {
	margin: 0 0 4px;
	padding: 16px 20px 0;
	font-size: 1.25rem;
}

.tto-bme-description {
	margin: 0 0 12px;
	padding: 0 20px;
	color: #50575e;
	font-size: 13px;
}

.tto-bme-list-wrap {
	flex: 1 1 auto;
	overflow-y: auto;
	padding: 0 20px 12px;
	min-height: 120px;
	max-height: 50vh;
}

.tto-bme-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.tto-bme-item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 8px 0;
	border-bottom: 1px solid #f0f0f1;
}

.tto-bme-item:last-child {
	border-bottom: none;
}

.tto-bme-thumb {
	flex-shrink: 0;
	width: 40px;
	height: 40px;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	background: #f0f0f1;
	border-radius: 2px;
}

.tto-bme-thumb img {
	display: block;
	width: 40px;
	height: 40px;
	object-fit: cover;
}

.tto-bme-no-thumb {
	background: #dcdcde;
}

.tto-bme-field {
	display: flex;
	flex-direction: column;
	gap: 2px;
	flex: 1;
	min-width: 0;
}

.tto-bme-label {
	display: block;
	font-size: 13px;
	color: #1d2327;
	font-weight: 600;
	margin: 0 0 2px 0;
	white-space: nowrap;
}

.tto-bme-filename-wrap {
	display: flex;
	align-items: center;
	min-width: 0;
	border: 1px solid #8c8f94;
	border-radius: 2px;
	background: #fff;
}

.tto-bme-filename-wrap:focus-within {
	border-color: #2271b1;
	box-shadow: 0 0 0 1px #2271b1;
}

.tto-bme-item .tto-bme-title-input {
	flex: 1;
	min-width: 0;
	padding: 6px 8px;
	margin: 0;
	border: 0;
	border-radius: 2px 0 0 2px;
	box-sizing: border-box;
}

.tto-bme-item .tto-bme-title-input:focus {
	outline: none;
}

.tto-bme-ext {
	flex-shrink: 0;
	align-self: stretch;
	display: flex;
	align-items: center;
	padding: 0 10px;
	font-size: 13px;
	color: #50575e;
	background: #f0f0f1;
	border-left: 1px solid #8c8f94;
	border-radius: 0 2px 2px 0;
	user-select: none;
	-webkit-user-select: none;
}

.tto-bme-item .tto-bme-input {
	width: 100%;
	min-width: 0;
	max-width: none;
	padding: 6px 8px;
	margin: 0;
	border: 1px solid #8c8f94;
	border-radius: 2px;
	box-sizing: border-box;
}

.tto-bme-item .tto-bme-input:focus {
	border-color: #2271b1;
	box-shadow: 0 0 0 1px #2271b1;
	outline: none;
}

.tto-bme-empty {
	padding: 16px 0;
	color: #50575e;
	text-align: center;
	font-style: italic;
}

.tto-bme-actions {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 16px 20px;
	border-top: 1px solid #f0f0f1;
	background: #f6f7f7;
	border-radius: 0 0 4px 4px;
}

.tto-bme-actions .tto-bme-spinner {
	margin-left: 8px;
}

.tto-bme-actions .tto-bme-spinner.hidden {
	display: none !important;
}
