/* =========================================================
   A Text Cleaner — giao diện công cụ làm sạch văn bản
   Đơn vị: chỉ dùng px. Tiền tố class: .atc-
   ========================================================= */

/* ---------- Khối bao ngoài của tool ---------- */
.atc-tool {
	--atc-border: #e5e7eb;
	--atc-bg: #ffffff;
	--atc-muted: #6b7280;
	--atc-text: #111827;
	--atc-panel: #f9fafb;
	--atc-amber-bg: #fffbeb;
	--atc-amber-border: #fde68a;
	--atc-amber-text: #92400e;
	--atc-textarea-min: 280px;

	box-sizing: border-box;
	width: 100%;
	max-width: 100%;
	margin: 0 0 24px;
	font-family: Arial, Helvetica, sans-serif;
	color: var(--atc-text);
}

.atc-tool *,
.atc-tool *::before,
.atc-tool *::after {
	box-sizing: border-box;
}

/* ---------- Tiêu đề / mô tả ---------- */
.atc-header {
	margin-bottom: 20px;
}

.atc-title {
	margin: 0 0 8px;
	font-size: 28px;
	line-height: 34px;
	font-weight: 700;
	color: var(--atc-text);
}

.atc-desc {
	margin: 0;
	max-width: 640px;
	font-size: 15px;
	line-height: 24px;
	color: var(--atc-muted);
}

/* ---------- Lưới 2 cột: văn bản gốc / đã làm sạch ---------- */
.atc-grid {
	display: grid;
	gap: 16px;
}

@media (min-width: 900px) {
	.atc-grid {
		grid-template-columns: 1fr 1fr;
	}
}

/* ---------- Ô nhập / xuất (panel) ---------- */
.atc-panel {
	border: 1px solid var(--atc-border);
	border-radius: 12px;
	background: var(--atc-bg);
	overflow: hidden;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.atc-panel-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 12px 16px;
	border-bottom: 1px solid #f3f4f6;
	background: var(--atc-panel);
	box-sizing: border-box;
}

.atc-panel-label {
	font-size: 14px;
	font-weight: 600;
}

.atc-badge {
	display: inline-block;
	font-size: 12px;
	font-weight: 600;
	color: var(--atc-amber-text);
	background: var(--atc-amber-bg);
	padding: 3px 9px;
	border-radius: 999px;
	white-space: nowrap;
}

.atc-panel-head-actions {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
	justify-content: flex-end;
}

.atc-view-toggle {
	display: inline-flex;
	align-items: stretch;
	gap: 0;
	border: 1px solid #3c4145;
	border-radius: 5px;
	overflow: hidden;
	background: #3c4145;
	line-height: 0;
	font-size: 0;
}

.atc-view-btn {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 2px 10px;
	font-size: 12px;
	font-weight: 500;
	line-height: 1.4;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	border: 0;
	border-radius: 0;
	margin: 0;
	background: #e8e9e9;
	color: #3c4145;
	cursor: pointer;
	text-shadow: none;
	appearance: none;
	-webkit-appearance: none;
	box-shadow: none;
	outline: none;
	transition: none;
}

.atc-view-btn:hover,
.atc-view-btn:focus,
.atc-view-btn:focus-visible,
.atc-view-btn:active {
	outline: none;
	box-shadow: none;
}

.atc-view-btn:hover {
	color: #fff;
	background: #4353ff;
	text-shadow: 0 0 1px rgba(255, 255, 255, 0.3);
}

.atc-view-btn.is-active {
	background: #3c4145;
	color: #e9eae9;
}

.atc-view-btn.is-active:hover {
	color: #fff;
	background: #4353ff;
	text-shadow: 0 0 1px rgba(255, 255, 255, 0.3);
}

.atc-view-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
}

.atc-view-icon svg {
	display: block;
	width: 14px;
	height: 14px;
	flex-shrink: 0;
}

.atc-input-stack {
	position: relative;
}

.atc-input-preview {
	font-family: Arial, Helvetica, sans-serif;
	white-space: pre-wrap;
	word-break: break-word;
	overflow-y: auto;
	cursor: text;
}

.atc-input-preview:empty::before {
	content: attr(data-placeholder);
	color: #9ca3af;
	white-space: pre-wrap;
}

