/**
 * Keyword Density Checker - Input Section
 *
 * Content textarea, keyword input, content type selector,
 * analyze button, and supporting UI elements.
 *
 * @package AgenticWP
 */

/* ============================================
   Input Section
   ============================================ */

.keyword-density-input-section {
	position: relative;
	padding: 0 0 48px;
	margin-top: -24px;
}

.keyword-density-input-card {
	position: relative;
	z-index: 1;
	background: linear-gradient(
		135deg,
		rgba(255, 255, 255, 0.9),
		rgba(255, 255, 255, 0.7)
	);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	border-radius: 20px;
	border: 1px solid rgba(255, 255, 255, 0.8);
	box-shadow:
		0 8px 32px rgba(0, 0, 0, 0.08),
		0 2px 8px rgba(0, 0, 0, 0.04);
	padding: 2rem;
	max-width: 800px;
	margin: 0 auto;
}

/* ============================================
   Labels & Hints
   ============================================ */

.input-label {
	display: block;
	font-size: 0.9375rem;
	font-weight: 600;
	color: var(--ink);
	margin-bottom: 0.5rem;
}

.input-hint {
	display: block;
	font-size: 0.8125rem;
	color: var(--muted);
	margin-top: 0.375rem;
}

/* ============================================
   Content Textarea
   ============================================ */

.input-area {
	margin-bottom: 1.5rem;
}

.content-textarea {
	width: 100%;
	min-height: 180px;
	padding: 1rem;
	font-family: inherit;
	font-size: 1rem;
	line-height: 1.6;
	color: var(--ink);
	background: rgba(255, 255, 255, 0.8);
	border: 2px solid var(--line);
	border-radius: 12px;
	resize: vertical;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.content-textarea::placeholder {
	color: var(--muted);
	font-weight: 400;
}

.content-textarea:hover {
	border-color: #d1d5db;
}

.content-textarea:focus {
	outline: none;
	border-color: var(--kd-accent);
	box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.15);
}

/* ============================================
   Input Meta (Word & Character Count)
   ============================================ */

.input-meta {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-top: 0.75rem;
	gap: 1rem;
	flex-wrap: wrap;
}

.word-count,
.char-count {
	font-size: 0.875rem;
	color: var(--muted);
	font-variant-numeric: tabular-nums;
}

.word-current,
.char-current {
	font-weight: 600;
	color: var(--ink);
}

/* ============================================
   Keyword Input
   ============================================ */

.keyword-input-area {
	margin-bottom: 1.5rem;
}

.keyword-input-wrapper {
	position: relative;
	display: flex;
	align-items: center;
}

.keyword-input-icon {
	position: absolute;
	left: 1rem;
	color: var(--muted);
	pointer-events: none;
}

.keyword-input {
	width: 100%;
	padding: 0.875rem 1rem 0.875rem 2.75rem;
	font-family: inherit;
	font-size: 1rem;
	font-weight: 500;
	color: var(--ink);
	background: rgba(255, 255, 255, 0.8);
	border: 2px solid var(--line);
	border-radius: 12px;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.keyword-input::placeholder {
	color: var(--muted);
	font-weight: 400;
}

.keyword-input:hover {
	border-color: #d1d5db;
}

.keyword-input:focus {
	outline: none;
	border-color: var(--kd-accent);
	box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.15);
}

/* ============================================
   Content Type Selector
   ============================================ */

.content-type-selector {
	display: flex;
	align-items: center;
	gap: 1rem;
	margin-bottom: 1.5rem;
	flex-wrap: wrap;
}

.selector-label {
	font-size: 0.875rem;
	font-weight: 500;
	color: var(--ink);
}

.content-type-buttons {
	display: flex;
	gap: 0.5rem;
	flex-wrap: wrap;
}

.kd-content-type-btn {
	display: inline-flex;
	align-items: center;
	gap: 0.375rem;
	padding: 0.5rem 1rem;
	font-size: 0.875rem;
	font-weight: 500;
	color: var(--muted);
	background: rgba(255, 255, 255, 0.6);
	border: 1px solid var(--line);
	border-radius: 8px;
	cursor: pointer;
	transition: all 0.2s ease;
}

.kd-content-type-btn svg {
	flex-shrink: 0;
	opacity: 0.7;
}

.kd-content-type-btn:hover {
	color: var(--ink);
	background: rgba(255, 255, 255, 0.9);
	border-color: #d1d5db;
}

.kd-content-type-btn:focus {
	outline: none;
	box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.2);
}

.kd-content-type-btn--active {
	color: var(--kd-accent-dark);
	background: linear-gradient(135deg, rgba(249, 115, 22, 0.12), rgba(234, 88, 12, 0.08));
	border-color: var(--kd-accent);
}

.kd-content-type-btn--active svg {
	opacity: 1;
}

/* ============================================
   Analyze & Clear Buttons
   ============================================ */

.input-actions {
	display: flex;
	justify-content: center;
	gap: 0.75rem;
}

.analyze-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	padding: 0.875rem 2rem;
	font-size: 1rem;
	font-weight: 600;
	color: #fff;
	background: var(--kd-gradient);
	border: none;
	border-radius: 10px;
	cursor: pointer;
	transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
	min-width: 180px;
}

.analyze-btn:hover:not(:disabled) {
	transform: translateY(-2px);
	box-shadow: 0 8px 24px rgba(249, 115, 22, 0.3);
}

.analyze-btn:focus {
	outline: none;
	box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.3);
}

.analyze-btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.analyze-btn .btn-loading {
	display: none;
	align-items: center;
	gap: 0.5rem;
}

.analyze-btn.loading .btn-text {
	display: none;
}

.analyze-btn.loading .btn-loading {
	display: inline-flex;
}

.analyze-btn .spinner {
	animation: spin 1s linear infinite;
}

.clear-btn {
	padding: 0.875rem 1.5rem;
	font-size: 1rem;
	font-weight: 500;
	color: var(--muted);
	background: rgba(255, 255, 255, 0.6);
	border: 1px solid var(--line);
	border-radius: 10px;
	cursor: pointer;
	transition: all 0.2s ease;
}

.clear-btn:hover {
	color: var(--ink);
	background: rgba(255, 255, 255, 0.9);
	border-color: #d1d5db;
}

.clear-btn:focus {
	outline: none;
	box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.2);
}

/* ============================================
   Error & Fallback States
   ============================================ */

.input-error {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin-top: 1rem;
	padding: 0.75rem 1rem;
	font-size: 0.9375rem;
	color: var(--tool-error, #EF4444);
	background: var(--tool-error-bg, #FEE2E2);
	border-radius: 8px;
}

.input-error[hidden] {
	display: none;
}

.input-error svg {
	flex-shrink: 0;
}

.no-js-message {
	margin-top: 1.5rem;
	padding: 1rem;
	text-align: center;
	color: var(--muted);
	background: var(--tool-bg-subtle, #f9fafb);
	border-radius: 8px;
}

.no-js-message p {
	margin: 0;
}

.js .no-js-message {
	display: none;
}
