/* YT Tag Generator - frontend styles. All rules scoped under .ytg-container
   so they never leak into (or clash with) the active theme. */

.ytg-container {
	--ytg-primary: #2563eb;
	--ytg-primary-hover: #1d4ed8;
	--ytg-primary-active: #1e40af;
	--ytg-secondary: #f3f4f6;
	--ytg-secondary-hover: #e5e7eb;
	--ytg-border: #d1d5db;
	--ytg-text: #111827;
	--ytg-muted: #6b7280;
	--ytg-error-bg: #fef2f2;
	--ytg-error-text: #b91c1c;
	--ytg-success: #059669;
	--ytg-radius: 10px;

	box-sizing: border-box;
	max-width: 560px;
	width: 100%;
	margin: 0 auto;
	padding: 24px;
	background: #ffffff;
	border: 1px solid var(--ytg-border);
	border-radius: var(--ytg-radius);
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 4px 12px rgba(0, 0, 0, 0.04);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.ytg-container *,
.ytg-container *::before,
.ytg-container *::after {
	box-sizing: border-box;
}

.ytg-field {
	margin-bottom: 16px;
}

.ytg-label {
	display: block;
	margin-bottom: 6px;
	font-size: 14px;
	font-weight: 600;
	color: var(--ytg-text);
}

.ytg-input {
	width: 100%;
	padding: 12px 14px;
	font-size: 15px;
	line-height: 1.4;
	color: var(--ytg-text);
	background: #fff;
	border: 1px solid var(--ytg-border);
	border-radius: var(--ytg-radius);
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ytg-input:focus {
	outline: none;
	border-color: var(--ytg-primary);
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.ytg-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	padding: 12px 18px;
	font-size: 15px;
	font-weight: 600;
	border: none;
	border-radius: var(--ytg-radius);
	cursor: pointer;
	transition: background-color 0.15s ease, transform 0.05s ease, opacity 0.15s ease;
}

.ytg-button:focus-visible {
	outline: 2px solid var(--ytg-primary);
	outline-offset: 2px;
}

.ytg-button-primary {
	background: var(--ytg-primary);
	color: #ffffff;
}

.ytg-button-primary:hover:not(:disabled) {
	background: var(--ytg-primary-hover);
}

.ytg-button-primary:active:not(:disabled) {
	background: var(--ytg-primary-active);
	transform: translateY(1px);
}

.ytg-button-primary:disabled {
	opacity: 0.7;
	cursor: not-allowed;
}

.ytg-button-secondary {
	margin-top: 12px;
	background: var(--ytg-secondary);
	color: var(--ytg-text);
}

.ytg-button-secondary:hover {
	background: var(--ytg-secondary-hover);
}

.ytg-button-secondary:active {
	transform: translateY(1px);
}

.ytg-button-secondary.ytg-copied {
	background: var(--ytg-success);
	color: #ffffff;
}

.ytg-spinner {
	display: none;
	width: 16px;
	height: 16px;
	border: 2px solid rgba(255, 255, 255, 0.5);
	border-top-color: #ffffff;
	border-radius: 50%;
	animation: ytg-spin 0.7s linear infinite;
}

.ytg-container.ytg-loading .ytg-spinner {
	display: inline-block;
}

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

.ytg-error {
	margin: 12px 0 0;
	padding: 10px 12px;
	font-size: 13.5px;
	color: var(--ytg-error-text);
	background: var(--ytg-error-bg);
	border: 1px solid #fecaca;
	border-radius: var(--ytg-radius);
}

.ytg-result {
	margin-top: 20px;
	padding-top: 20px;
	border-top: 1px solid var(--ytg-border);
}

.ytg-output {
	width: 100%;
	min-height: 110px;
	padding: 12px 14px;
	font-size: 14px;
	line-height: 1.5;
	color: var(--ytg-text);
	background: #f9fafb;
	border: 1px solid var(--ytg-border);
	border-radius: var(--ytg-radius);
	resize: vertical;
}

.ytg-output:focus {
	outline: none;
	border-color: var(--ytg-primary);
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* Mobile: comfortable down to 320px wide. */
@media (max-width: 400px) {
	.ytg-container {
		padding: 16px;
		border-radius: 8px;
	}

	.ytg-input,
	.ytg-button {
		font-size: 16px; /* Avoids iOS auto-zoom on focus. */
	}
}
