/* AI YouTube SEO Generator - Frontend Styles */

.ayseo-wrapper {
	--ayseo-primary: #ef4444;
	--ayseo-primary-dark: #b91c1c;
	--ayseo-bg: #ffffff;
	--ayseo-bg-soft: #f9fafb;
	--ayseo-border: #e5e7eb;
	--ayseo-text: #111827;
	--ayseo-text-muted: #6b7280;
	--ayseo-radius: 12px;
	--ayseo-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);

	box-sizing: border-box;
	max-width: 860px;
	margin: 0 auto;
	padding: 24px;
	background: var(--ayseo-bg);
	border-radius: var(--ayseo-radius);
	box-shadow: var(--ayseo-shadow);
	border: 1px solid var(--ayseo-border);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	color: var(--ayseo-text);
	line-height: 1.5;
}

.ayseo-wrapper * ,
.ayseo-wrapper *::before,
.ayseo-wrapper *::after {
	box-sizing: border-box;
}

.ayseo-header {
	text-align: center;
	margin-bottom: 24px;
}

.ayseo-title {
	font-size: 1.6rem;
	font-weight: 700;
	margin: 0 0 6px;
	color: var(--ayseo-text);
}

.ayseo-subtitle {
	font-size: 0.95rem;
	color: var(--ayseo-text-muted);
	margin: 0;
}

.ayseo-form {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
	margin-bottom: 24px;
	padding: 20px;
	background: var(--ayseo-bg-soft);
	border-radius: var(--ayseo-radius);
	border: 1px solid var(--ayseo-border);
}

.ayseo-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.ayseo-field:nth-child(2),
.ayseo-field:nth-child(3) {
	grid-column: 1 / -1;
}

.ayseo-field label {
	font-size: 0.85rem;
	font-weight: 600;
	color: var(--ayseo-text);
}

.ayseo-optional {
	font-weight: 400;
	color: var(--ayseo-text-muted);
}

.ayseo-required {
	color: var(--ayseo-primary);
}

