/* ==========================================================================
   dqh-shared.css — Design system dùng chung: DA Question Hub + DA Mock Interview.
   Quy ước tách bạch:
   - Style riêng của module nào đặt trong CSS module đó, prefix .dqh- / .dmi-.
   - File này CHỈ chứa thành phần cả 2 module dùng chung (tokens, wrap, grid,
     card base, button base, table base) — không viết lại 2 lần.
   ========================================================================== */

/* ---------- Tokens màu nhấn + wrap (theme ghi đè được trên :root/body) ---------- */
/* Bảo vệ thuộc tính hidden: nhiều theme/selector class (vd .dmi-room{display:grid})
   ghi đè UA rule [hidden]{display:none} -> phần tử ẩn vẫn hiện. */
.dqh-wrap [hidden],
.dmi-wrap [hidden] {
	display: none !important;
}

.dqh-wrap,
.dmi-wrap {
	--dqh-accent: #2563eb;
	--dqh-accent-soft: rgba(37, 99, 235, .10);
	--dqh-border: #e5e7eb;
	--dqh-muted: rgba(0, 0, 0, .55);

	width: 100%;
	max-width: 100%;
	margin: 0 auto;
	/* Kế thừa font + màu chữ từ theme */
	font-family: inherit;
	color: inherit;
	line-height: 1.5;
}

/* ---------- Card grid: N card/row từ Settings (cards_per_row) ---------- */
.dqh-cards,
.dmi-grid {
	display: grid;
	grid-template-columns: repeat(var(--dqh-per-row, 4), minmax(0, 1fr));
	gap: 16px;
}

/* ---------- Card base ---------- */
.dqh-card,
.dmi-card {
	background: #ffffff;
	border: 1px solid var(--dqh-border);
	border-radius: 12px;
	padding: 20px;
	transition: box-shadow .18s ease, transform .18s ease, border-color .18s ease;
}

.dqh-card:hover,
.dmi-card:hover {
	border-color: var(--dqh-accent);
	box-shadow: 0 8px 24px var(--dqh-accent-soft);
	transform: translateY(-2px);
}

/* ---------- Button base ---------- */
.dqh-btn,
.dmi-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 7px;
	padding: 9px 16px;
	border-radius: 8px;
	border: 1px solid transparent;
	background: transparent;
	font-size: 14px;
	font-weight: 600;
	font-family: inherit;
	text-decoration: none;
	cursor: pointer;
	transition: background .15s ease, border-color .15s ease, color .15s ease;
}

/* ---------- Table base ---------- */
.dqh-table,
.dmi-history-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 14px;
}

/* ---------- Responsive grid (2 module dùng chung breakpoint) ---------- */
@media (max-width: 900px) {
	.dqh-cards,
	.dmi-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 560px) {
	.dqh-cards,
	.dmi-grid {
		grid-template-columns: 1fr;
	}
}
