/**
 * Word Count Tool - Goal Section
 *
 * Word count goal input, progress bar, and status display.
 *
 * @package AgenticWP
 */

/* ============================================
   Goal Section
   ============================================ */

.goal-section {
	background: #fff;
	border-radius: 16px;
	border: 1px solid var(--tool-border);
	padding: 1.5rem;
	box-shadow: var(--tool-shadow-sm);
}

.goal-title {
	font-size: 1.125rem;
	font-weight: 600;
	color: var(--ink);
	margin: 0 0 1.25rem;
}

/* ============================================
   Goal Card
   ============================================ */

.goal-card {
	background: var(--tool-bg-subtle);
	border-radius: 12px;
	padding: 1.25rem;
}

/* ============================================
   Goal Input
   ============================================ */

.goal-input-wrapper {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	flex-wrap: wrap;
}

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

.goal-input {
	width: 120px;
	padding: 0.5rem 0.75rem;
	font-size: 1rem;
	font-weight: 600;
	color: var(--ink);
	background: #fff;
	border: 2px solid var(--tool-border);
	border-radius: 8px;
	text-align: center;
	font-variant-numeric: tabular-nums;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

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

.goal-input:hover {
	border-color: var(--tool-border-strong);
}

.goal-input:focus {
	outline: none;
	border-color: var(--word-count-accent);
	box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.15);
}

/* Remove number input spinners */
.goal-input::-webkit-outer-spin-button,
.goal-input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.goal-input[type="number"] {
	-moz-appearance: textfield;
}

/* Goal buttons */
.goal-set-btn {
	padding: 0.5rem 1rem;
	font-size: 0.875rem;
	font-weight: 600;
	color: #fff;
	background: var(--gradient-teal);
	border: none;
	border-radius: 8px;
	cursor: pointer;
	transition: all 0.2s ease;
}

.goal-set-btn:hover {
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(20, 184, 166, 0.3);
}

.goal-set-btn:focus {
	outline: none;
	box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.3);
}

.goal-clear-btn {
	padding: 0.5rem 0.75rem;
	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;
}

.goal-clear-btn:hover {
	color: var(--tool-error);
	background: var(--tool-error-bg);
	border-color: var(--tool-error);
}

.goal-clear-btn:focus {
	outline: none;
	box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.2);
}

.goal-clear-btn[hidden] {
	display: none;
}

.goal-hint {
	font-size: 0.8125rem;
	color: var(--muted);
	margin: 0.75rem 0 0;
}

/* ============================================
   Goal Progress
   ============================================ */

.goal-progress {
	margin-top: 1.25rem;
	padding-top: 1.25rem;
	border-top: 1px solid var(--tool-border);
}

.goal-progress[hidden] {
	display: none;
}

.goal-progress-header {
	display: flex;
	align-items: baseline;
	gap: 0.25rem;
	margin-bottom: 0.75rem;
}

.goal-current {
	font-size: 1.5rem;
	font-weight: 700;
	color: var(--ink);
	font-variant-numeric: tabular-nums;
}

.goal-separator {
	font-size: 1rem;
	color: var(--muted);
	margin: 0 0.125rem;
}

.goal-target {
	font-size: 1rem;
	font-weight: 600;
	color: var(--muted);
	font-variant-numeric: tabular-nums;
}

.goal-unit {
	font-size: 0.875rem;
	color: var(--muted);
	margin-left: 0.25rem;
}

/* ============================================
   Progress Bar
   ============================================ */

.goal-progress-bar {
	height: 12px;
	background: var(--goal-incomplete, var(--tool-border));
	border-radius: 6px;
	overflow: hidden;
	margin-bottom: 0.75rem;
}

.goal-progress-fill {
	height: 100%;
	background: var(--gradient-teal);
	border-radius: 6px;
	transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
	min-width: 0;
}

/* ============================================
   Goal Remaining
   ============================================ */

.goal-remaining {
	display: block;
	font-size: 0.875rem;
	font-weight: 500;
	color: var(--muted);
}

/* State-based text colors */
.goal-progress[data-state="complete"] .goal-remaining {
	color: var(--tool-success);
}

.goal-progress[data-state="exceeded"] .goal-remaining {
	color: var(--goal-exceeded, #3b82f6);
}

/* ============================================
   Goal Celebration (when goal is met)
   ============================================ */

.goal-progress[data-state="complete"] .goal-current,
.goal-progress[data-state="exceeded"] .goal-current {
	color: var(--tool-success);
}

.goal-progress[data-state="exceeded"] .goal-current {
	color: var(--goal-exceeded, #3b82f6);
}
