/**
 * Text Repeater Hub – Front-end styles
 *
 * @package Text_Repeater_Hub
 */

/* -------------------------------------------------------------------------
   Wrapper & container
   ------------------------------------------------------------------------- */
.trh-wrapper {
	background-color: #FFFFFF;
	box-sizing: border-box;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
	font-size: 16px;
	line-height: 1.5;
	color: #1e1e1e;
	padding: 20px;
	margin: 0 0 1.5em 0;
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	width: 100%;
	max-width: 100%;
}

.trh-container {
	display: flex;
	flex-wrap: wrap;
	gap: 0;
	align-items: stretch;
	width: 100%;
}

/* No margin between input and output */
.trh-divider {
	display: none;
}

@media (max-width: 782px) {
	.trh-container {
		gap: 0;
	}
}

/* -------------------------------------------------------------------------
   Sides (input & output)
   ------------------------------------------------------------------------- */
.trh-side {
	flex: 1 1 0;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

@media (max-width: 782px) {
	.trh-side {
		flex: 1 1 100%;
		min-width: 100%;
	}
}

/* -------------------------------------------------------------------------
   Textareas
   ------------------------------------------------------------------------- */
.trh-textarea {
	width: 100%;
	min-height: 160px;
	padding: 12px 14px;
	border: 1px solid #c3c4c7;
	border-radius: 4px;
	background: #fff;
	color: #1e1e1e;
	font-size: 15px;
	line-height: 1.5;
	resize: vertical;
	box-sizing: border-box;
	transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.trh-textarea:focus {
	border-color: #00A5FF;
	outline: 0;
	box-shadow: 0 0 0 1px #00A5FF;
}

.trh-textarea::placeholder {
	color: #757575;
}

.trh-output-text {
	background-color: #f6f7f7;
	cursor: default;
}

/* -------------------------------------------------------------------------
   Buttons
   ------------------------------------------------------------------------- */
.trh-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 10px 18px;
	border: none;
	border-radius: 4px;
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease;
	box-sizing: border-box;
}

.trh-btn-clear,
.trh-btn-select,
.trh-btn-copy {
	background-color: #f0f0f1;
	color: #1e1e1e;
}

.trh-btn-clear:hover,
.trh-btn-clear:focus,
.trh-btn-select:hover,
.trh-btn-select:focus,
.trh-btn-copy:hover,
.trh-btn-copy:focus {
	background-color: #00A5FF;
	color: #fff;
	outline: 0;
}

.trh-btn-repeat {
	background-color: #00A5FF;
	color: #fff;
}

.trh-btn-repeat:hover,
.trh-btn-repeat:focus {
	background-color: #0088d9;
	color: #fff;
	outline: 0;
}

/* -------------------------------------------------------------------------
   Stats (words / characters)
   ------------------------------------------------------------------------- */
.trh-stats {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	font-size: 13px;
	color: #50575e;
}

.trh-stats span + span::before {
	content: "|";
	margin-right: 16px;
	color: #c3c4c7;
}

/* -------------------------------------------------------------------------
   Settings (checkboxes)
   ------------------------------------------------------------------------- */
.trh-settings {
	margin: 0;
}

.trh-fieldset {
	border: 1px solid #c3c4c7;
	border-radius: 4px;
	padding: 12px 14px;
	margin: 0;
	background: #f6f7f7;
}

.trh-legend {
	padding: 0 6px;
	font-weight: 600;
	font-size: 14px;
}

.trh-check-label {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 6px 0;
	cursor: pointer;
	font-size: 14px;
}

.trh-check-label:first-of-type {
	margin-top: 0;
}

.trh-check-label:last-of-type {
	margin-bottom: 0;
}

.trh-checkbox {
	width: 18px;
	height: 18px;
	margin: 0;
	cursor: pointer;
}

.trh-custom-separator-wrapper {
	margin-top: 12px;
	padding-top: 12px;
	border-top: 1px solid #c3c4c7;
}

.trh-custom-separator-label {
	display: block;
	font-size: 14px;
	font-weight: 500;
	margin-bottom: 6px;
	color: #1e1e1e;
}

.trh-custom-separator {
	width: 100%;
	padding: 8px 10px;
	border: 1px solid #c3c4c7;
	border-radius: 4px;
	font-size: 14px;
	box-sizing: border-box;
	background: #fff;
	color: #1e1e1e;
}

.trh-custom-separator:focus {
	border-color: #00A5FF;
	outline: 0;
	box-shadow: 0 0 0 1px #00A5FF;
}

.trh-custom-separator::placeholder {
	color: #757575;
}

/* -------------------------------------------------------------------------
   Number of repetitions
   ------------------------------------------------------------------------- */
.trh-repetitions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
}

.trh-repetitions label {
	font-size: 14px;
	font-weight: 500;
}

.trh-number {
	width: 80px;
	padding: 8px 10px;
	border: 1px solid #c3c4c7;
	border-radius: 4px;
	font-size: 15px;
	box-sizing: border-box;
}

.trh-number:focus {
	border-color: #00A5FF;
	outline: 0;
	box-shadow: 0 0 0 1px #00A5FF;
}

/* -------------------------------------------------------------------------
   Input / Output actions
   ------------------------------------------------------------------------- */
.trh-input-actions,
.trh-output-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 0;
}

/* -------------------------------------------------------------------------
   Social icons
   ------------------------------------------------------------------------- */
.trh-social {
	margin-top: 4px;
}

.trh-social-label {
	display: block;
	font-size: 13px;
	font-weight: 500;
	color: #50575e;
	margin-bottom: 8px;
}

.trh-social-icons {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	align-items: center;
}

.trh-social-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	color: #fff;
	transition: transform 0.2s ease, opacity 0.2s ease;
}

.trh-social-link:hover {
	opacity: 0.9;
	transform: scale(1.05);
}

.trh-social-link:focus {
	outline: 2px solid #00A5FF;
	outline-offset: 2px;
}

.trh-whatsapp {
	background-color: #25D366;
}

.trh-sms {
	background-color: #34C759;
}

.trh-telegram {
	background-color: #0088cc;
}

.trh-messenger {
	background-color: #0084FF;
}

.trh-icon {
	width: 22px;
	height: 22px;
}

/* -------------------------------------------------------------------------
   Accessibility
   ------------------------------------------------------------------------- */
.trh-screen-reader-text {
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	width: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	word-wrap: normal !important;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
	.trh-textarea,
	.trh-btn,
	.trh-social-link {
		transition: none;
	}
}
