/* ============ Đề Thi Trắc Nghiệm — Frontend ============ */
.dttn-quiz {
	--dttn-green: #1aa179;
	--dttn-green-dark: #138a66;
	--dttn-blue: #2563eb;
	--dttn-orange: #f59e0b;
	--dttn-bg: #f5f6f8;
	--dttn-card: #ffffff;
	--dttn-border: #e4e7ec;
	--dttn-text: #1f2937;
	--dttn-muted: #6b7280;
	--dttn-radius: 12px;
	color: var(--dttn-text);
	font-size: 16px;
	line-height: 1.6;
	max-width: 100%;
}

/* Reset cục bộ chống theme can thiệp (Flatsome, v.v.) */
.dttn-quiz, .dttn-quiz * { box-sizing: border-box; }
.dttn-quiz .dttn-quiz-form { margin: 0; padding: 0; max-width: none; }

/* Layout 2 cột bằng GRID (ổn định hơn flex khi theme override) */
.dttn-quiz-layout {
	display: grid !important;
	grid-template-columns: minmax(0, 1fr) 300px !important;
	grid-template-areas: "main side" !important;
	gap: 24px;
	align-items: start;
	float: none !important;
	width: 100% !important;
}
.dttn-quiz-main {
	grid-area: main !important;
	min-width: 0 !important;
	max-width: 100% !important;
	width: auto !important;
	overflow: hidden;
	float: none !important;
	margin: 0 !important;
	padding: 0 !important;
}
.dttn-quiz-sidebar {
	grid-area: side !important;
	width: 300px !important;
	float: none !important;
	margin: 0 !important;
	padding: 0 !important;
	position: -webkit-sticky;
	position: sticky;
	top: 20px;
}
/* Phần tử lạ (theme chèn, hoặc gói whitespace) không phải 2 cột chính -> ẩn để không phá grid */
.dttn-quiz-layout > *:not(.dttn-quiz-main):not(.dttn-quiz-sidebar) { display: none !important; }

/* ---- Màn hình giới thiệu (intro) ---- */
.dttn-intro { display: flex; justify-content: center; padding: 10px 0; }
.dttn-intro-card {
	background: var(--dttn-card);
	border: 1px solid var(--dttn-border);
	border-radius: 16px;
	box-shadow: 0 4px 20px rgba(0,0,0,.06);
	padding: 32px 28px;
	text-align: center;
	max-width: 560px;
	width: 100%;
}
.dttn-intro-title {
	color: var(--dttn-orange);
	font-size: 1.4rem;
	font-weight: 800;
	margin: 0 0 18px;
}
.dttn-intro-meta {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 22px;
	color: var(--dttn-muted);
	font-size: .95rem;
	margin-bottom: 14px;
}
.dttn-intro-item { display: inline-flex; align-items: center; gap: 6px; }
.dttn-intro-item .dashicons { color: var(--dttn-orange); width: 18px; height: 18px; font-size: 18px; }
.dttn-intro-scope {
	font-size: .95rem;
	color: var(--dttn-text);
	margin: 0 0 22px;
}
.dttn-start-btn {
	display: inline-block;
	background: var(--dttn-orange) !important;
	color: #fff !important;
	border: none !important;
	border-radius: 8px;
	padding: 14px 38px !important;
	font-size: 1.05rem;
	font-weight: 800;
	letter-spacing: .5px;
	cursor: pointer;
	transition: background .15s, transform .1s;
	box-shadow: none !important;
}
.dttn-start-btn:hover { background: #d98209 !important; }
.dttn-start-btn:active { transform: scale(.98); }

.dttn-quiz-title {
	font-size: 1.7rem;
	font-weight: 800;
	margin: 0 0 10px;
	color: #1f2937;
	line-height: 1.3;
}
.dttn-quiz-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 18px;
	padding-bottom: 16px;
	margin-bottom: 8px;
	border-bottom: 1px solid var(--dttn-border);
	font-size: .9rem;
	color: var(--dttn-muted);
}
.dttn-quiz-meta-item { display: inline-flex; align-items: center; gap: 5px; }
.dttn-quiz-meta-item .dashicons { font-size: 17px; width: 17px; height: 17px; color: var(--dttn-green); }

/* Ẩn tiêu đề mặc định của theme trên trang đề (tránh trùng với title trong khung) */
.single-dttn_de_thi .page-title,
.single-dttn_de_thi .entry-title,
.single-dttn_de_thi .page-header,
.single-dttn_de_thi .title-wrapper > .entry-title { display: none !important; }

.dttn-part-title {
	margin: 28px 0 16px;
	padding: 10px 14px;
	background: linear-gradient(90deg, var(--dttn-green), var(--dttn-green-dark));
	color: #fff;
	border-radius: 8px;
	font-size: 1.05rem;
}

