/* Web Invaders Image Optimizer - isolated styles */

.wio-app {
	font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
	color: #0f172a;
	line-height: 1.3;
	padding: 16px 32px;
}

.wio-header {
	margin: 0 0 16px 0;
}

.wio-title {
	margin: 0 0 6px 0;
	font-size: 28px;
	font-weight: 700;
}

.wio-subtitle {
	margin: 0;
	color: #475569;
}

.wio-section-title {
	font-weight: 650;
	margin: 6px 0 10px 0;
}

.wio-presets {
	margin-bottom: 14px;
}

.wio-pills {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.wio-pill {
	border: 1px solid #c7d2fe;
	background: #eff6ff;
	color: #1d4ed8;
	border-radius: 999px;
	padding: 10px 12px;
	cursor: pointer;
	transition: transform 120ms ease, background 120ms ease, border-color 120ms ease;
	user-select: none;
	min-width: 170px;
}

.wio-pill:hover {
	transform: translateY(-1px);
	border-color: #93c5fd;
}

.wio-pill[aria-checked="true"] {
	background: rgba(255, 255, 255, 0.12);
	border-color: #2563eb;
	color: #1d4ed8;
}

.wio-pill-top {
	display: flex;
	align-items: baseline;
	gap: 8px;
	justify-content: center;
}

.wio-pill-label {
	font-weight: 700;
}

.wio-pill-desc {
	font-size: 12px;
	color: #4b5563;
	margin-top: 4px;
}

.wio-options {
	margin: 0 0 14px 0;
}

.wio-collapsible {
	border: 1px solid #e5e7eb;
	border-radius: 12px;
	padding: 12px 14px;
	background: #ffffff;
}

.wio-summary {
	cursor: pointer;
	font-weight: 650;
}

.wio-option-grid {
	margin-top: 12px;
	display: grid;
	gap: 12px;
}

.wio-field {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.wio-toggle {
	justify-content: flex-start;
}

.wio-toggle input[type="checkbox"] {
	width: 18px;
	height: 18px;
	accent-color: #2563eb;
}

.wio-label {
	font-weight: 600;
	color: #0f172a;
}

.wio-range {
	width: 240px;
}

.wio-input {
	width: 190px;
	padding: 8px 10px;
	border-radius: 8px;
	border: 1px solid #d1d5db;
}

.wio-custom-dims {
	display: grid;
	gap: 8px;
}

.wio-custom-row {
	display: flex;
	align-items: center;
	gap: 12px;
}

.wio-hint {
	color: #6b7280;
	font-size: 12px;
}

.wio-mono {
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.wio-dropzone {
	border: 2px dashed #c7d2fe;
	border-radius: 16px;
	padding: 22px 18px;
	background: #ffffff;
	transition: transform 150ms ease-out, box-shadow 150ms ease-out, border-color 150ms ease-out;
	margin-bottom: 16px;
}

.wio-dropzone-inner {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 8px;
	text-align: center;
}

.wio-dropzone-icon {
	width: 44px;
	height: 44px;
	border-radius: 12px;
	background: rgba(37, 99, 235, 0.12);
	border: 1px solid rgba(37, 99, 235, 0.28);
	position: relative;
}

.wio-dropzone-icon::after {
	content: "";
	position: absolute;
	left: 50%;
	top: 50%;
	width: 22px;
	height: 22px;
	border: 2px solid #2563eb;
	border-radius: 6px;
	transform: translate(-50%, -50%);
}

.wio-dropzone-text {
	font-weight: 750;
	margin: 0;
	font-size: 16px;
}

.wio-dropzone-sub {
	margin: 0;
	color: #64748b;
	font-size: 13px;
}

/* State: IDLE breathing */
.wio-state-idle {
	animation: wio-breath 2s ease-in-out infinite;
}

/* RESULTS should not breathe */
.wio-state-results {
	animation: none;
}

@keyframes wio-breath {
	0% {
		transform: scale(1);
		opacity: 0.7;
	}
	50% {
		transform: scale(1.02);
		opacity: 1;
	}
	100% {
		transform: scale(1);
		opacity: 0.7;
	}
}

/* State: DRAG_HOVER */
.wio-state-drag-hover {
	animation: none;
	transform: scale(1.02);
	border-color: #2563eb;
	box-shadow: 0 0 0 6px rgba(37, 99, 235, 0.18);
}

/* State: PROCESSING */
.wio-state-processing {
	animation: none;
	border-style: solid;
	border-color: #93c5fd;
}

.wio-stats {
	margin: 0 0 14px 0;
	padding: 10px 14px;
	border-radius: 12px;
	border: 1px solid #dbeafe;
	background: rgba(37, 99, 235, 0.05);
}

.wio-stats-row {
	display: flex;
	align-items: baseline;
	gap: 10px;
	flex-wrap: wrap;
}

.wio-stats-dot {
	width: 6px;
	height: 6px;
	background: #2563eb;
	border-radius: 50%;
	display: inline-block;
}

.wio-muted {
	color: #64748b;
	font-size: 12px;
}

.wio-results {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 12px;
}

.wio-result-card {
	background: #ffffff;
	border: 1px solid #e5e7eb;
	border-radius: 12px;
	padding: 12px;
	box-shadow: 0 1px 0 rgba(0, 0, 0, 0.03);
	opacity: 0;
	transform: translateY(10px);
	transition: opacity 200ms ease, transform 200ms ease;
	overflow: hidden;
}

.wio-result-card.wio-card-enter {
	opacity: 1;
	transform: translateY(0);
}

.wio-thumb {
	width: 100%;
	height: 150px;
	border-radius: 10px;
	background: #f8fafc;
	border: 1px solid #eef2ff;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	margin-bottom: 10px;
}

.wio-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.wio-card-filename {
	font-weight: 650;
	font-size: 13px;
	word-break: break-word;
	margin-bottom: 8px;
}

.wio-card-sizes {
	color: #334155;
	font-size: 12px;
	display: flex;
	flex-direction: column;
	gap: 5px;
	margin-bottom: 10px;
}

.wio-metric-good {
	color: #15803d;
}

.wio-metric-warn {
	color: #b45309;
}

.wio-progress {
	margin-top: 6px;
}

.wio-progress-bar {
	height: 10px;
	background: #e5e7eb;
	border-radius: 999px;
	overflow: hidden;
}

.wio-progress-bar-fill {
	height: 100%;
	width: 0%;
	background: #2563eb;
	transition: width 260ms ease;
}

.wio-download-check {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	border-radius: 999px;
	background: rgba(22, 163, 74, 0.1);
	border: 1px solid rgba(22, 163, 74, 0.25);
	color: #16a34a;
	font-weight: 800;
	margin-top: 10px;
	transform: scale(0.8);
	opacity: 0;
	transition: transform 220ms ease, opacity 220ms ease;
}

.wio-result-card.wio-card-downloaded .wio-download-check {
	transform: scale(1);
	opacity: 1;
}

.wio-actions {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin: 14px 0 4px 0;
}

.wio-counter {
	color: #475569;
	font-weight: 650;
	font-size: 13px;
}

.wio-actions-left {
	display: flex;
	align-items: center;
	gap: 10px;
}

.wio-actions-right {
	display: flex;
	align-items: center;
	gap: 10px;
}

.wio-button {
	border-radius: 8px;
	padding: 10px 14px;
	border: 1px solid transparent;
	cursor: pointer;
	font-weight: 700;
	transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease, border-color 120ms ease, opacity 120ms ease;
}

.wio-button:disabled {
	opacity: 0.5;
	cursor: not-allowed;
	box-shadow: none;
	transform: none;
}

.wio-button-secondary {
	background: #f1f5f9;
	border-color: #e5e7eb;
	color: #0f172a;
}

.wio-button-secondary:hover:not(:disabled) {
	background: #e2e8f0;
}

.wio-button-primary {
	background: #2563eb;
	border-color: #1d4ed8;
	color: #ffffff;
	box-shadow: 0 6px 16px rgba(37, 99, 235, 0.24);
}

.wio-button-primary:hover:not(:disabled) {
	transform: translateY(-1px);
	box-shadow: 0 10px 26px rgba(37, 99, 235, 0.28);
}

.wio-file-input {
	display: none;
}

/* Responsive */
@media (max-width: 1020px) {
	.wio-results {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
	.wio-range {
		width: 200px;
	}
}

@media (max-width: 720px) {
	.wio-results {
		grid-template-columns: 1fr;
	}

	.wio-actions {
		padding-bottom: 80px; /* space for sticky button */
	}

	.wio-actions-right {
		position: fixed;
		left: 16px;
		right: 16px;
		bottom: 16px;
		z-index: 50;
	}

	.wio-actions-right .wio-button-primary {
		width: 100%;
	}

	.wio-actions-left .wio-button-secondary {
		display: none;
	}

	.wio-range {
		width: 100%;
	}

	.wio-input {
		width: 150px;
	}

	.wio-custom-row {
		flex-direction: column;
		align-items: flex-start;
	}
}

