/*
 * HTML Cleaner & Markup Sanitizer — module-scoped styling.
 *
 * Brand-focused redesign with:
 * - Brand color #026ed0 for primary actions and accents
 * - Alternating section backgrounds (white + ultra-light blue tint)
 * - Subtle borders instead of heavy shadows
 * - Left accent bars for key areas
 * - Reduced whitespace, increased density
 * - Clean, professional, lightweight aesthetic
 */

:root {
	--hc-brand: #026ed0;
	--hc-brand-light: rgba(2, 110, 208, 0.04);
	--hc-brand-border: rgba(2, 110, 208, 0.15);
	--hc-brand-hover: #0252a3;
	--hc-bg-white: #ffffff;
	--hc-border: #e5e7eb;
	--hc-text-primary: #111827;
	--hc-text-secondary: #4b5563;
	--hc-text-muted: #6b7280;
}

.lct-shortcode-tool {
	width: 100% !important;
	display: block !important;
}

.lct-hc-root {
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	color: var(--hc-text-primary);
	box-sizing: border-box;
	width: 100%;
	display: block;
}
.lct-hc-root *,
.lct-hc-root *::before,
.lct-hc-root *::after { box-sizing: border-box; }

/* Prevent layout shift when scrollbar appears */
.lct-hc-form {
	scrollbar-gutter: stable;
	width: 100%;
	display: block;
}

/* Header */
.lct-hc-header {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 16px;
	flex-wrap: wrap;
	margin-bottom: 16px;
}

/* Input Section — full-width */
.lct-hc-input-section {
	margin-bottom: 24px;
}

.lct-hc-input-section .lct-hc-card {
	box-shadow: 5px 3px 10px rgba(0, 0, 0, 0.05);
	border: 1px solid #d1d6dc;
}

/* Options Section */
.lct-hc-options-section {
	margin-bottom: 24px;
	width: 100%;
}

/* Options Grid — 3-column responsive layout */
.lct-hc-options-grid {
	display: grid !important;
	grid-template-columns: repeat(3, 1fr) !important;
	gap: 16px !important;
	margin-top: 16px !important;
	width: 100% !important;
	grid-auto-flow: row !important;
	grid-auto-rows: 1fr !important;
}

.lct-hc-options-grid > * {
	display: flex !important;
	flex-direction: column !important;
	width: auto !important;
}

@media (max-width: 1199px) {
	.lct-hc-options-grid {
		grid-template-columns: repeat(2, 1fr) !important;
	}
}

@media (max-width: 640px) {
	.lct-hc-options-grid {
		grid-template-columns: 1fr !important;
	}
}

/* Cards */
.lct-hc-card {
	background: var(--hc-bg-white);
	border: none;
	border-radius: 0;
	padding: 1.5rem;
	box-shadow: none;
}

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

.lct-shortcode-tool .lct-hc-card-head h3 {
	margin: 0;
	font-size: 2rem;
	font-weight: 400;
	line-height: 1.2;
}

/* Field styling */
.lct-hc-field-label {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: .85rem;
	font-weight: 600;
	margin-bottom: 4px;
	color: var(--hc-text-primary);
}

.lct-hc-input {
	width: 100%;
	padding: 12px 14px;
	border: 1px solid var(--hc-border);
	border-radius: 0;
	font-size: .9rem;
	font-family: inherit;
	background: var(--hc-bg-white);
	color: var(--hc-text-primary);
	transition: border-color .15s, box-shadow .15s;
	min-height: 120px;
	resize: vertical;
	line-height: 1.5;
}
.lct-hc-input:focus {
	outline: none;
	border-color: var(--hc-brand);
	box-shadow: 0 0 0 3px rgba(2, 110, 208, 0.1), inset 0 0 0 1px var(--hc-brand);
}
.lct-hc-input::placeholder {
	color: var(--hc-text-muted);
}

.lct-hc-text {
	width: 100%;
	padding: 8px 10px;
	border: 1px solid var(--hc-border);
	border-radius: 3px;
	font-size: 0.9rem;
	font-family: inherit;
	background: var(--hc-bg-white);
	color: var(--hc-text-primary);
	transition: border-color .15s, box-shadow .15s;
}
.lct-hc-text:focus {
	outline: none;
	border-color: var(--hc-brand);
	box-shadow: 0 0 0 3px rgba(2, 110, 208, 0.1), inset 0 0 0 1px var(--hc-brand);
}
.lct-hc-text::placeholder {
	color: var(--hc-text-muted);
}