/* ---- Thẻ câu hỏi ---- */
.dttn-card {
	position: relative;
	display: block !important;
	float: none !important;
	width: auto !important;
	max-width: 100% !important;
	box-sizing: border-box !important;
	overflow-wrap: break-word;
	word-wrap: break-word;
	word-break: break-word;
	background: var(--dttn-card) !important;
	border: 1px solid var(--dttn-border);
	border-radius: var(--dttn-radius);
	padding: 20px !important;
	margin: 0 0 18px !important;
	scroll-margin-top: 80px;
	transition: box-shadow .25s, border-color .25s;
	box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.dttn-card.dttn-highlight {
	border-color: var(--dttn-green);
	box-shadow: 0 0 0 3px rgba(26,161,121,.18);
}
.dttn-card-head {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 12px;
	flex-wrap: wrap;
}
.dttn-card-num { font-weight: 700; color: var(--dttn-text); }
.dttn-card-level {
	font-size: .78rem;
	font-weight: 600;
	padding: 3px 10px;
	border-radius: 6px;
	color: #fff;
	background: var(--dttn-green);
}
.dttn-level-thong-hieu { background: var(--dttn-blue); }
.dttn-level-van-dung { background: var(--dttn-orange); }

.dttn-card-content {
	margin-bottom: 12px;
	max-width: 100%;
	overflow-wrap: break-word;
	word-wrap: break-word;
}
.dttn-card-content p { margin: 0 0 8px; }
.dttn-card-content p:last-child { margin-bottom: 0; }
.dttn-card-image { margin: 12px 0; }
.dttn-card-image img { max-width: 100%; height: auto; border-radius: 8px; }

/* ---- Phương án nhiều lựa chọn ---- */
.dttn-options { display: flex !important; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.dttn-option {
	display: flex !important;
	align-items: flex-start;
	gap: 10px;
	padding: 10px 14px !important;
	margin: 0 !important;
	border: 1px solid var(--dttn-border);
	border-radius: 10px;
	cursor: pointer;
	transition: background .15s, border-color .15s;
	float: none !important;
	width: auto !important;
	background: #fff;
}
.dttn-option:hover { background: #f0fdf9; border-color: var(--dttn-green); }
.dttn-option input[type="radio"] {
	margin: 4px 0 0 !important;
	width: 16px !important;
	height: 16px !important;
	min-width: 16px;
	flex: 0 0 auto;
	-webkit-appearance: radio;
	appearance: radio;
	opacity: 1 !important;
	position: static !important;
}
.dttn-option-letter { font-weight: 700; min-width: 18px; }
.dttn-option-text { flex: 1 1 auto; }

/* ---- Đúng/Sai ---- */
.dttn-tf-row {
	display: flex !important;
	align-items: center;
	gap: 12px;
	padding: 10px 0;
	border-bottom: 1px dashed var(--dttn-border);
	flex-wrap: wrap;
	float: none !important;
	width: auto !important;
}
.dttn-tf-row:last-child { border-bottom: none; }
.dttn-tf-sub { font-weight: 700; }
.dttn-tf-text { flex: 1 1 auto; min-width: 200px; }
.dttn-tf-choices { display: flex; gap: 16px; }
.dttn-tf-choices label { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }

/* ---- Ô gõ Đúng/Sai ---- */
.dttn-tf-fill { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.dttn-blank-no { color: var(--dttn-blue); font-weight: 700; font-size: .9rem; }
.dttn-ds-input {
	width: 52px;
	text-align: center;
	border: none !important;
	border-bottom: 2px solid var(--dttn-blue) !important;
	border-radius: 0 !important;
	background: transparent !important;
	box-shadow: none !important;
	outline: none !important;
	padding: 4px 2px !important;
	margin: 0 !important;
	font-size: 1rem;
	font-weight: 700;
	color: var(--dttn-blue);
	text-transform: uppercase;
	height: auto !important;
	line-height: 1.4;
}
.dttn-ds-input:focus { outline: none !important; border-bottom-color: var(--dttn-green) !important; box-shadow: none !important; }

/* ---- Trả lời ngắn (đoạn văn nhiều ô) ---- */
.dttn-short-passage { line-height: 2.1; }
.dttn-short-fill {
	display: inline-flex;
	align-items: baseline;
	gap: 6px;
	white-space: nowrap;
	margin: 0 3px;
	vertical-align: middle;
}
.dttn-short-fill-block { margin: 10px 0; }
.dttn-short-list { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; }
.dttn-short-input {
	border: none !important;
	border-bottom: 2px solid var(--dttn-blue) !important;
	border-radius: 0 !important;
	background: transparent !important;
	box-shadow: none !important;
	outline: none !important;
	padding: 2px 6px !important;
	margin: 0 !important;
	font-size: 1rem;
	min-width: 140px;
	color: var(--dttn-blue);
	font-weight: 600;
	height: auto !important;
	line-height: 1.4;
}
.dttn-short-input:focus { outline: none !important; border-bottom-color: var(--dttn-green) !important; box-shadow: none !important; }

/* ---- Chân thẻ: cờ kiểm tra lại ---- */
.dttn-card-foot { margin-top: 14px !important; text-align: right !important; clear: both; }
.dttn-flag-label {
	font-size: .88rem;
	color: var(--dttn-muted);
	cursor: pointer;
	display: inline-flex !important;
	align-items: center;
	gap: 6px;
	float: none !important;
	white-space: nowrap;
}
.dttn-flag-label input[type="checkbox"] {
	margin: 0 !important;
	padding: 0 !important;
	width: 16px !important;
	height: 16px !important;
	min-width: 16px;
	flex: 0 0 auto;
	position: static !important;
	opacity: 1 !important;
	-webkit-appearance: checkbox;
	appearance: checkbox;
	vertical-align: middle;
	left: auto !important;
	top: auto !important;
}

/* ---- Bảng điều khiển ---- */
.dttn-panel {
	background: var(--dttn-card) !important;
	border: 1px solid var(--dttn-border);
	border-radius: var(--dttn-radius);
	padding: 0 !important;
	box-shadow: 0 1px 3px rgba(0,0,0,.06);
	overflow: hidden;
}
.dttn-panel-head {
	background: #1a2b3c;
	color: #fff;
	font-weight: 700;
	font-size: 1rem;
	text-align: center;
	padding: 14px 16px;
	letter-spacing: .3px;
}
.dttn-panel-body { padding: 16px 14px; }
.dttn-panel-stats {
	display: flex !important;
	align-items: center;
	gap: 0;
	margin-bottom: 14px;
	padding-bottom: 12px;
	border-bottom: 1px solid var(--dttn-border);
}
.dttn-stat { flex: 1 1 0; text-align: center; }
.dttn-stat-sep { color: #d1d5db; font-size: 1.6rem; font-weight: 300; line-height: 1; padding: 0 2px; }
.dttn-stat-label { font-size: .72rem; color: #555; font-weight: 600; margin-bottom: 3px; }
.dttn-stat-value { font-size: 1.15rem; font-weight: 700; color: #77909b; line-height: 1.1; }
.dttn-timer { color: #77909b; }
.dttn-timer-warning { color: #dc2626 !important; animation: dttn-blink .8s infinite; }
@keyframes dttn-blink { 0%,100%{opacity:1} 50%{opacity:.4} }

.dttn-grid {
	display: grid !important;
	grid-template-columns: repeat(5, 1fr) !important;
	gap: 10px;
	margin-bottom: 16px;
	max-height: 320px;
	overflow-y: auto;
	scrollbar-width: thin;
	padding-right: 2px;
}
.dttn-grid::-webkit-scrollbar { width: 6px; }
.dttn-grid::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
.dttn-grid-cell {
	width: 100% !important;
	height: auto !important;
	aspect-ratio: 1 / 1;
	min-height: 34px;
	border: 1px solid var(--dttn-border);
	background: #fff !important;
	border-radius: 6px;
	cursor: pointer;
	font-weight: 600;
	font-size: .85rem;
	color: var(--dttn-text) !important;
	transition: all .15s;
	padding: 0 !important;
	margin: 0 !important;
	display: flex !important;
	align-items: center;
	justify-content: center;
	line-height: 1;
	float: none !important;
	box-shadow: none !important;
}
.dttn-grid-cell:hover { border-color: var(--dttn-green); }
.dttn-grid-cell.is-done { background: var(--dttn-green) !important; color: #fff !important; border-color: var(--dttn-green); }
.dttn-grid-cell.is-flag { background: #a855f7 !important; color: #fff !important; border-color: #a855f7; }

.dttn-submit-btn {
	width: 100% !important;
	padding: 12px !important;
	background: var(--dttn-green) !important;
	color: #fff !important;
	border: none !important;
	border-radius: 8px;
	font-size: 1rem;
	font-weight: 700;
	cursor: pointer;
	transition: background .15s, transform .1s;
	margin: 0 !important;
	float: none !important;
	text-align: center !important;
}
.dttn-submit-btn:hover { background: var(--dttn-green-dark) !important; }
.dttn-submit-btn:active { transform: scale(.98); }

.dttn-legend { list-style: none; margin: 14px 0 0; padding: 0; font-size: .82rem; color: var(--dttn-muted); }
.dttn-legend li { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.dttn-dot { width: 13px; height: 13px; border-radius: 50%; display: inline-block; }
.dttn-dot-done { background: var(--dttn-green); }
.dttn-dot-todo { background: #fff; border: 1px solid var(--dttn-border); }
.dttn-dot-flag { background: #a855f7; }

/* ─── Mini bar sticky cho mobile ─── */
.dttn-mini-bar {
	position: fixed;
	top: 0; left: 0; right: 0;
	z-index: 9999;
	background: #fff;
	border-bottom: 1px solid var(--dttn-border);
	box-shadow: 0 2px 8px rgba(0,0,0,.08);
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 12px;
}
.dttn-mini-stat { flex: 1; text-align: center; }
.dttn-mini-label { font-size: .65rem; color: #555; font-weight: 600; }
.dttn-mini-value { font-size: .95rem; font-weight: 700; color: #77909b; }
.dttn-mini-sep { color: #d1d5db; font-weight: 300; }
.dttn-mini-submit {
	width: auto !important;
	flex: 0 0 auto;
	padding: 8px 16px !important;
	font-size: .85rem !important;
	border-radius: 6px;
}


/* ---- Overlay nộp bài ---- */
.dttn-overlay {
	position: fixed; inset: 0;
	background: rgba(0,0,0,.45);
	display: flex; align-items: center; justify-content: center;
	z-index: 99999;
}
.dttn-overlay-box {
	background: #fff; padding: 24px 32px; border-radius: 12px;
	display: flex; align-items: center; gap: 12px; font-weight: 600;
}
.dttn-spinner {
	width: 22px; height: 22px; border: 3px solid var(--dttn-border);
	border-top-color: var(--dttn-green); border-radius: 50%;
	animation: dttn-spin .8s linear infinite;
}
@keyframes dttn-spin { to { transform: rotate(360deg); } }

/* ============ Trang kết quả ============ */
.dttn-result {
	--dttn-green: #1aa179;
	--dttn-blue: #2563eb;
	--dttn-border: #e4e7ec;
	--dttn-muted: #6b7280;
	max-width: 1040px;
	margin: 0 auto;
	padding: 20px;
	color: #1f2937;
	font-size: 16px;
	line-height: 1.6;
}

/* ---- Thẻ điểm gọn trên cùng ---- */
.dttn-result-top {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	background: linear-gradient(90deg, var(--dttn-green), #138a66);
	color: #fff;
	border-radius: 14px;
	padding: 18px 24px;
	margin-bottom: 22px;
}
.dttn-result-title { color: #fff; font-size: 1.2rem; font-weight: 800; margin: 0; }
.dttn-result-scorebox { display: flex; align-items: baseline; gap: 12px; }
.dttn-result-pct { font-size: 2rem; font-weight: 800; line-height: 1; }
.dttn-result-correct { font-size: 1rem; font-weight: 600; opacity: .95; }

/* ---- Khung trang kết quả: giới hạn bề rộng, chống tràn ---- */
.dttn-result-page {
	max-width: 1100px;
	margin: 0 auto;
	padding: 20px 16px 48px;
	box-sizing: border-box;
	overflow-x: hidden;
}
.dttn-result-page * { box-sizing: border-box; }

/* ---- Layout 2 cột: chính + sidebar ---- */
.dttn-result-layout {
	display: grid !important;
	grid-template-columns: minmax(0, 1fr) 260px;
	grid-template-areas: "main side";
	gap: 22px;
	align-items: start;
}
.dttn-result-main { grid-area: main; min-width: 0; }
.dttn-result-sidebar { grid-area: side; }
.dttn-result-layout > *:not(.dttn-result-main):not(.dttn-result-sidebar) { display: none !important; }

/* ---- Sidebar lưới ô màu ---- */
.dttn-result-panel {
	background: #fff;
	border: 1px solid var(--dttn-border);
	border-radius: 12px;
	overflow: hidden;
	position: sticky;
	top: 20px;
}
.dttn-result-panel-head {
	background: var(--dttn-green);
	color: #fff;
	text-align: center;
	font-weight: 800;
	padding: 10px;
	font-size: 1.05rem;
}
.dttn-result-panel-sub { text-align: center; color: var(--dttn-muted); font-size: .8rem; padding: 8px 8px 0; }
.dttn-result-grid {
	display: grid;
	grid-template-columns: repeat(6, 1fr);
	gap: 7px;
	padding: 12px;
}
.dttn-result-cell {
	aspect-ratio: 1 / 1;
	min-height: 34px;
	width: 100% !important;
	border: 1px solid var(--dttn-border);
	border-radius: 50%;
	background: #fff;
	cursor: pointer;
	font-weight: 700;
	font-size: .82rem;
	color: #fff;
	display: flex !important;
	align-items: center;
	justify-content: center;
	padding: 0 !important;
	margin: 0 !important;
	line-height: 1 !important;
	float: none !important;
	box-shadow: none !important;
	transition: transform .1s;
}
.dttn-result-cell.is-correct { background: var(--dttn-green); border-color: var(--dttn-green); }
.dttn-result-cell.is-wrong { background: #dc2626; border-color: #dc2626; }
.dttn-result-cell.is-active { box-shadow: 0 0 0 3px rgba(37,99,235,.45); transform: scale(1.08); }
.dttn-result-cell:hover { transform: scale(1.08); }

/* ---- Thẻ chi tiết câu ---- */
.dttn-result-card {
	background: #fff;
	border: 1px solid var(--dttn-border);
	border-left: 5px solid var(--dttn-border);
	border-radius: 12px;
	padding: 18px;
	margin-bottom: 16px;
}
.dttn-result-card.dttn-correct { border-left-color: var(--dttn-green); }
.dttn-result-card.dttn-wrong { border-left-color: #dc2626; }
.dttn-result-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.dttn-result-badge { font-size: .8rem; font-weight: 700; padding: 3px 12px; border-radius: 6px; color: #fff; }
.dttn-correct .dttn-result-badge { background: var(--dttn-green); }
.dttn-wrong .dttn-result-badge { background: #dc2626; }
.dttn-result-answer { background: #f0fdf9; border-radius: 8px; padding: 10px 14px; margin-top: 10px; font-size: .95rem; }
.dttn-result-answer p { margin: 4px 0; }
.dttn-your-answer { color: var(--dttn-muted); }
.dttn-result-explain { margin-top: 10px; padding: 10px 14px; background: #fff8ed; border-radius: 8px; font-size: .95rem; }
.dttn-tf-result { list-style: none; margin: 0; padding: 0; }
.dttn-tf-result li { padding: 3px 0; }
.dttn-tf-result-row {
	padding: 10px 12px;
	margin: 8px 0;
	border-radius: 8px;
	border-left: 4px solid #ccc;
	background: #fafafa;
	font-size: .95rem;
	line-height: 1.5;
}
.dttn-tf-result-row.dttn-row-ok { border-left-color: var(--dttn-green); background: #f0fdf9; }
.dttn-tf-result-row.dttn-row-no { border-left-color: #dc2626; background: #fff5f5; }
.dttn-tf-letter { font-weight: 700; margin-right: 4px; }
.dttn-tf-stmt { display: block; margin: 2px 0 6px; }
.dttn-tf-verdict { display: block; font-size: .9rem; color: var(--dttn-muted); }
.dttn-tf-verdict b { color: #111; }
.dttn-row-ok { color: var(--dttn-green); }
.dttn-row-no { color: #dc2626; }
.dttn-tf-mark { font-weight: 800; }

.dttn-result-expired { text-align: center; padding: 60px 20px; }

/* ---- Dòng kết quả kiểu "bỏ qua" (khung đứt nét đỏ như đề gốc) ---- */
.dttn-skip {
	color: #b91c1c;
	font-weight: 600;
}
.dttn-wrong .dttn-result-answer {
	background: #fff5f5;
	border: 1px dashed #dc2626;
}
.dttn-stmt-q { font-weight: 500; }

@media (max-width: 860px) {
	.dttn-result-layout {
		grid-template-columns: minmax(0, 1fr) !important;
		grid-template-areas: "side" "main" !important;
	}
	.dttn-result-panel { position: static; }
	.dttn-result-grid { grid-template-columns: repeat(8, 1fr); gap: 6px; padding: 10px; }
	.dttn-result-cell { min-height: 30px; font-size: .78rem; }
}
@media (max-width: 480px) {
	.dttn-result-grid { grid-template-columns: repeat(6, 1fr); }
}

/* ---- Responsive ---- */
@media (max-width: 860px) {
	.dttn-quiz-layout {
		grid-template-columns: minmax(0, 1fr) !important;
		grid-template-areas: "main" "side" !important;
	}
	/* Sidebar xuống cuối trang, không sticky, vẫn bấm được */
	.dttn-quiz-sidebar {
		width: 100% !important;
		position: static !important;
		margin-top: 20px;
	}
	/* Lưới ô trên mobile giới hạn chiều cao + scroll để không che màn hình */
	.dttn-grid { max-height: 220px; grid-template-columns: repeat(5, 1fr) !important; }
}
@media (max-width: 480px) {
	.dttn-grid { grid-template-columns: repeat(5, 1fr) !important; }
}
@media (min-width: 861px) {
	.dttn-mini-bar { display: none !important; }
}



/* ════════════════════════════════════════
   TRANG DANH MỤC ĐỀ THI
   ════════════════════════════════════════ */
.dttn-cat-page { background: var(--dttn-bg); padding: 24px 0 48px; }
.dttn-cat-container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

.dttn-cat-breadcrumb { font-size: .85rem; color: var(--dttn-muted); margin-bottom: 20px; }
.dttn-cat-breadcrumb a { color: var(--dttn-muted); text-decoration: none; }
.dttn-cat-breadcrumb a:hover { color: var(--dttn-green); }
.dttn-cat-bc-sep { margin: 0 8px; color: #bbb; }
.dttn-cat-bc-current { color: var(--dttn-text); font-weight: 600; }

.dttn-cat-header { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.dttn-cat-icon {
	width: 56px; height: 56px; flex: 0 0 56px;
	background: #eef0f3; border-radius: 12px;
	display: flex; align-items: center; justify-content: center;
}
.dttn-cat-icon .dashicons { font-size: 28px; width: 28px; height: 28px; color: #64748b; }
.dttn-cat-title { font-size: 1.7rem; font-weight: 800; margin: 0 0 4px; color: var(--dttn-text); }
.dttn-cat-meta { font-size: .9rem; color: var(--dttn-muted); }

.dttn-cat-desc {
	background: #fff; border: 1px solid var(--dttn-border); border-radius: 10px;
	padding: 16px 18px; color: #475569; font-size: .95rem; margin-bottom: 28px;
}

.dttn-cat-listtitle {
	font-size: 1.2rem; font-weight: 700; color: var(--dttn-text);
	border-left: 4px solid var(--dttn-green); padding-left: 12px; margin: 0 0 18px;
}

.dttn-cat-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 18px;
}
.dttn-cat-card {
	background: #fff !important;
	border: 1px solid #ddd !important;
	border-radius: 12px !important;
	padding: 18px !important;
	display: flex !important;
	flex-direction: column;
	gap: 10px;
	transition: box-shadow .15s, transform .15s;
	box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.dttn-cat-card:hover { box-shadow: 0 6px 20px rgba(0,0,0,.08); transform: translateY(-2px); }
.dttn-cat-card-title { font-size: 1rem; font-weight: 700; margin: 0; line-height: 1.4; min-height: 2.8em; }
.dttn-cat-card-title a { color: var(--dttn-text); text-decoration: none; }
.dttn-cat-card-title a:hover { color: var(--dttn-green); }
.dttn-cat-card-subject { font-size: .85rem; color: var(--dttn-muted); }
.dttn-cat-card-meta { display: flex; align-items: center; justify-content: space-between; font-size: .82rem; color: var(--dttn-muted); margin-top: auto; }
.dttn-cat-card-q { display: flex; align-items: center; gap: 4px; }
.dttn-cat-card-q .dashicons { font-size: 15px; width: 15px; height: 15px; }
.dttn-cat-card-btn {
	display: block !important;
	width: 100% !important;
	text-align: center !important;
	background: #1aa179 !important;
	color: #ffffff !important;
	padding: 10px !important;
	border-radius: 7px !important;
	font-weight: 700 !important;
	text-decoration: none !important;
	font-size: .92rem !important;
	border: none !important;
	box-shadow: none !important;
	transition: background .15s;
	margin: 0 !important;
}
.dttn-cat-card-btn:hover { background: #138a66 !important; color: #ffffff !important; }
.dttn-cat-empty { color: var(--dttn-muted); grid-column: 1 / -1; text-align: center; padding: 40px; }

@media (max-width: 1024px) { .dttn-cat-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 768px) { .dttn-cat-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .dttn-cat-grid { grid-template-columns: 1fr; } .dttn-cat-card-title { min-height: 0; } }

/* ════════════════════════════════════════
   POPUP "LẤY MÃ ĐỂ XEM KẾT QUẢ"
   ════════════════════════════════════════ */
.dttn-l4m-overlay {
	position: fixed; inset: 0; z-index: 99999;
	background: rgba(0,0,0,.55);
	display: flex; align-items: flex-start; justify-content: center;
	padding: 30px 14px; overflow-y: auto;
}
.dttn-l4m-popup {
	background: #fff; max-width: 680px; width: 100%;
	overflow-y: scroll;
	border-radius: 14px; padding: 26px 28px;
	box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.dttn-l4m-h {
	text-align: center; color: #e23b3b; font-size: 1.3rem;
	font-weight: 800; margin: 0 0 8px; line-height: 1.4;
}
.dttn-l4m-note { text-align: center; color: #2563eb; font-size: .9rem; margin: 0 0 18px; }
.dttn-l4m-codebox {
	display: flex; align-items: center; gap: 0;
	border: 1px solid #d1d5db; border-radius: 30px;
	max-width: 460px; margin: 0 auto 8px; overflow: hidden; padding: 4px 4px 4px 18px;
	box-shadow: 0 0 10px #ccc;
}
.dttn-l4m-codebox input {
	flex: 1; border: none !important; outline: none; font-size: 1rem;
	background: transparent; min-height: 42px; box-shadow: none !important; padding: 0 !important;
	margin-bottom: 0px !important;
}
.dttn-l4m-codebox button {
	flex: 0 0 auto; background: #3b82f6; color: #fff; border: none;
	padding: 7px 22px; border-radius: 26px; font-weight: 700; cursor: pointer; font-size: .95rem;
	margin-bottom: 0px;
}
.dttn-l4m-codebox button:hover { background: #2563eb; }
.dttn-l4m-codebox button:disabled { background: #9ca3af; cursor: default; }
.dttn-l4m-msg { text-align: center; font-size: .9rem; margin: 6px 0 0; min-height: 20px; font-weight: 600; }
.dttn-l4m-msg.ok { color: #16a34a; }
.dttn-l4m-msg.err { color: #dc2626; }

.dttn-l4m-steps { margin-top: 0px; font-size: .95rem; line-height: 1.7; color: #333; }
.dttn-l4m-steps p { margin: 0 0 7px; }
.dttn-l4m-steps strong { color: #e23b3b; }
.dttn-l4m-kw {
	color: #e23b3b; font-weight: 800; font-size: 1.05rem;
	background: #fff5f5; padding: 2px 8px; border-radius: 5px;
}
.dttn-l4m-copy {
	border: 1px solid #ddd; background: #f8f9fa; border-radius: 5px;
	cursor: pointer; padding: 4px 7px; margin-left: 6px;
	display: inline-flex; align-items: center; justify-content: center;
	vertical-align: middle; color: #555; transition: all .15s; line-height: 1;
}
.dttn-l4m-copy:hover { background: #eef2f7; color: #1a73e8; border-color: #c7d2e0; }
.dttn-l4m-copy svg { display: block; }
.dttn-l4m-copy.dttn-l4m-copied { background: #1a7f37; border-color: #1a7f37; color: #fff; }
.dttn-l4m-imgwrap { text-align: center; margin: 10px 0; }
.dttn-l4m-imgwrap img { max-width: 100%; border: 2px solid #e23b3b; border-radius: 8px; }
.dttn-l4m-extra { margin-top: 8px; }

@media (max-width: 480px) {
	.dttn-l4m-popup { padding: 20px 16px; }
	.dttn-l4m-h { font-size: 1.1rem; }
	.dttn-l4m-codebox { flex-wrap: wrap; border-radius: 12px; padding: 6px; }
	.dttn-l4m-codebox input { width: 100%; flex: 1 1 100%; padding: 8px !important; }
	.dttn-l4m-codebox button { width: 100%; margin-top: 6px; border-radius: 8px; }
}

/* ── Nút đóng popup lấy mã (NGOÀI khung, không bị overflow cắt) ── */
.dttn-l4m-close {
	position: absolute;
	top: 18px;
	right: calc(50% - 340px - 6px); /* mép phải popup (max-width 680/2=340) */
	background: #fff; border: none; cursor: pointer;
	font-size: 24px; line-height: 40px; text-align: center; color: #333;
	padding: 0 !important; margin: 0 !important;
	width: 40px; height: 40px; min-height: unset !important; border-radius: 50%;
	box-shadow: 0 2px 12px rgba(0,0,0,.35);
	transition: all .15s; z-index: 100000;
}
.dttn-l4m-close:hover { background: #f1f1f1; transform: scale(1.08); }
/* Màn hẹp hơn popup: dán sát mép phải màn hình */
@media (max-width: 720px) {
	.dttn-l4m-close { right: 14px; top: 14px; }
}

/* ── Màn "đã làm xong, xem kết quả?" ── */
.dttn-locked-wrap { max-width: 760px; margin: 30px auto; padding: 0 16px; }
.dttn-locked-card {
	background: #fff; border: 1px solid #eee; border-radius: 14px;
	box-shadow: 0 4px 20px rgba(0,0,0,.06);
	padding: 28px 24px; text-align: center;
}
.dttn-locked-title {
	color: #f59e0b; font-weight: 800; font-size: 1.3rem;
	margin: 0 0 14px; text-transform: uppercase; line-height: 1.4;
}
.dttn-locked-meta {
	display: flex; gap: 24px; justify-content: center; flex-wrap: wrap;
	color: #333; font-size: .98rem; margin-bottom: 8px;
}
.dttn-locked-meta strong { color: #111; }
.dttn-locked-ask { color: #16a34a; font-weight: 700; font-size: 1.02rem; margin: 16px 0 18px; }
.dttn-locked-btn {
	background: #fff; color: #f59e0b; border: 2px solid #f59e0b;
	padding: 12px 32px; border-radius: 8px; font-weight: 800; font-size: 1rem;
	cursor: pointer; text-transform: uppercase; letter-spacing: .5px; transition: all .15s;
}
.dttn-locked-btn:hover { background: #f59e0b; color: #fff; }

/* ── Danh mục con (chips) ── */
.dttn-cat-children { margin: 8px 0 26px; }
.dttn-cat-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.dttn-cat-chip {
	display: inline-flex; align-items: center; gap: 8px;
	background: #fff; border: 1px solid #e2e8f0; border-radius: 999px;
	padding: 8px 14px; text-decoration: none; color: #1f2937;
	font-weight: 600; font-size: .92rem; transition: all .15s;
}
.dttn-cat-chip:hover { border-color: #1aa179; color: #1aa179; box-shadow: 0 2px 8px rgba(26,161,121,.15); }
.dttn-cat-chip-count {
	background: #1aa179; color: #fff; font-size: .76rem; font-weight: 700;
	min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px;
	display: inline-flex; align-items: center; justify-content: center;
}

/* ── Phân trang ── */
.dttn-cat-grid + .navigation,
.dttn-cat-page .navigation,
.dttn-cat-page .pagination {
	margin-top: 28px;
}
.dttn-cat-page .nav-links,
.dttn-cat-page .pagination {
	display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center;
}
.dttn-cat-page .page-numbers {
	display: inline-flex; align-items: center; justify-content: center;
	min-width: 40px; height: 40px; padding: 0 12px;
	border: 1px solid #e2e8f0; border-radius: 8px;
	background: #fff; color: #1f2937; text-decoration: none;
	font-weight: 600; font-size: .95rem; transition: all .15s;
}
.dttn-cat-page .page-numbers:hover { border-color: #1aa179; color: #1aa179; }
.dttn-cat-page .page-numbers.current {
	background: #1aa179; border-color: #1aa179; color: #fff;
}
.dttn-cat-page .page-numbers.dots { border: none; background: none; min-width: auto; }

/* ════════════════════════════════════════
   TRANG CHỦ (page-home)
   ════════════════════════════════════════ */
.dttn-home-container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* Section search */
.dttn-home-search {
	background: linear-gradient(135deg, #1aa179 0%, #14855f 100%);
	padding: 56px 0 60px;
	text-align: center;
}
.dttn-home-title { color: #fff; font-size: 2rem; font-weight: 800; margin: 0 0 8px; }
.dttn-home-sub { color: rgba(255,255,255,.9); font-size: 1.05rem; margin: 0 0 28px; }
.dttn-home-searchbox {
	display: flex; align-items: center; gap: 0;
	max-width: 620px; margin: 0 auto; background: #fff;
	border-radius: 999px; padding: 6px 6px 6px 20px;
	box-shadow: 0 10px 30px rgba(0,0,0,.18);
}
.dttn-home-searchbox .dashicons { color: #94a3b8; font-size: 22px; width: 22px; height: 22px; flex: 0 0 auto; }
.dttn-home-searchbox input {
	flex: 1; border: none !important; outline: none; background: transparent;
	font-size: 1rem; padding: 12px 12px !important; box-shadow: none !important; min-height: 44px;
}
.dttn-home-searchbox button {
	flex: 0 0 auto; background: #f59e0b !important; color: #fff !important; border: none !important;
	padding: 12px 28px !important; margin: 0 !important; border-radius: 999px !important;
	font-weight: 700; font-size: 1rem; cursor: pointer; line-height: 1.2 !important;
	min-height: unset !important; text-shadow: none !important; box-shadow: none !important;
	transition: background .15s;
}
.dttn-home-searchbox button:hover { background: #d97f08 !important; }

/* Section danh mục */
.dttn-home-cats { padding: 44px 0 60px; background: #f7f9fb; }
.dttn-home-h2 {
	font-size: 1.4rem; font-weight: 800; color: #1f2937; margin: 0 0 22px;
	border-left: 4px solid #1aa179; padding-left: 12px;
}
.dttn-home-grid {
	display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
}
.dttn-home-card {
	background: #fff; border: 1px solid #e5e9ee; border-radius: 14px;
	padding: 18px 18px 14px; transition: box-shadow .15s, transform .15s;
}
.dttn-home-card:hover { box-shadow: 0 8px 26px rgba(0,0,0,.08); transform: translateY(-2px); }
.dttn-home-card-head {
	display: flex; align-items: center; justify-content: space-between;
	gap: 10px; padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px solid #eef1f4;
}
.dttn-home-card-title {
	display: inline-flex; align-items: center; gap: 8px;
	font-size: 1.08rem; font-weight: 800; color: #1f2937; text-decoration: none; line-height: 1.3;
}
.dttn-home-card-title .dashicons { color: #1aa179; font-size: 20px; width: 20px; height: 20px; }
.dttn-home-card-title:hover { color: #1aa179; }
.dttn-home-card-count {
	flex: 0 0 auto; background: #ecfdf3; color: #1aa179; font-weight: 700;
	font-size: .8rem; padding: 4px 10px; border-radius: 999px; white-space: nowrap;
}
.dttn-home-sublist { list-style: none; margin: 0; padding: 0; }
.dttn-home-sublist li { margin: 0; }
.dttn-home-sublist a {
	display: flex; align-items: center; justify-content: space-between; gap: 8px;
	padding: 8px 10px; border-radius: 8px; text-decoration: none; color: #374151;
	font-size: .94rem; transition: background .12s, color .12s;
}
.dttn-home-sublist a:hover { background: #f1faf6; color: #1aa179; }
.dttn-home-sub-count {
	flex: 0 0 auto; background: #f1f5f9; color: #64748b; font-size: .76rem; font-weight: 700;
	min-width: 22px; height: 20px; padding: 0 6px; border-radius: 999px;
	display: inline-flex; align-items: center; justify-content: center;
}
.dttn-home-card-link { display: inline-block; margin-top: 4px; color: #1aa179; font-weight: 700; text-decoration: none; font-size: .92rem; }
.dttn-home-card-link:hover { text-decoration: underline; }

@media (max-width: 900px) { .dttn-home-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) {
	.dttn-home-grid { grid-template-columns: 1fr; }
	.dttn-home-title { font-size: 1.5rem; }
	.dttn-home-searchbox { flex-wrap: wrap; border-radius: 14px; padding: 8px; }
	.dttn-home-searchbox input { width: 100%; flex: 1 1 100%; }
	.dttn-home-searchbox button { width: 100%; margin-top: 6px; border-radius: 8px; }
}

/* ── Ô tìm lại trong trang kết quả tìm kiếm ── */
.dttn-search-again {
	display: flex; gap: 0; max-width: 520px; margin: 0 0 24px;
	border: 1px solid #d1d5db; border-radius: 999px; overflow: hidden; background: #fff;
	padding: 4px 4px 4px 18px;
}
.dttn-search-again input {
	flex: 1; border: none !important; outline: none; background: transparent;
	font-size: .95rem; padding: 10px 8px !important; box-shadow: none !important; min-height: 40px;
}
.dttn-search-again button {
	flex: 0 0 auto; background: #1aa179 !important; color: #fff !important; border: none !important;
	padding: 10px 22px !important; margin: 0 !important; border-radius: 999px !important;
	font-weight: 700; cursor: pointer; min-height: unset !important; line-height: 1.2 !important;
	box-shadow: none !important; text-shadow: none !important;
}
.dttn-search-again button:hover { background: #138a66 !important; }
