/**
 * FaviconForge — favicon generator stylesheet.
 *
 * Loaded only on pages that render template-parts/generator.php.
 */

/* -------------------------------------------------------------------------
 * 1. Layout
 * ---------------------------------------------------------------------- */

.ff-gen {
	display: grid;
	grid-template-columns: minmax(0, 352px) minmax(0, 1fr);
	gap: 26px;
	align-items: start;
}

.ff-gen__panel {
	position: sticky;
	top: 88px;
	display: grid;
	gap: 14px;
	max-height: calc(100vh - 108px);
	padding: 18px;
	overflow-y: auto;
	border: 1px solid var(--ff-line);
	border-radius: var(--ff-radius);
	background: var(--ff-panel);
	scrollbar-width: thin;
}

.ff-gen__panel::-webkit-scrollbar {
	width: 8px;
}

.ff-gen__panel::-webkit-scrollbar-thumb {
	border: 2px solid transparent;
	border-radius: 999px;
	background-clip: content-box;
	background-color: var(--ff-line-strong);
}

.ff-gen__block {
	display: grid;
	gap: 12px;
	padding-bottom: 16px;
	border-bottom: 1px solid var(--ff-line);
}

.ff-gen__block:last-child {
	padding-bottom: 0;
	border-bottom: 0;
}

.ff-gen__block-title {
	color: var(--ff-muted);
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.09em;
	text-transform: uppercase;
}

.ff-gen__block-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
}

.ff-gen__block-actions {
	display: flex;
	align-items: center;
	gap: 2px;
	flex: none;
}

.ff-gen__preview {
	display: grid;
	gap: 18px;
	min-width: 0;
}

.ff-gen__stage {
	display: grid;
	gap: 16px;
	padding: 18px;
	border: 1px solid var(--ff-line);
	border-radius: var(--ff-radius);
	background: var(--ff-panel);
}

.ff-gen__output {
	display: grid;
	gap: 14px;
	padding: 18px;
	border: 1px solid var(--ff-line);
	border-radius: var(--ff-radius);
	background: var(--ff-panel);
}

/* -------------------------------------------------------------------------
 * 2. Source tabs and panes
 * ---------------------------------------------------------------------- */

.ff-tabs {
	display: flex;
	gap: 3px;
	padding: 3px;
	border: 1px solid var(--ff-line);
	border-radius: 999px;
	background: var(--ff-bg-soft);
}

.ff-tab {
	display: inline-flex;
	flex: 1;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 8px 10px;
	border: 0;
	border-radius: 999px;
	background: transparent;
	color: var(--ff-text-soft);
	font-size: 12.5px;
	font-weight: 600;
	white-space: nowrap;
	cursor: pointer;
	transition: background-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.ff-tab:hover {
	color: var(--ff-text);
}

.ff-tab.is-active {
	background: var(--ff-panel);
	color: var(--ff-text);
	box-shadow: var(--ff-shadow-sm);
}

.ff-tabs--sm {
	padding: 2px;
}

.ff-tabs--sm .ff-tab {
	flex: 0 0 auto;
	padding: 5px 11px;
	font-size: 11.5px;
}

.ff-pane {
	display: grid;
	gap: 12px;
}

.ff-pane[hidden] {
	display: none;
}

.ff-field-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
}

.ff-input--text {
	padding-block: 10px;
	font-size: 19px;
	font-weight: 600;
	letter-spacing: 0.03em;
	text-align: center;
	text-transform: uppercase;
}

/* -------------------------------------------------------------------------
 * 3. Drop zone
 * ---------------------------------------------------------------------- */

.ff-drop {
	display: grid;
	justify-items: center;
	gap: 5px;
	padding: 22px 16px;
	border: 1.5px dashed var(--ff-line-strong);
	border-radius: 14px;
	background: var(--ff-bg-soft);
	text-align: center;
	cursor: pointer;
	transition: border-color 0.18s ease, background-color 0.18s ease;
}

.ff-drop:hover,
.ff-drop:focus-visible,
.ff-drop.is-dragging {
	border-color: var(--ff-accent);
	background: var(--ff-accent-soft);
	outline: none;
}

.ff-drop__icon {
	display: grid;
	place-items: center;
	width: 46px;
	height: 46px;
	margin-bottom: 3px;
	border: 1px solid var(--ff-line);
	border-radius: 13px;
	background: var(--ff-panel);
	color: var(--ff-accent);
}

.ff-drop strong {
	color: var(--ff-text);
	font-size: 13.5px;
	font-weight: 600;
	line-height: 1.4;
}

.ff-drop__hint,
.ff-drop__paste {
	color: var(--ff-muted);
	font-size: 11.5px;
	line-height: 1.45;
}

