/**
 * Image to WebP batch converter — queue carousel layout.
 */

.sn-img--webp {
	padding-bottom: 2rem;
}

.sn-webp-layout {
	display: grid;
	grid-template-columns: 1fr;
	gap: 1rem;
}

@media (min-width: 960px) {
	.sn-webp-layout {
		grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
		align-items: start;
	}
}

.sn-webp-main {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	min-width: 0;
}

.sn-webp-main .sn-img-drop {
	min-height: 300px;
}

.sn-webp-sidebar {
	display: flex;
	flex-direction: column;
	gap: 0.85rem;
	padding: 1rem;
	border: 1px solid var(--sn-img-border);
	border-radius: 1rem;
	background: #fff;
	box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.sn-webp-sidebar__actions {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.55rem;
}

.sn-webp-btn-add,
.sn-webp-btn-clear,
.sn-webp-download-all {
	width: 100%;
}

.sn-webp-btn-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.35rem;
	height: 1.35rem;
	border-radius: 999px;
	background: rgba(0, 0, 0, 0.12);
	font-size: 0.85rem;
	font-weight: 700;
	line-height: 1;
}

.sn-img-btn--secondary .sn-webp-btn-icon,
.sn-img-btn--primary .sn-webp-btn-icon {
	background: rgba(255, 255, 255, 0.25);
}

.sn-webp-btn-icon--muted {
	background: #e2e8f0;
	color: var(--sn-img-text);
}

.sn-webp-select {
	appearance: none;
	-webkit-appearance: none;
	-moz-appearance: none;
	padding-right: 2.5rem;
	background-color: #eef6ff;
	background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%231e3a5f' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
	background-repeat: no-repeat;
	background-position: right 0.75rem center;
	background-size: 14px 10px;
	border-color: #bfdbfe;
	font-weight: 600;
	cursor: pointer;
}

.sn-webp-select:hover {
	border-color: var(--sn-img-secondary);
	background-color: #e3effc;
}

.sn-webp-select:focus {
	background-color: #eef6ff;
}

.sn-webp-select option {
	background: #fff;
	color: var(--sn-img-text);
	font-weight: 500;
}

.sn-webp-download-all {
	position: relative;
	margin-top: 0.25rem;
}

.sn-webp-badge {
	position: absolute;
	top: -0.45rem;
	right: -0.35rem;
	min-width: 1.35rem;
	height: 1.35rem;
	padding: 0 0.35rem;
	border-radius: 999px;
	background: var(--sn-img-primary);
	color: #1a1a1a;
	font-size: 0.6875rem;
	font-weight: 800;
	line-height: 1.35rem;
	text-align: center;
	box-shadow: 0 2px 6px rgba(15, 23, 42, 0.15);
}

.sn-webp-queue__toolbar {
	display: grid;
	grid-template-columns: auto 1fr auto;
	gap: 0.35rem;
	align-items: stretch;
}

.sn-webp-carousel {
	display: flex;
	gap: 0.65rem;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	padding: 0.35rem 0.15rem 0.65rem;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: thin;
}

.sn-webp-carousel-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2rem;
	border: 1px solid var(--sn-img-border);
	border-radius: 0.65rem;
	background: #fff;
	color: var(--sn-img-muted);
	font-size: 1.35rem;
	font-weight: 700;
	line-height: 1;
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.sn-webp-carousel-btn:hover {
	border-color: var(--sn-img-secondary);
	color: var(--sn-img-secondary);
	background: #eef6ff;
}

.sn-webp-queue__status {
	margin: 0;
	font-size: 0.8125rem;
	color: var(--sn-img-muted);
	line-height: 1.45;
}

.sn-webp-card {
	flex: 0 0 148px;
	scroll-snap-align: start;
	display: flex;
	flex-direction: column;
	border: 1px solid #334155;
	border-radius: 0.65rem;
	background: #1e293b;
	color: #fff;
	overflow: hidden;
	box-shadow: 0 4px 14px rgba(15, 23, 42, 0.18);
}

.sn-webp-card__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.35rem;
	padding: 0.4rem 0.45rem;
	background: #0f172a;
	font-size: 0.6875rem;
	font-weight: 600;
}

.sn-webp-card__name {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.sn-webp-card__remove {
	flex-shrink: 0;
	width: 1.25rem;
	height: 1.25rem;
	border: 0;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.12);
	color: #fff;
	font-size: 0.9rem;
	line-height: 1;
	cursor: pointer;
}

.sn-webp-card__remove:hover {
	background: rgba(220, 38, 38, 0.85);
}

.sn-webp-card__thumb {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	height: 108px;
	background: #334155;
	overflow: hidden;
}

.sn-webp-card__thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.sn-webp-card__check {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(15, 23, 42, 0.45);
	font-size: 2rem;
	font-weight: 800;
	color: #fff;
	text-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
	pointer-events: none;
}

.sn-webp-card__spinner {
	position: absolute;
	width: 1.75rem;
	height: 1.75rem;
	border: 3px solid rgba(255, 255, 255, 0.25);
	border-top-color: #fff;
	border-radius: 999px;
	animation: sn-webp-spin 0.7s linear infinite;
}

@keyframes sn-webp-spin {
	to { transform: rotate(360deg); }
}

.sn-webp-card__foot {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 0.35rem;
	padding: 0.45rem;
	background: #0f172a;
}

.sn-webp-card__download {
	min-height: 1.75rem;
	padding: 0.2rem 0.45rem;
	border: 0;
	border-radius: 0.35rem;
	background: #fff;
	color: #0f172a;
	font-size: 0.625rem;
	font-weight: 800;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	cursor: pointer;
}

.sn-webp-card__download:disabled {
	opacity: 0.45;
	cursor: not-allowed;
}

.sn-webp-card__settings {
	width: 1.75rem;
	height: 1.75rem;
	border: 0;
	border-radius: 0.35rem;
	background: rgba(255, 255, 255, 0.12);
	color: #fff;
	font-size: 0.8rem;
	cursor: pointer;
}

.sn-webp-card__settings:hover,
.sn-webp-card__settings[aria-expanded="true"] {
	background: var(--sn-img-secondary);
}

.sn-webp-card__size {
	padding: 0 0.45rem 0.35rem;
	font-size: 0.625rem;
	color: #94a3b8;
	text-align: center;
}

.sn-webp-card__error {
	margin: 0;
	padding: 0 0.45rem 0.45rem;
	font-size: 0.625rem;
	color: #fca5a5;
	line-height: 1.35;
}

.sn-webp-card__panel {
	padding: 0.5rem;
	border-top: 1px solid #334155;
	background: #0f172a;
}

.sn-webp-card__panel-title {
	margin: 0 0 0.45rem;
	font-size: 0.625rem;
	color: #94a3b8;
}

.sn-webp-card__field {
	display: flex;
	flex-direction: column;
	gap: 0.2rem;
	margin-bottom: 0.45rem;
	font-size: 0.625rem;
}

.sn-webp-card__field select {
	min-height: 1.75rem;
	padding: 0.2rem 0.35rem;
	border: 1px solid #475569;
	border-radius: 0.35rem;
	background: #1e293b;
	color: #fff;
	font-size: 0.6875rem;
}

.sn-webp-card.is-error .sn-webp-card__thumb {
	background: #7f1d1d;
}

@media (max-width: 959px) {
	.sn-webp-sidebar__actions {
		grid-template-columns: 1fr;
	}
}