.ayseo-field input[type="text"],
.ayseo-field textarea,
.ayseo-field select {
	width: 100%;
	padding: 10px 12px;
	font-size: 0.95rem;
	border: 1px solid var(--ayseo-border);
	border-radius: 8px;
	background: #fff;
	color: var(--ayseo-text);
	font-family: inherit;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ayseo-field input[type="text"]:focus,
.ayseo-field textarea:focus,
.ayseo-field select:focus {
	outline: none;
	border-color: var(--ayseo-primary);
	box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

.ayseo-field textarea {
	resize: vertical;
	min-height: 80px;
}

.ayseo-form-error {
	grid-column: 1 / -1;
	color: #b91c1c;
	font-size: 0.85rem;
	margin: 0;
	min-height: 0;
}

.ayseo-form-error:empty {
	display: none;
}

/* Tabs */
.ayseo-tabs {
	display: flex;
	gap: 6px;
	margin-bottom: 16px;
	border-bottom: 2px solid var(--ayseo-border);
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.ayseo-tab-btn {
	flex: 1 1 auto;
	white-space: nowrap;
	padding: 12px 14px;
	background: transparent;
	border: none;
	border-bottom: 2px solid transparent;
	margin-bottom: -2px;
	font-size: 0.9rem;
	font-weight: 600;
	color: var(--ayseo-text-muted);
	cursor: pointer;
	transition: color 0.15s ease, border-color 0.15s ease;
	min-height: 44px;
}

.ayseo-tab-btn:hover {
	color: var(--ayseo-text);
}

.ayseo-tab-btn.is-active {
	color: var(--ayseo-primary);
	border-bottom-color: var(--ayseo-primary);
}

.ayseo-tab-btn:focus-visible {
	outline: 2px solid var(--ayseo-primary);
	outline-offset: 2px;
}

/* Panels */
.ayseo-panel {
	padding: 4px 2px 8px;
}

.ayseo-panel[hidden] {
	display: none;
}

.ayseo-panel-head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 12px;
}

.ayseo-panel-head h3 {
	margin: 0 0 4px;
	font-size: 1.1rem;
}

.ayseo-panel-desc {
	margin: 0;
	font-size: 0.85rem;
	color: var(--ayseo-text-muted);
}

.ayseo-error {
	color: #b91c1c;
	font-size: 0.85rem;
	background: #fef2f2;
	border: 1px solid #fecaca;
	padding: 10px 12px;
	border-radius: 8px;
	margin: 0 0 12px;
}

.ayseo-error:empty {
	display: none;
	border: none;
	padding: 0;
	margin: 0;
}

.ayseo-results-label {
	font-size: 0.8rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--ayseo-text-muted);
	margin-bottom: 10px;
}

.ayseo-results-label[hidden] {
	display: none;
}

/* Buttons */
.ayseo-btn {
	appearance: none;
	border: none;
	border-radius: 8px;
	padding: 11px 18px;
	font-size: 0.9rem;
	font-weight: 600;
	cursor: pointer;
	min-height: 44px;
	transition: background-color 0.15s ease, opacity 0.15s ease, transform 0.05s ease;
	font-family: inherit;
}

.ayseo-btn:active {
	transform: translateY(1px);
}

.ayseo-btn:disabled {
	opacity: 0.65;
	cursor: not-allowed;
	transform: none;
}

.ayseo-btn-primary {
	background: var(--ayseo-primary);
	color: #fff;
}

.ayseo-btn-primary:hover:not(:disabled) {
	background: var(--ayseo-primary-dark);
}

.ayseo-btn-secondary {
	background: var(--ayseo-bg-soft);
	color: var(--ayseo-text);
	border: 1px solid var(--ayseo-border);
	margin-top: 14px;
}

.ayseo-btn-secondary:hover:not(:disabled) {
	background: #f3f4f6;
}

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

/* Tag / hashtag chips */
.ayseo-chip-list {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.ayseo-chip {
	display: inline-flex;
	align-items: center;
	background: var(--ayseo-bg-soft);
	border: 1px solid var(--ayseo-border);
	color: var(--ayseo-text);
	padding: 7px 12px;
	border-radius: 999px;
	font-size: 0.85rem;
	cursor: pointer;
	max-width: 100%;
	word-break: break-word;
	transition: background-color 0.15s ease, border-color 0.15s ease;
}

.ayseo-chip:hover {
	background: #f3f4f6;
	border-color: #d1d5db;
}

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

.ayseo-chip.ayseo-chip-copied {
	background: #dcfce7;
	border-color: #86efac;
	color: #166534;
}

.ayseo-hashtag-list .ayseo-chip {
	color: var(--ayseo-primary-dark);
	background: #fef2f2;
	border-color: #fecaca;
}

.ayseo-hashtag-list .ayseo-chip:hover {
	background: #fee2e2;
}

/* Title list */
.ayseo-title-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.ayseo-title-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 12px 14px;
	background: var(--ayseo-bg-soft);
	border: 1px solid var(--ayseo-border);
	border-radius: 8px;
}

.ayseo-title-text {
	font-size: 0.92rem;
	color: var(--ayseo-text);
	flex: 1 1 auto;
	word-break: break-word;
}

.ayseo-title-number {
	font-weight: 700;
	color: var(--ayseo-primary);
	margin-right: 6px;
}

.ayseo-title-copy-btn {
	flex: 0 0 auto;
	background: #fff;
	border: 1px solid var(--ayseo-border);
	color: var(--ayseo-text);
	padding: 7px 12px;
	border-radius: 6px;
	font-size: 0.8rem;
	font-weight: 600;
	cursor: pointer;
	min-height: 36px;
	min-width: 56px;
}

.ayseo-title-copy-btn:hover {
	background: var(--ayseo-bg-soft);
}

.ayseo-title-copy-btn:focus-visible {
	outline: 2px solid var(--ayseo-primary);
	outline-offset: 2px;
}

/* Loading spinner inline in buttons */
.ayseo-btn.is-loading {
	position: relative;
}

/* Responsive breakpoints */
@media (max-width: 640px) {
	.ayseo-wrapper {
		padding: 16px;
	}

	.ayseo-form {
		grid-template-columns: 1fr;
		padding: 16px;
	}

	.ayseo-field:nth-child(2),
	.ayseo-field:nth-child(3) {
		grid-column: auto;
	}

	.ayseo-title {
		font-size: 1.35rem;
	}

	.ayseo-panel-head {
		flex-direction: column;
		align-items: stretch;
	}

	.ayseo-panel-head .ayseo-btn {
		width: 100%;
	}

	.ayseo-title-item {
		flex-direction: column;
		align-items: stretch;
	}

	.ayseo-title-copy-btn {
		width: 100%;
	}

	.ayseo-tab-btn {
		flex: 1 1 33%;
		padding: 10px 8px;
		font-size: 0.8rem;
	}
}

@media (max-width: 400px) {
	.ayseo-wrapper {
		padding: 12px;
		border-radius: 8px;
	}
}