.ff-drop__fake {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin-top: 7px;
	padding: 6px 13px;
	border: 1px solid var(--ff-line-strong);
	border-radius: 999px;
	background: var(--ff-panel);
	color: var(--ff-text);
	font-size: 12px;
	font-weight: 600;
}

.ff-drop.is-dragging .ff-drop__fake {
	border-color: var(--ff-accent);
	color: var(--ff-accent-ink);
}

/* -------------------------------------------------------------------------
 * 4. Shape, colour and range controls
 * ---------------------------------------------------------------------- */

.ff-shapes {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 6px;
}

.ff-shape {
	position: relative;
	display: grid;
	justify-items: center;
	gap: 6px;
	padding: 10px 6px;
	border: 1px solid var(--ff-line);
	border-radius: 12px;
	background: var(--ff-panel);
	color: var(--ff-text-soft);
	font-size: 11.5px;
	font-weight: 500;
	cursor: pointer;
	transition: border-color 0.16s ease, background-color 0.16s ease, color 0.16s ease;
}

.ff-shape:hover {
	border-color: var(--ff-line-strong);
	color: var(--ff-text);
}

.ff-shape input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.ff-shape:has(input:checked) {
	border-color: transparent;
	background: var(--ff-accent-soft);
	color: var(--ff-accent-ink);
	font-weight: 600;
}

.ff-shape__swatch {
	display: block;
	width: 26px;
	height: 26px;
	background: var(--ff-text-soft);
	opacity: 0.75;
	transition: background-color 0.16s ease, opacity 0.16s ease;
}

.ff-shape__swatch--rounded {
	border-radius: 7px;
}

.ff-shape__swatch--circle {
	border-radius: 50%;
}

.ff-shape__swatch--square {
	border-radius: 2px;
}

.ff-shape:has(input:checked) .ff-shape__swatch {
	background: var(--ff-accent);
	opacity: 1;
}

.ff-color {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 5px 8px 5px 5px;
	border: 1px solid var(--ff-line-strong);
	border-radius: 10px;
	background: var(--ff-bg);
}

.ff-color:focus-within {
	border-color: var(--ff-accent);
	box-shadow: 0 0 0 3px var(--ff-accent-soft);
}

.ff-color input[type="color"] {
	width: 28px;
	height: 28px;
	padding: 0;
	overflow: hidden;
	border: 0;
	border-radius: 7px;
	background: transparent;
	cursor: pointer;
	appearance: none;
	-webkit-appearance: none;
	flex: none;
}

.ff-color input[type="color"]::-webkit-color-swatch-wrapper {
	padding: 0;
}

.ff-color input[type="color"]::-webkit-color-swatch {
	border: 0;
	border-radius: 7px;
}

.ff-color input[type="color"]::-moz-color-swatch {
	border: 0;
	border-radius: 7px;
}

.ff-color input[type="text"] {
	width: 100%;
	min-width: 0;
	padding: 2px 0;
	border: 0;
	background: transparent;
	color: var(--ff-text);
	font-family: var(--ff-mono);
	font-size: 12px;
	text-transform: uppercase;
	outline: none;
}

.ff-range {
	display: grid;
	gap: 8px;
}

.ff-range__label {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	color: var(--ff-text-soft);
	font-size: 12.5px;
	font-weight: 500;
}

.ff-range output {
	color: var(--ff-muted);
	font-family: var(--ff-mono);
	font-size: 11.5px;
}

.ff-range input[type="range"] {
	width: 100%;
	height: 4px;
	margin: 4px 0;
	border-radius: 999px;
	background: var(--ff-line);
	accent-color: var(--ff-accent);
	appearance: none;
	-webkit-appearance: none;
	cursor: pointer;
}

.ff-range input[type="range"]::-webkit-slider-thumb {
	width: 16px;
	height: 16px;
	border: 2px solid #fff;
	border-radius: 50%;
	background: var(--ff-accent);
	box-shadow: 0 1px 4px rgba(16, 17, 28, 0.25);
	appearance: none;
	-webkit-appearance: none;
}

.ff-range input[type="range"]::-moz-range-thumb {
	width: 14px;
	height: 14px;
	border: 2px solid #fff;
	border-radius: 50%;
	background: var(--ff-accent);
	box-shadow: 0 1px 4px rgba(16, 17, 28, 0.25);
}

.ff-range input[type="range"]:focus-visible {
	outline: 2px solid var(--ff-accent);
	outline-offset: 4px;
}

