/**
 * TranslateQuick frontend styles.
 * License: GPL-2.0-or-later
 *
 * @package TranslateQuick
 */

.tq-language-switcher {
	background: var(--tq-switcher-bg, #ffffff);
	border: 1px solid var(--tq-switcher-border, #cbd5e1);
	border-radius: 18px;
	color: var(--tq-switcher-text, #0f172a);
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
	padding: 10px;
}

.tq-language-switcher__picker-label {
	color: var(--tq-switcher-muted, #64748b);
	display: block;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.08em;
	margin-right: 8px;
	text-transform: uppercase;
}

.tq-language-switcher__link {
	align-items: center;
	background: var(--tq-switcher-chip-bg, transparent);
	border: 1px solid var(--tq-switcher-border, #d0d5dd);
	border-radius: 999px;
	color: var(--tq-switcher-text, #344054);
	display: inline-flex;
	gap: 8px;
	padding: 6px 12px;
	text-decoration: none;
}

.tq-language-switcher__flag {
	display: inline-flex;
	font-size: 15px;
	line-height: 1;
}

.tq-language-switcher__text {
	line-height: 1.2;
}

.tq-language-switcher__select {
	background: var(--tq-switcher-select-bg, var(--tq-switcher-bg, #ffffff));
	border: 1px solid var(--tq-switcher-border, #d0d5dd);
	border-radius: 12px;
	color: var(--tq-switcher-text, #0f172a);
	font: inherit;
	min-width: 180px;
	padding: 8px 12px;
}

.tq-language-switcher__link--active {
	background: var(--tq-switcher-active-bg, #111827);
	border-color: var(--tq-switcher-active-border, #111827);
	color: var(--tq-switcher-active-text, #fff);
}

.tq-language-switcher--minimal .tq-language-switcher__link {
	border: 0;
	border-bottom: 2px solid transparent;
	border-radius: 0;
	padding-left: 0;
	padding-right: 0;
}

.tq-language-switcher--minimal .tq-language-switcher__link--active {
	background: transparent;
	border-bottom-color: var(--tq-switcher-text, #111827);
	color: var(--tq-switcher-text, #111827);
}

.tq-language-switcher--tabs {
	background: var(--tq-switcher-bg, #eef2f7);
	border-radius: 16px;
	padding: 6px;
}

.tq-language-switcher--tabs .tq-language-switcher__link {
	border: 0;
	border-radius: 12px;
	padding: 9px 14px;
}

.tq-language-switcher--tabs .tq-language-switcher__link--active {
	background: var(--tq-switcher-active-bg, #fff);
	box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
	color: var(--tq-switcher-active-text, #0f172a);
}

.tq-language-switcher--glass {
	background: color-mix(in srgb, var(--tq-switcher-bg, #ffffff) 88%, transparent);
	backdrop-filter: blur(14px);
	border: 1px solid var(--tq-switcher-border, rgba(255, 255, 255, 0.24));
	border-radius: 18px;
	padding: 10px;
}

.tq-language-switcher--glass .tq-language-switcher__picker-label {
	color: inherit;
	opacity: 0.75;
}

.tq-language-switcher--glass .tq-language-switcher__link {
	background: color-mix(in srgb, var(--tq-switcher-chip-bg, #ffffff) 82%, transparent);
	border-color: var(--tq-switcher-border, rgba(255, 255, 255, 0.2));
}

.tq-language-switcher--glass.tq-language-switcher--light {
	background: color-mix(in srgb, var(--tq-switcher-bg, #ffffff) 92%, white);
	border-color: var(--tq-switcher-border, rgba(203, 213, 225, 0.8));
}

.tq-language-switcher--glass.tq-language-switcher--light .tq-language-switcher__link {
	color: var(--tq-switcher-text, #0f172a);
}

.tq-language-switcher--glass.tq-language-switcher--dark,
.tq-language-switcher--glass.tq-language-switcher--brand {
	color: var(--tq-switcher-text, #fff);
}

.tq-language-switcher--dropdown {
	display: inline-flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 8px;
}

.tq-language-switcher--dark .tq-language-switcher__picker-label {
	color: var(--tq-switcher-muted, #94a3b8);
}

.tq-language-switcher--dark .tq-language-switcher__select {
	border-color: var(--tq-switcher-border, #334155);
	color: var(--tq-switcher-text, #fff);
}

.tq-language-switcher--brand .tq-language-switcher__picker-label {
	color: var(--tq-switcher-muted, rgba(255,255,255,0.76));
}

.tq-language-switcher--brand .tq-language-switcher__select {
	box-shadow: 0 8px 20px rgba(37, 99, 235, 0.08);
	color: var(--tq-switcher-text, #fff);
}

.tq-language-switcher-auto {
	position: fixed;
	z-index: 99990;
}

.tq-language-switcher-auto--bottom-right {
	bottom: 24px;
	right: 24px;
}

.tq-language-switcher-auto--bottom-left {
	bottom: 24px;
	left: 24px;
}

.tq-language-switcher-auto--top-right {
	right: 24px;
	top: 56px;
}

.tq-language-switcher-auto--top-left {
	left: 24px;
	top: 56px;
}

.tq-editor-outline {
	outline: none !important;
}

.tq-editor-shell {
	--tq-editor-panel-width: min(340px, calc(100vw - 24px));
	inset: 0;
	pointer-events: none;
	position: fixed;
	z-index: 999999;
}

.tq-editor-shell__panel {
	background: linear-gradient(180deg, #f9fbff 0%, #ffffff 100%);
	border-left: 1px solid rgba(15, 23, 42, 0.12);
	box-shadow: -22px 0 60px rgba(15, 23, 42, 0.12);
	color: #0f172a;
	display: flex;
	flex-direction: column;
	gap: 14px;
	height: 100vh;
	left: auto;
	max-width: 340px;
	padding: 18px 18px 28px;
	position: absolute;
	pointer-events: auto;
	right: 0;
	top: 0;
	width: var(--tq-editor-panel-width);
	z-index: 2;
}

.tq-editor-shell__topbar {
	align-items: center;
	display: flex;
	justify-content: space-between;
	gap: 12px;
}

.tq-editor-shell__eyebrow {
	color: #667085;
	display: block;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.12em;
	margin-bottom: 4px;
	text-transform: uppercase;
}

.tq-editor-shell__title {
	font-size: 26px;
	line-height: 1.1;
}

.tq-editor-shell__build {
	color: #667085;
	display: block;
	font-size: 11px;
	font-weight: 600;
	margin-top: 4px;
}

.tq-editor-shell__header {
	background: linear-gradient(135deg, #0f172a 0%, #1d4ed8 100%);
	border-radius: 18px;
	color: #fff;
	padding: 18px;
}

.tq-editor-shell__badge {
	background: rgba(255, 255, 255, 0.14);
	border: 1px solid rgba(255, 255, 255, 0.18);
	border-radius: 999px;
	display: inline-block;
	font-size: 12px;
	font-weight: 700;
	margin-bottom: 10px;
	padding: 6px 10px;
}

.tq-editor-shell__exit {
	color: #344054;
	font-size: 12px;
	font-weight: 600;
	text-decoration: none;
}

.tq-editor-shell__hint,
.tq-editor-shell__status {
	color: inherit;
	font-size: 13px;
	margin: 0;
}

.tq-editor-shell__lang-grid {
	display: grid;
	gap: 12px;
	grid-template-columns: 1fr 1fr;
}

.tq-editor-shell__label {
	color: #344054;
	font-size: 12px;
	font-weight: 600;
}

.tq-editor-shell__input,
.tq-editor-shell__textarea,
.tq-editor-shell__select {
	border: 1px solid #d0d5dd;
	border-radius: 10px;
	box-sizing: border-box;
	font: inherit;
	padding: 10px 12px;
	width: 100%;
}

.tq-editor-shell__input--mono {
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 12px;
}

.tq-editor-shell__textarea {
	resize: vertical;
}

.tq-editor-shell__textarea--muted,
.tq-editor-shell__input[readonly] {
	background: #f8fafc;
}

.tq-editor-shell__selector-tools {
	display: flex;
	gap: 10px;
}

.tq-editor-shell__selected {
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 14px;
	padding: 12px;
}

.tq-editor-shell__selected-label,
.tq-editor-shell__meta {
	color: #667085;
	font-size: 12px;
	margin: 0;
}

.tq-editor-shell__selected-name {
	display: block;
	font-size: 15px;
	margin: 4px 0 10px;
}

.tq-editor-shell__actions {
	display: flex;
	gap: 10px;
}

.tq-editor-shell__footer {
	border-top: 1px solid #eaecf0;
	margin-top: auto;
	padding-top: 14px;
}

.tq-editor-highlight {
	background: rgba(37, 99, 235, 0.08);
	border: 2px solid #2563eb;
	border-radius: 10px;
	box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.9) inset;
	display: none;
	pointer-events: none;
	position: fixed;
	z-index: 1;
}

.tq-editor-float-action {
	background: #2563eb;
	border: 0;
	border-radius: 999px;
	box-shadow: 0 14px 30px rgba(37, 99, 235, 0.28);
	color: #fff;
	cursor: pointer;
	display: none;
	font: inherit;
	font-size: 13px;
	font-weight: 700;
	line-height: 1;
	min-height: 42px;
	min-width: 154px;
	opacity: 0;
	padding: 10px 14px;
	position: fixed;
	pointer-events: auto;
	transform: translateY(-100%);
	transition: opacity 120ms ease;
	visibility: hidden;
	z-index: 9999999;
}

.tq-editor-overlay {
	bottom: 0;
	cursor: crosshair;
	left: 0;
	pointer-events: none;
	position: fixed;
	right: var(--tq-editor-panel-width);
	top: 0;
	z-index: 1;
}

html.tq-editor-layout-active,
body.tq-editor-layout-active {
	padding-right: min(340px, calc(100vw - 24px));
	transition: padding-right 180ms ease;
}

body.tq-editor-active {
	cursor: crosshair;
	-webkit-user-select: none;
	user-select: none;
}

body.tq-editor-active * {
	cursor: crosshair !important;
}

body.tq-editor-active > *:not(#wpadminbar):not(#translatequick-editor-shell):not(#tq-editor-highlight):not(#tq-editor-float-action),
body.tq-editor-active > *:not(#wpadminbar):not(#translatequick-editor-shell):not(#tq-editor-highlight):not(#tq-editor-float-action) * {
	-webkit-user-select: none !important;
	user-select: none !important;
}

#translatequick-editor-shell,
#translatequick-editor-shell *,
#wpadminbar,
#wpadminbar * {
	-webkit-user-select: text;
	user-select: text;
}

@media (max-width: 782px) {
	.tq-editor-shell {
		inset: auto 0 0 0;
	}

	html.tq-editor-layout-active,
	body.tq-editor-layout-active {
		padding-right: 0;
		padding-bottom: 78vh;
	}

	.tq-editor-overlay {
		bottom: 78vh;
		left: 0;
		right: 0;
	}

	.tq-editor-float-action {
		max-width: calc(100vw - 24px);
	}

	.tq-editor-shell__panel {
		border-radius: 18px 18px 0 0;
		border-left: 0;
		height: auto;
		max-height: 78vh;
		max-width: none;
		position: fixed;
		right: 0;
		top: auto;
		width: 100%;
	}

	.tq-editor-shell__lang-grid {
		grid-template-columns: 1fr;
	}
}