/* File upload dropzone */
.lct-hc-input-labelrow {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 12px;
}

.lct-hc-or {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 16px 0;
	color: var(--hc-text-muted);
	font-size: 0.85rem;
}

.lct-hc-or::before,
.lct-hc-or::after {
	content: '';
	flex: 1;
	height: 1px;
	background: var(--hc-border);
}

.lct-dropzone {
	position: relative;
	border: 2px dashed var(--hc-border);
	border-radius: 4px;
	padding: 24px 16px;
	text-align: center;
	cursor: pointer;
	transition: all .15s;
	background: rgba(2, 110, 208, 0.02);
}

.lct-dropzone:hover {
	border-color: var(--hc-brand);
	background: rgba(2, 110, 208, 0.06);
}

.lct-dropzone.drag-active {
	border-color: var(--hc-brand);
	background: rgba(2, 110, 208, 0.1);
}

.lct-dropzone input[type="file"] {
	display: none;
}

.lct-dropzone-icon {
	display: block;
	font-size: 32px;
	margin-bottom: 12px;
	line-height: 1;
}

.lct-dropzone-prompt {
	display: block;
	font-size: 0.95rem;
	font-weight: 500;
	color: var(--hc-text-primary);
	margin-bottom: 4px;
}

.lct-dropzone-sub {
	display: block;
	font-size: 0.8rem;
	color: var(--hc-text-muted);
	line-height: 1.4;
}

.lct-dropzone-status {
	display: block;
	margin-top: 8px;
	font-size: 0.8rem;
	color: var(--hc-text-secondary);
}

/* Tour header actions */
.lct-tour-header-actions {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
}

.lct-tour-header-actions .lct-tour-launch,
.lct-tour-header-actions .lct-product-header-docs {
	margin: 0;
	display: flex;
	align-items: center;
}

.lct-tour-header-actions .lct-product-header-docs a {
	margin: 0;
}

.lct-header-captcha-wrap {
	display: flex;
	align-items: center;
}

.lct-header-captcha-wrap .cf-turnstile {
	height: 65px;
	transform: scale(0.75);
	transform-origin: left center;
}

/* Option Sections */
.lct-hc-option-section {
	border: 1px solid var(--hc-border);
	border-radius: 4px;
	padding: 12px;
	background: var(--hc-bg-white);
	height: 100%;
	display: flex !important;
	flex-direction: column;
	width: auto !important;
	margin-top: 0 !important;
}

.lct-hc-option-section-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 12px;
	padding-bottom: 8px;
	border-bottom: 1px solid var(--hc-border);
}

.lct-shortcode-tool .lct-hc-option-section-head h3,
.lct-shortcode-tool .lct-hc-card-head h3 {
	margin: 0 !important;
	font-size: 1.15rem !important;
	font-weight: 400 !important;
	color: var(--hc-text-primary) !important;
}

/* Option Pip */
.lct-hc-option-pip {
	display: inline-block;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--hc-border);
	flex-shrink: 0;
	transition: background-color .15s ease;
}

.lct-hc-option-section.has-selection .lct-hc-option-pip {
	background: var(--hc-brand);
}