.ff-mini {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 4px 9px;
	border: 1px solid transparent;
	border-radius: 999px;
	background: transparent;
	color: var(--ff-muted);
	font-size: 11.5px;
	font-weight: 600;
	cursor: pointer;
	transition: background-color 0.16s ease, color 0.16s ease;
}

.ff-mini:hover {
	background: var(--ff-accent-soft);
	color: var(--ff-accent-ink);
}

.ff-mini.is-copied {
	border-color: #1e8e5a;
	color: #1e8e5a;
}

/* -------------------------------------------------------------------------
 * 5. Size chips
 * ------------------------------------------------------------------------- */

.ff-chips--sizes {
	gap: 5px;
}

.ff-chip--size {
	padding: 6px 9px;
	font-size: 12px;
}

.ff-chip--size span {
	display: inline-flex;
	align-items: baseline;
	gap: 1px;
	font-variant-numeric: tabular-nums;
}

.ff-chip--size i {
	color: var(--ff-muted);
	font-size: 9.5px;
	font-style: normal;
	font-weight: 500;
}

.ff-chip--size:has(input:checked) i {
	color: inherit;
	opacity: 0.7;
}

.ff-chip input:focus-visible + span {
	outline: 2px solid var(--ff-accent);
	outline-offset: 3px;
	border-radius: 4px;
}

/* -------------------------------------------------------------------------
 * 6. Stage and mockups
 * ---------------------------------------------------------------------- */

.ff-stage {
	position: relative;
	display: grid;
	place-items: center;
	min-height: 300px;
	padding: 18px;
	border-radius: 13px;
	background-color: var(--ff-bg-soft);
	background-image:
		linear-gradient(45deg, rgba(120, 125, 150, 0.07) 25%, transparent 25%, transparent 75%, rgba(120, 125, 150, 0.07) 75%),
		linear-gradient(45deg, rgba(120, 125, 150, 0.07) 25%, transparent 25%, transparent 75%, rgba(120, 125, 150, 0.07) 75%);
	background-size: 22px 22px;
	background-position: 0 0, 11px 11px;
}

.ff-stage canvas {
	display: block;
	width: min(230px, 64%);
	height: auto;
	border-radius: 18px;
	filter: drop-shadow(0 16px 30px rgba(16, 17, 28, 0.22));
}

.ff-stage__empty {
	position: absolute;
	inset: auto 24px 24px;
	margin: 0;
	color: var(--ff-muted);
	font-size: 12.5px;
	text-align: center;
}

.ff-stage__empty[hidden] {
	display: none;
}

.ff-stage__badge {
	position: absolute;
	top: 12px;
	right: 12px;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 4px 9px;
	border: 1px solid var(--ff-line);
	border-radius: 999px;
	background: var(--ff-panel);
	color: var(--ff-muted);
	font-size: 10.5px;
	font-weight: 600;
	letter-spacing: 0.03em;
}

.ff-stage__badge::before {
	content: "";
	width: 5px;
	height: 5px;
	border-radius: 50%;
	background: #1e8e5a;
	box-shadow: 0 0 0 3px rgba(30, 142, 90, 0.14);
}

.ff-mockups {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 10px;
}

.ff-mockup {
	display: grid;
	gap: 6px;
	min-width: 0;
}

.ff-mockup__label {
	color: var(--ff-muted);
	font-size: 10px;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.ff-browser {
	display: flex;
	align-items: center;
	gap: 4px;
	height: 44px;
	padding: 0 8px;
	overflow: hidden;
	border: 1px solid var(--ff-line);
	border-radius: 10px;
	background: var(--ff-bg-soft);
}

.ff-browser__dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--ff-line-strong);
	flex: none;
}

.ff-browser__tab {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	min-width: 0;
	margin-left: 6px;
	padding: 4px 9px;
	border: 1px solid var(--ff-line);
	border-radius: 7px 7px 0 0;
	background: var(--ff-panel);
	color: var(--ff-text-soft);
	font-size: 10.5px;
}

.ff-browser__tab img {
	width: 14px;
	height: 14px;
	border-radius: 3px;
	flex: none;
}