.atc-input-preview[hidden],
.atc-input-html[hidden] {
	display: none !important;
}

.atc-input-hint {
	margin: 0;
	padding: 0 16px 12px;
	font-size: 13px;
	line-height: 20px;
	color: #9ca3af;
}

.atc-input-hint[hidden] {
	display: none !important;
}

/* ---------- Ô textarea ---------- */
.atc-textarea {
	display: block;
	width: 100%;
	min-height: var(--atc-textarea-min);
	margin: 0;
	padding: 16px;
	border: 0;
	outline: none;
	resize: vertical;
	font-family: Consolas, Monaco, "Courier New", monospace;
	font-size: 14px;
	line-height: 22px;
	color: var(--atc-text);
	background: #ffffff;
}

.atc-textarea-out {
	background: var(--atc-panel);
	resize: none;
	overflow-y: hidden;
}

.atc-input-html {
	resize: none;
	overflow-y: hidden;
}

/* ---------- Hàng nút & tùy chọn ---------- */
.atc-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
	margin-top: 16px;
}

/* ==================================================
   BUTTON SYSTEM (học theo ATTS button group)
   ================================================== */

.atc-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	background-color: #3c4145;
	color: #e9eae9;
	line-height: 1.4;
	padding: 2px 12px;
	border: none;
	border-radius: 5px;
	cursor: pointer;
	font-size: 14px;
	font-weight: 500;
	text-shadow: 0 0 0 transparent;
	transition: all 0.2s ease;
}

.atc-btn:hover {
	color: #fff;
	background: #4353ff;
	text-shadow: 0 0 1px rgba(255, 255, 255, 0.3);
}

.atc-btn-sm {
	padding: 2px 10px;
	font-size: 12px;
}

/* Primary — Clean Text / Copy */
.atc-btn-dark {
	background-color: #3c4145;
	color: #e9eae9;
}

.atc-btn-dark:hover {
	color: #fff;
	background: #4353ff;
	text-shadow: 0 0 1px rgba(255, 255, 255, 0.3);
}

/* Secondary — Clear (~70% so với nút chính, cùng hệ màu) */
.atc-btn-light {
	background-color: #3c4145;
	color: #e9eae9;
	opacity: 0.7;
	text-shadow: none;
}

.atc-btn.atc-btn-light:hover {
	color: #fff;
	background: #c82333;
	opacity: 0.7;
	text-shadow: none;
	text-decoration: none;
}

.atc-btn:disabled {
	opacity: 0.45;
	cursor: not-allowed;
	pointer-events: none;
}

.atc-btn:disabled:hover {
	background-color: #3c4145;
	color: #e9eae9;
	text-shadow: 0 0 0 transparent;
}

.atc-btn-light:disabled {
	opacity: 0.35;
}

.atc-btn-light:disabled:hover {
	background-color: #3c4145;
	color: #e9eae9;
	opacity: 0.35;
	text-decoration: none;
}

.atc-check {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 14px;
	color: #374151;
	cursor: pointer;
	user-select: none;
	margin: 0;
}

.atc-check input {
	margin: 0;
}

.atc-status {
	margin: 0;
	font-size: 14px;
	color: var(--atc-muted);
	flex: 1 1 100%;
}

@media (min-width: 700px) {
	.atc-status {
		flex: 1 1 auto;
	}
}

/* ---------- Danh sách dấu hiệu ẩn phát hiện được ---------- */
.atc-findings {
	margin-top: 16px;
	padding: 16px;
	border: 1px solid var(--atc-amber-border);
	border-radius: 12px;
	background: var(--atc-amber-bg);
}

.atc-findings[hidden] {
	display: none !important;
}

.atc-findings-title {
	display: block;
	margin-bottom: 8px;
	font-size: 14px;
	color: var(--atc-amber-text);
}

.atc-findings-list {
	margin: 0;
	padding-left: 18px;
	font-family: Consolas, Monaco, "Courier New", monospace;
	font-size: 13px;
	color: var(--atc-amber-text);
}

.atc-findings-list li {
	margin: 2px 0;
}

