/**
 * Word Counter Tool - front-end styles
 * Scoped under .wct-counter-tool so it won't clash with theme styles.
 */

.wct-counter-tool {
	max-width: 700px;
	margin: 1.5em 0;
	font-family: inherit;
}

.wct-counter-tool .wct-textarea {
	width: 100%;
	box-sizing: border-box;
	padding: 14px 16px;
	font-size: 15px;
	line-height: 1.5;
	color: #1a1a1a;
	background: #fff;
	border: 1px solid #d4d4d7;
	border-radius: 8px;
	resize: vertical;
	font-family: inherit;
	transition: border-color 0.15s ease;
}

.wct-counter-tool .wct-textarea:focus {
	outline: none;
	border-color: #6b6bf5;
	box-shadow: 0 0 0 3px rgba(107, 107, 245, 0.12);
}

.wct-counter-tool .wct-stats {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 12px;
}

.wct-counter-tool .wct-stat {
	flex: 1 1 140px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 12px 10px;
	background: #f7f7f8;
	border: 1px solid #e2e2e4;
	border-radius: 8px;
	text-align: center;
}

.wct-counter-tool .wct-stat-value {
	font-size: 22px;
	font-weight: 700;
	color: #1a1a1a;
	line-height: 1.2;
}

.wct-counter-tool .wct-stat-label {
	margin-top: 4px;
	font-size: 12.5px;
	color: #6b6b70;
}

.wct-counter-tool .wct-clear-btn {
	margin-top: 12px;
	padding: 8px 18px;
	font-size: 13.5px;
	font-weight: 600;
	color: #444;
	background: #f0f0f1;
	border: 1px solid #d4d4d7;
	border-radius: 6px;
	cursor: pointer;
	transition: background 0.15s ease;
}

.wct-counter-tool .wct-clear-btn:hover {
	background: #e4e4e6;
}

/* Info icon + tooltip */
.wct-counter-tool .wct-tooltip-wrap {
	position: relative;
	display: inline-flex;
	vertical-align: middle;
	margin-left: 4px;
}

.wct-counter-tool .wct-info-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 14px;
	height: 14px;
	border-radius: 50%;
	background: #c4c4c8;
	color: #fff;
	font-size: 10px;
	font-weight: 700;
	font-style: italic;
	font-family: Georgia, serif;
	cursor: pointer;
	line-height: 1;
	user-select: none;
}

.wct-counter-tool .wct-tooltip-text {
	position: absolute;
	bottom: 125%;
	left: 50%;
	transform: translateX(-50%) translateY(4px);
	width: 200px;
	padding: 8px 10px;
	background: #1a1a1a;
	color: #fff;
	font-size: 12px;
	font-weight: 400;
	line-height: 1.4;
	text-align: center;
	border-radius: 6px;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 0.15s ease, transform 0.15s ease;
	z-index: 10;
}

.wct-counter-tool .wct-tooltip-text::after {
	content: "";
	position: absolute;
	top: 100%;
	left: 50%;
	transform: translateX(-50%);
	border: 5px solid transparent;
	border-top-color: #1a1a1a;
}

.wct-counter-tool .wct-tooltip-wrap:hover .wct-tooltip-text,
.wct-counter-tool .wct-tooltip-wrap:focus-within .wct-tooltip-text,
.wct-counter-tool .wct-info-icon:focus .wct-tooltip-text {
	opacity: 1;
	visibility: visible;
	transform: translateX(-50%) translateY(0);
}

/* Tap-to-toggle support on touch devices */
.wct-counter-tool .wct-tooltip-wrap.wct-tooltip-active .wct-tooltip-text {
	opacity: 1;
	visibility: visible;
	transform: translateX(-50%) translateY(0);
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
	.wct-counter-tool .wct-textarea {
		background: #1e1e20;
		color: #f0f0f0;
		border-color: #3a3a3e;
	}
	.wct-counter-tool .wct-stat {
		background: #232325;
		border-color: #36363a;
	}
	.wct-counter-tool .wct-stat-value {
		color: #f0f0f0;
	}
	.wct-counter-tool .wct-stat-label {
		color: #9a9aa0;
	}
	.wct-counter-tool .wct-clear-btn {
		background: #2c2c2f;
		color: #ddd;
		border-color: #3a3a3e;
	}
	.wct-counter-tool .wct-clear-btn:hover {
		background: #383838;
	}
	.wct-counter-tool .wct-info-icon {
		background: #555;
	}
	.wct-counter-tool .wct-tooltip-text {
		background: #f0f0f0;
		color: #1a1a1a;
	}
	.wct-counter-tool .wct-tooltip-text::after {
		border-top-color: #f0f0f0;
	}
}

/* Responsive */
@media (max-width: 480px) {
	.wct-counter-tool .wct-stat {
		flex: 1 1 100%;
	}
}