.ff-browser__tab em {
	overflow: hidden;
	font-style: normal;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.ff-bookmarks {
	display: flex;
	align-items: center;
	gap: 12px;
	height: 44px;
	padding: 0 10px;
	overflow: hidden;
	border: 1px solid var(--ff-line);
	border-radius: 10px;
	background: var(--ff-bg-soft);
	color: var(--ff-text-soft);
	font-size: 10.5px;
}

.ff-bookmarks__item {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	min-width: 0;
	white-space: nowrap;
}

.ff-bookmarks__item img {
	width: 14px;
	height: 14px;
	border-radius: 3px;
	flex: none;
}

.ff-bookmarks__item--muted {
	color: var(--ff-muted);
}

.ff-homescreen {
	display: grid;
	place-items: center;
	height: 68px;
	border: 1px solid var(--ff-line);
	border-radius: 12px;
	background: linear-gradient(160deg, #dfe4f2, #eef1f8);
}

html[data-ff-theme="dark"] .ff-homescreen {
	background: linear-gradient(160deg, #1c2030, #262b3c);
}

.ff-homescreen__app {
	display: grid;
	justify-items: center;
	gap: 3px;
}

.ff-homescreen__app img {
	width: 34px;
	height: 34px;
	border-radius: 8px;
	box-shadow: 0 5px 12px rgba(16, 17, 28, 0.22);
}

.ff-homescreen__app em {
	max-width: 54px;
	overflow: hidden;
	color: #3d4258;
	font-size: 9px;
	font-style: normal;
	text-overflow: ellipsis;
	white-space: nowrap;
}

html[data-ff-theme="dark"] .ff-homescreen__app em {
	color: #dfe3ee;
}

/* -------------------------------------------------------------------------
 * 7. Output: size thumbnails, actions and snippet
 * ---------------------------------------------------------------------- */

.ff-sizes-preview {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.ff-sizes-preview:empty {
	display: none;
}

.ff-size-thumb {
	display: grid;
	justify-items: center;
	gap: 4px;
	width: 62px;
	padding: 8px 4px 6px;
	border: 1px solid var(--ff-line);
	border-radius: 10px;
	background: var(--ff-bg-soft);
	cursor: pointer;
	transition: border-color 0.16s ease, background-color 0.16s ease, transform 0.16s ease;
}

.ff-size-thumb:hover {
	border-color: var(--ff-accent);
	background: var(--ff-accent-soft);
	transform: translateY(-1px);
}

.ff-size-thumb canvas {
	width: 32px;
	height: 32px;
}

.ff-size-thumb span {
	color: var(--ff-muted);
	font-size: 9.5px;
	letter-spacing: 0.02em;
}

.ff-gen__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.ff-gen__actions .ff-btn {
	flex: 1 1 auto;
}

.ff-snippet-box {
	padding: 12px;
	border: 1px solid var(--ff-line);
	border-radius: 12px;
	background: var(--ff-bg-soft);
}

.ff-snippet-head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	margin-bottom: 9px;
}

.ff-code {
	max-height: 186px;
	margin: 0;
	padding: 12px;
	overflow: auto;
	border-radius: 8px;
	background: #14151c;
	color: #e8eaf3;
	font-family: var(--ff-mono);
	font-size: 11.5px;
	line-height: 1.65;
	white-space: pre-wrap;
	word-break: break-word;
}

.ff-code:empty::before {
	content: "—";
	color: rgba(255, 255, 255, 0.35);
}

/* -------------------------------------------------------------------------
 * 8. Responsive and RTL
 * ---------------------------------------------------------------------- */

@media (max-width: 1024px) {
	.ff-gen {
		grid-template-columns: minmax(0, 1fr);
	}

	.ff-gen__panel {
		position: static;
		order: 2;
		max-height: none;
		overflow: visible;
	}

	.ff-gen__preview {
		order: 1;
	}
}

@media (max-width: 640px) {
	.ff-field-row {
		grid-template-columns: minmax(0, 1fr);
	}

	.ff-stage {
		min-height: 240px;
		padding: 14px;
	}

	.ff-stage canvas {
		width: min(200px, 70%);
	}

	.ff-mockups {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.ff-mockup:last-child {
		grid-column: 1 / -1;
	}

	.ff-gen__actions .ff-btn {
		flex: 1 1 100%;
	}

	.ff-shapes {
		gap: 5px;
	}

	.ff-size-thumb {
		width: 58px;
	}
}

@media (max-width: 420px) {
	.ff-gen__panel,
	.ff-gen__stage,
	.ff-gen__output {
		padding: 14px;
	}

	.ff-mockups {
		grid-template-columns: minmax(0, 1fr);
	}

	.ff-mockup:last-child {
		grid-column: auto;
	}

	.ff-tabs {
		gap: 2px;
	}

	.ff-tab {
		padding: 7px 8px;
		font-size: 12px;
	}
}

[dir="rtl"] .ff-browser__tab {
	margin-right: 6px;
	margin-left: 0;
}

[dir="rtl"] .ff-stage__badge {
	right: auto;
	left: 12px;
}

[dir="rtl"] .ff-color {
	padding: 5px 5px 5px 8px;
}

[dir="rtl"] .ff-color input[type="text"] {
	direction: ltr;
	text-align: right;
}