/* =========================================================
   Bài SEO / FAQ bên dưới công cụ
   ========================================================= */

.atc-article {
	width: 100%;
	max-width: 100%;
	margin: 32px 0 0;
	color: #374151;
	font-size: 16px;
	line-height: 27px;
	font-family: Arial, Helvetica, sans-serif;
}

.atc-article *,
.atc-article *::before,
.atc-article *::after {
	box-sizing: border-box;
}

/* Khối section: có viền trên + padding */
.atc-article-block {
	margin: 0;
}

.atc-article-panel {
	border-top: 1px solid #e5e7eb;
	background: #ffffff;
	padding: 10px 0px;
}

.atc-article-inner {
	max-width: 896px;
	margin: 0 auto;
}

.atc-article-section {
	margin: 0 0 32px;
}

.atc-article h2 {
	margin: 0 0 16px;
	font-size: 28px;
	font-weight: 700;
	line-height: 34px;
	color: #111827;
}

.atc-article h3 {
	margin: 0 0 12px;
	font-size: 22px;
	font-weight: 600;
	line-height: 28px;
	color: #1f2937;
}

.atc-article h4 {
	margin: 0 0 8px;
	font-size: 18px;
	font-weight: 600;
	line-height: 24px;
	color: #1f2937;
}

.atc-article p {
	margin: 0 0 16px;
	color: #4b5563;
}

.atc-article code {
	font-family: Consolas, Monaco, "Courier New", monospace;
	font-size: 14px;
	background: #f3f4f6;
	padding: 2px 6px;
	border-radius: 4px;
}

/* Danh sách (ul / ol) */
.atc-list {
	margin: 0 0 16px;
	padding-left: 22px;
	color: #4b5563;
	list-style: disc;
}

.atc-list-numbered {
	list-style: decimal;
}

.atc-list li {
	margin: 6px 0;
}

/* Thẻ lợi ích (2 cột) */
.atc-benefit-grid {
	display: grid;
	gap: 20px;
}

@media (min-width: 768px) {
	.atc-benefit-grid {
		grid-template-columns: 1fr 1fr;
	}
}

.atc-benefit-card {
	background: #f9fafb;
	padding: 20px;
	border-radius: 8px;
}

.atc-benefit-card h4 {
	margin: 0 0 12px;
}

.atc-benefit-card .atc-list {
	margin-bottom: 0;
}

/* Catalog công cụ liên quan */
.atc-tools {
	border-top: 1px solid #e5e7eb;
	background: #f9fafb;
	padding: 40px 16px;
	margin: 0;
}

.atc-tools-inner {
	max-width: 896px;
	margin: 0 auto;
}

.atc-tools-heading {
	margin: 0;
	font-size: 28px;
	font-weight: 700;
	line-height: 34px;
	text-align: center;
	color: #111827;
}

.atc-tools-lead {
	margin: 12px auto 0;
	max-width: 640px;
	text-align: center;
	color: #6b7280;
}

.atc-tools-groups {
	margin-top: 40px;
}

.atc-tools-group {
	margin: 0 0 40px;
}

.atc-tools-group:last-child {
	margin-bottom: 0;
}

.atc-tools-group-title {
	margin: 0;
	font-size: 18px;
	font-weight: 700;
	color: #111827;
}

.atc-tools-group-desc {
	margin: 4px 0 0;
	font-size: 14px;
	color: #6b7280;
}

.atc-tools-grid {
	display: grid;
	gap: 20px;
	margin-top: 20px;
}

@media (min-width: 768px) {
	.atc-tools-grid {
		grid-template-columns: 1fr 1fr;
	}
}

.atc-tool-card {
	display: block;
	padding: 20px;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	background: #ffffff;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
	text-decoration: none;
	color: inherit;
	transition: box-shadow 0.15s ease;
}

.atc-tool-card:hover {
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
	text-decoration: none;
}

.atc-tool-card-title {
	margin: 0 0 8px;
	font-size: 18px;
	font-weight: 600;
	color: #111827;
}

.atc-tool-card-desc {
	margin: 0;
	color: #6b7280;
}

.atc-tool-card-cta {
	margin-top: 16px;
	font-size: 14px;
	font-weight: 600;
	color: #2563eb;
}