/* Radio Button Styling */
.lct-hc-radio-group {
	border: none;
	padding: 0;
	margin: 0;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.lct-hc-radio {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 0.9rem;
	cursor: pointer;
	padding: 6px 8px;
	border-radius: 3px;
	transition: background-color .15s;
	user-select: none;
}

.lct-hc-radio:hover {
	background-color: var(--hc-brand-light);
}

.lct-hc-radio input[type="radio"] {
	cursor: pointer;
	margin: 0;
	width: 18px;
	height: 18px;
	min-width: 18px;
	flex-shrink: 0;
	accent-color: var(--hc-brand);
}

.lct-hc-radio span {
	flex: 1;
	color: var(--hc-text-primary);
}

/* Checkbox Group Styling */
.lct-hc-checkbox-group {
	border: none;
	padding: 0;
	margin: 0;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.lct-hc-checkbox {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 0.9rem;
	cursor: pointer;
	padding: 6px 8px;
	border-radius: 3px;
	transition: background-color .15s;
	user-select: none;
}

.lct-hc-checkbox:hover {
	background-color: var(--hc-brand-light);
}

.lct-hc-checkbox input[type="checkbox"] {
	cursor: pointer;
	margin: 0;
	width: 18px;
	height: 18px;
	min-width: 18px;
	flex-shrink: 0;
	accent-color: var(--hc-brand);
}

.lct-hc-checkbox span {
	flex: 1;
	color: var(--hc-text-primary);
}

/* Field help text */
.lct-hc-field-help {
	font-size: 0.75rem;
	color: var(--hc-text-muted);
	line-height: 1.4;
	margin: 4px 0 0 0;
}

/* Byte counter and domain row */
.lct-hc-byte-counter {
	font-size: 0.85rem;
	color: var(--hc-text-secondary);
	font-weight: 500;
}

.lct-hc-domain-row {
	padding-top: 12px;
	margin-top: 12px;
	border-top: 1px solid var(--hc-border);
}

.lct-hc-domain-row .lct-hc-text {
	margin: 8px 0 0 0;
}

/* Link button styling */
.lct-hc-link {
	display: inline;
	background: none;
	border: none;
	padding: 0;
	color: var(--hc-brand);
	font-size: 0.85rem;
	font-weight: 500;
	cursor: pointer;
	text-decoration: none;
	transition: color .15s;
}

.lct-hc-link:hover {
	color: var(--hc-brand-hover);
	text-decoration: underline;
}

/* Select styling */
.lct-hc-select {
	width: 100%;
	padding: 8px 10px;
	border: 1px solid var(--hc-border);
	border-radius: 3px;
	font-size: 0.9rem;
	background: var(--hc-bg-white);
	color: var(--hc-text-primary);
	cursor: pointer;
	transition: border-color .15s;
}

.lct-hc-select:focus {
	outline: none;
	border-color: var(--hc-brand);
	box-shadow: inset 0 0 0 1px var(--hc-brand);
}

/* Action buttons container */
/* Module h3 headings */
.lct-hc-content h3 {
	margin: 0;
	font-size: 1.15rem;
	font-weight: 400;
	color: inherit;
}

/* Actions wrapper - flex row with space-between */
.lct-hc-actions-wrapper {
	display: flex;
	flex-direction: column;
	gap: 12px;
	align-items: stretch;
}

@media (min-width: 768px) {
	.lct-hc-actions-wrapper {
		flex-direction: row;
		justify-content: flex-end;
		align-items: center;
		gap: 16px;
	}
	.lct-hc-captcha-wrap {
		flex-shrink: 0;
		margin-right: auto;
	}
}

/* Actions container */
.lct-hc-actions {
	display: flex;
	flex-direction: row;
	gap: 12px;
	align-items: center;
	justify-content: flex-end;
}

/* Button styling */
.lct-hc-btn-primary,
.lct-hc-btn-secondary,
.lct-hc-btn-tertiary {
	padding: 8px 16px;
	border: none;
	border-radius: 3px;
	font-size: 0.9rem;
	font-weight: 600;
	cursor: pointer;
	transition: all .15s;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	justify-content: center;
}

.lct-hc-btn-primary {
	padding: 0.75rem 1.5rem;
	font-size: 1rem;
	border-radius: 0.375rem;
	background: linear-gradient(to bottom, #2563eb, #1d4ed8);
	color: #fff;
	transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease, opacity .15s ease;
}

.lct-hc-btn-primary:hover:not(:disabled) {
	background: linear-gradient(to bottom, #1d4ed8, #1e40af);
	transform: translateY(-1px);
	box-shadow: 0 4px 6px -1px rgba(0, 0, 0, .12), 0 2px 4px -2px rgba(0, 0, 0, .08);
}

.lct-hc-btn-primary:active:not(:disabled) {
	transform: translateY(0);
	box-shadow: 0 1px 2px rgba(0, 0, 0, .08);
}

.lct-hc-btn-primary:disabled,
.lct-hc-btn-primary[disabled] {
	opacity: 0.6;
	cursor: not-allowed;
	transform: none;
	background: #2563eb;
}

.lct-hc-btn-secondary {
	background: var(--hc-border);
	color: var(--hc-text-primary);
}

.lct-hc-btn-secondary:hover {
	background: #d1d5db;
}

.lct-hc-btn-tertiary {
	background: transparent;
	color: var(--hc-text-muted);
	border: 1px solid var(--hc-border);
}

.lct-hc-btn-tertiary:hover {
	background: var(--hc-brand-light);
	border-color: var(--hc-brand);
}

/* Empty state notification */
.lct-hc-empty-state {
	padding: 0;
	margin: 1rem 0 0 0;
}

.lct-hc-empty-card {
	background: #f0f9ff;
	border: 1px solid #bfdbfe;
	border-radius: 6px;
	padding: 16px;
	text-align: center;
}

.lct-hc-empty-icon {
	font-size: 32px;
	margin-bottom: 8px;
	color: #0284c7;
}

.lct-hc-empty-icon svg {
	color: #0284c7;
	width: 32px;
	height: 32px;
}

.lct-hc-empty-title {
	margin: 0 0 8px 0;
	font-size: 0.95rem;
	font-weight: 600;
	color: #0c4a6e;
	line-height: 1.4;
}

.lct-hc-empty-body {
	margin: 0 0 8px 0;
	font-size: 0.85rem;
	color: #0369a1;
	line-height: 1.5;
}

.lct-hc-empty-hint {
	margin: 0;
	font-size: 0.8rem;
	color: #0c4a6e;
	line-height: 1.4;
	font-style: italic;
}

/* Mode description */
.lct-hc-mode-desc {
	font-size: 0.85rem;
	color: var(--hc-text-secondary);
	margin: 8px 0 0 0;
	padding: 8px;
	background: var(--hc-brand-light);
	border-radius: 3px;
	line-height: 1.5;
}

/* Status messages */
.lct-hc-status {
	margin-top: 12px;
	padding: 8px 12px;
	border-radius: 3px;
	font-size: 0.85rem;
	line-height: 1.5;
	display: none;
}

.lct-hc-status.visible {
	display: block;
}

.lct-hc-status.success {
	background: #dcfce7;
	color: #166534;
	border: 1px solid #bbf7d0;
}

.lct-hc-status.error {
	background: #fee2e2;
	color: #991b1b;
	border: 1px solid #fecaca;
}

.lct-hc-status.info {
	background: var(--hc-brand-light);
	color: var(--hc-text-secondary);
	border: 1px solid var(--hc-brand-border);
}

/* Warning messages */
.lct-hc-warning {
	margin-top: 12px;
	padding: 12px;
	border-radius: 3px;
	font-size: 0.85rem;
	line-height: 1.5;
	display: none;
	background: #fef3c7;
	color: #92400e;
	border: 1px solid #fcd34d;
}

.lct-hc-warning.visible {
	display: block;
}

/* Auto-structure section */
.lct-hc-autostruct {
	margin-top: 12px;
}

.lct-hc-autostruct-head {
	display: block;
}

.lct-hc-autostruct-head strong {
	display: block;
	font-size: 0.9rem;
	margin-bottom: 4px;
}

/* Results section */
.lct-hc-results {
	margin-top: 24px;
}

.lct-hc-results-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	flex-wrap: wrap;
}

.lct-hc-results-header > div:first-child {
	display: flex;
	align-items: center;
	gap: 12px;
	flex: 1;
}

.lct-hc-results-header h3 {
	margin: 0;
	font-size: 1.15rem;
	font-weight: 400;
	line-height: unset;
}

.lct-hc-results-header .lct-hc-byte-counter {
	font-size: 0.85rem;
	padding: 6px 10px;
	border-radius: 3px;
	font-weight: 500;
	background: #dcfce7;
	color: #166534;
	border: 1px solid #bbf7d0;
}

.lct-hc-results-header .lct-hc-byte-counter.is-increase {
	background: #fee2e2;
	color: #991b1b;
	border-color: #fecaca;
}

.lct-hc-results-controls {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
}

.lct-hc-result-tabs {
	display: flex;
	gap: 4px;
	border-bottom: 1px solid var(--hc-border);
}

.lct-hc-result-btn {
	padding: 8px 12px;
	background: transparent;
	border: none;
	border-bottom: 2px solid transparent;
	color: var(--hc-text-secondary);
	font-size: 0.9rem;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.15s;
}

.lct-hc-result-btn:hover {
	color: var(--hc-text-primary);
}

.lct-hc-result-btn.is-active {
	color: var(--hc-brand);
	border-bottom-color: var(--hc-brand);
}

.lct-hc-results-actions {
	display: flex;
	gap: 8px;
}

.lct-hc-result-pane {
	padding: 0;
}

.lct-hc-result-pane[hidden] {
	display: none !important;
}

/* Results content: summary + comparison layout */
.lct-hc-results-content {
	display: grid;
	grid-template-columns: 1fr 2fr;
	gap: 24px;
	padding: 16px 0;
}

.lct-hc-results-summary {
	min-height: 300px;
}

.lct-hc-results-comparison {
	display: flex;
	flex-direction: column;
}

/* Stats table */
.lct-hc-stat-table {
	width: 100%;
	border-collapse: collapse;
	margin-bottom: 16px;
	font-size: 0.9rem;
}

.lct-hc-stat-table thead {
	background: var(--hc-brand-light);
	border-bottom: 1px solid var(--hc-border);
}

.lct-hc-stat-table th {
	padding: 10px 12px;
	text-align: left;
	font-weight: 600;
	color: var(--hc-text-secondary);
	font-size: 0.8rem;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.lct-hc-stat-table td {
	padding: 10px 12px;
	border-bottom: 1px solid var(--hc-border);
	color: var(--hc-text-primary);
}

.lct-hc-stat-table tbody tr:hover {
	background: rgba(2, 110, 208, 0.02);
}

.lct-hc-stat-percent {
	display: inline-block;
	margin-left: 6px;
	font-weight: 600;
	font-size: 0.9em;
}

.lct-hc-stat-percent.is-positive {
	color: #059669;
}

.lct-hc-stat-percent.is-negative {
	color: #dc2626;
}

.lct-hc-stat-percent.is-neutral {
	color: var(--hc-text-muted);
}

.lct-hc-stat-empty {
	padding: 16px;
	text-align: center;
	color: var(--hc-text-secondary);
	font-size: 0.9rem;
}

.lct-hc-stats-pane {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

/* Comparison layout */
.lct-hc-comparison-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
}

.lct-hc-comparison-col {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.lct-hc-comparison-label {
	font-size: 0.85rem;
	font-weight: 600;
	color: var(--hc-text-secondary);
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.lct-hc-output-textarea {
	min-height: 300px;
	font-family: 'Courier New', monospace;
	font-size: 0.85rem;
	line-height: 1.5;
}

.lct-hc-preview-frame {
	border: 1px solid var(--hc-border);
	border-radius: 3px;
	min-height: 300px;
	width: 100%;
}

.lct-hc-results-footer {
	display: flex;
	gap: 8px;
	margin-top: 16px;
	padding-top: 16px;
	border-top: 1px solid var(--hc-border);
}

@media (max-width: 1023px) {
	.lct-hc-results-content {
		grid-template-columns: 1fr;
		gap: 16px;
	}

	.lct-hc-results-summary {
		padding-bottom: 16px;
		border-bottom: 1px solid var(--hc-border);
	}
}

@media (max-width: 768px) {
	.lct-hc-comparison-row {
		grid-template-columns: 1fr;
	}

	.lct-hc-results-header {
		flex-direction: column;
		align-items: flex-start;
	}

	.lct-hc-results-controls {
		width: 100%;
		flex-direction: column;
	}

	.lct-hc-result-tabs {
		width: 100%;
		flex-wrap: wrap;
	}
}

/* Responsive */
@media (max-width: 1023px) {
	.lct-hc-header {
		flex-direction: column;
		align-items: flex-start;
	}
	.lct-tour-header-actions {
		width: 100%;
		order: -1;
	}
	.lct-hc-grid {
		grid-template-columns: 1fr;
	}
}
