/**
 * Background Remover — styles.
 * Depends on tool.css + compressor.css (reuses the dropzone).
 */

.idl-bgr {
	max-width: 1000px;
	margin: 0 auto;
}

/* Mode selector (Auto vs Manual) */
.idl-bgr-mode {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
	margin-bottom: 18px;
}

.idl-bgr-mode-btn {
	display: flex;
	flex-direction: column;
	gap: 3px;
	text-align: left;
	padding: 14px 18px;
	border-radius: var(--idl-radius);
	border: 2px solid var(--idl-color-border);
	background: var(--idl-color-bg);
	color: var(--idl-color-text);
	cursor: pointer;
	font-family: inherit;
	transition: border-color 0.15s ease, background 0.15s ease;
}

.idl-bgr-mode-btn strong {
	font-size: 15px;
}

.idl-bgr-mode-btn span {
	font-size: 13px;
	color: var(--idl-color-muted);
}

.idl-bgr-mode-btn:hover {
	border-color: var(--idl-color-primary);
}

.idl-bgr-mode-btn.is-active {
	border-color: var(--idl-color-primary);
	background: var(--idl-color-primary-soft);
}

@media ( max-width: 560px ) {
	.idl-bgr-mode {
		grid-template-columns: 1fr;
	}
}

/* Two-panel workspace */
.idl-bgr-workspace {
	margin-top: 24px;
}

.idl-bgr-panels {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 18px;
	margin-bottom: 20px;
}

.idl-bgr-panel {
	margin: 0;
	border: 1px solid var(--idl-color-border);
	border-radius: var(--idl-radius);
	overflow: hidden;
	background: var(--idl-color-surface);
}

.idl-bgr-panel figcaption {
	font-size: 13px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--idl-color-muted);
	padding: 10px 14px;
	border-bottom: 1px solid var(--idl-color-border);
}

.idl-bgr-stage {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 14px;
	min-height: 200px;
	overflow: auto;
}

.idl-bgr-stage canvas {
	max-width: 100%;
	height: auto;
	display: block;
}

.idl-bgr-edited {
	cursor: crosshair;
	touch-action: none;
}

/* Checkerboard so transparency is visible */
.idl-bgr-checker {
	background-image:
		linear-gradient( 45deg, #c9d1dc 25%, transparent 25% ),
		linear-gradient( -45deg, #c9d1dc 25%, transparent 25% ),
		linear-gradient( 45deg, transparent 75%, #c9d1dc 75% ),
		linear-gradient( -45deg, transparent 75%, #c9d1dc 75% );
	background-size: 20px 20px;
	background-position: 0 0, 0 10px, 10px -10px, -10px 0;
}

@media ( prefers-color-scheme: dark ) {
	.idl-bgr-checker {
		background-image:
			linear-gradient( 45deg, #2a3340 25%, transparent 25% ),
			linear-gradient( -45deg, #2a3340 25%, transparent 25% ),
			linear-gradient( 45deg, transparent 75%, #2a3340 75% ),
			linear-gradient( -45deg, transparent 75%, #2a3340 75% );
	}
}

/* Controls */
.idl-bgr-controls {
	display: grid;
	grid-template-columns: repeat( 4, 1fr );
	gap: 16px;
	padding: 18px;
	background: var(--idl-color-surface);
	border: 1px solid var(--idl-color-border);
	border-radius: var(--idl-radius);
}

.idl-bgr-group {
	display: flex;
	flex-direction: column;
	gap: 10px;
	min-width: 0;
}

.idl-bgr-group-title {
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--idl-color-muted);
}

.idl-bgr-controls .idl-cc-field {
	flex-direction: column;
	align-items: flex-start;
	gap: 6px;
	font-size: 13.5px;
}

.idl-bgr-controls input[type="range"] {
	width: 100%;
	accent-color: var(--idl-color-primary);
}

.idl-bgr-bg-options {
	display: flex;
	flex-direction: column;
	gap: 8px;
	font-size: 14px;
}

.idl-bgr-bg-options label {
	display: flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
}

.idl-bgr-color {
	width: 28px;
	height: 24px;
	border: 1px solid var(--idl-color-border);
	border-radius: 6px;
	padding: 0;
	background: none;
	cursor: pointer;
}

.idl-bgr-tools {
	display: flex;
	gap: 8px;
}

.idl-bgr-tools .idl-btn {
	flex: 1 1 auto;
	min-height: 40px;
	padding: 8px 10px;
}

.idl-bgr-tool.is-active {
	background: var(--idl-color-primary);
	color: #fff;
	border-color: var(--idl-color-primary);
}

.idl-bgr-zoom {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 13.5px;
	color: var(--idl-color-muted);
	flex-wrap: wrap;
}

.idl-bgr-zoom .idl-btn {
	min-height: 34px;
	padding: 4px 12px;
	font-size: 15px;
}

.idl-bgr-downloads {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}

.idl-bgr-downloads .idl-btn {
	flex: 1 1 auto;
	min-height: 42px;
	padding: 9px 10px;
}

.idl-btn-ghost {
	background: transparent;
	border-color: transparent;
	color: var(--idl-color-muted);
	text-decoration: underline;
	padding: 6px;
	min-height: 0;
}

.idl-btn-ghost:hover {
	color: var(--idl-color-text);
}

.idl-bgr-bgimg-btn {
	min-height: 32px;
	padding: 5px 10px;
	font-size: 13px;
}

/* Bulk */
.idl-bgr-bulk {
	margin-top: 22px;
	padding: 20px;
	text-align: center;
	background: var(--idl-color-surface);
	border: 1px solid var(--idl-color-border);
	border-radius: var(--idl-radius);
}

.idl-bgr-bulk-info {
	margin: 0 0 14px;
	color: var(--idl-color-muted);
}

/* Responsive */
@media ( max-width: 900px ) {
	.idl-bgr-controls {
		grid-template-columns: repeat( 2, 1fr );
	}
}

@media ( max-width: 620px ) {
	.idl-bgr-panels {
		grid-template-columns: 1fr;
	}
	.idl-bgr-controls {
		grid-template-columns: 1fr;
	}
}
