/* =============================================================
   formula-vit-me.css — Công cụ lựa chọn vít me
   ============================================================= */

/* ── Mode radio inputs (hidden, used by CSS tab logic) ── */
#vm_mode_h,
#vm_mode_v { display: none; }

/* ── Mode selector labels ── */
.vm-mode-selector {
	display: flex;
	gap: 16px;
	margin-bottom: 28px;
	flex-wrap: wrap;
}
.vm-mode-label {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
	cursor: pointer;
	border: 2px solid #d1d5db;
	border-radius: 10px;
	padding: 14px 20px;
	min-width: 160px;
	transition: border-color .2s, box-shadow .2s;
	background: #fff;
	user-select: none;
}
.vm-mode-label:hover {
	border-color: #3b82f6;
}
.vm-mode-figure {
	width: 120px;
	height: 90px;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	margin: 0;
}
.vm-mode-figure img {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
}
.vm-mode-placeholder {
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 2.5rem;
	color: #9ca3af;
	background: #f3f4f6;
	border-radius: 6px;
}
.vm-mode-label span {
	font-size: 13px;
	font-weight: 600;
	color: #374151;
	text-align: center;
}

/* Active mode highlight */
#vm_mode_h:checked ~ .vm-mode-selector label[for="vm_mode_h"],
#vm_mode_v:checked ~ .vm-mode-selector label[for="vm_mode_v"] {
	border-color: #2563eb;
	box-shadow: 0 0 0 3px rgba(37,99,235,.15);
	background: #eff6ff;
}
#vm_mode_h:checked ~ .vm-mode-selector label[for="vm_mode_h"] span,
#vm_mode_v:checked ~ .vm-mode-selector label[for="vm_mode_v"] span {
	color: #1d4ed8;
}

/* ── Panels ── */
.vm-panel { display: none; }
#vm_mode_h:checked ~ .vm-panels #vm_h_panel,
#vm_mode_v:checked ~ .vm-panels #vm_v_panel { display: block; }

.vm-panel h4 {
	font-size: 1.1rem;
	font-weight: 700;
	color: #1e3a5f;
	margin: 0 0 20px;
	padding-bottom: 10px;
	border-bottom: 2px solid #2563eb;
}

/* ── Section (diagram + table side by side on wide screens) ── */
.vm-section {
	margin-bottom: 32px;
}
.vm-figure {
	margin: 0 0 16px 0;
	text-align: center;
}
.vm-figure img {
	max-width: 100%;
	height: auto;
	border-radius: 6px;
	border: 1px solid #e5e7eb;
}

/* ── Table titles ── */
.vm-table-title {
	display: block;
	font-weight: 700;
	font-size: 14px;
	color: #1e3a5f;
	margin-bottom: 10px;
	padding: 6px 12px;
	background: #dbeafe;
	border-left: 4px solid #2563eb;
	border-radius: 0 4px 4px 0;
}

/* ── Input/output tables ── */
.vm-input-table,
.vm-output-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 13px;
	margin-bottom: 8px;
}
.vm-input-table td,
.vm-output-table td {
	padding: 6px 8px;
	border: 1px solid #e5e7eb;
	vertical-align: middle;
}
.vm-input-table tr:nth-child(even) td,
.vm-output-table tr:nth-child(even) td {
	background: #f9fafb;
}
.vm-input-table td:first-child,
.vm-output-table td:first-child {
	width: 40%;
	color: #374151;
}
.vm-input-table td:nth-child(2),
.vm-output-table td:nth-child(2) {
	width: 12%;
	text-align: center;
	color: #4b5563;
}
.vm-input-table em,
.vm-output-table em {
	font-style: normal;
	color: #1d4ed8;
}

/* Lists inside cells (multi-row) */
.vm-input-table td ul,
.vm-output-table td ul {
	margin: 0;
	padding: 0;
	list-style: none;
}
.vm-input-table td ul li,
.vm-output-table td ul li {
	padding: 3px 0;
}

/* ── Number inputs ── */
.vm-inp-val,
.vm-out-val {
	width: 100px;
	padding: 4px 6px;
	border: 1px solid #d1d5db;
	border-radius: 4px;
	font-size: 13px;
	box-sizing: border-box;
}
.vm-inp-auto {
	background: #fdf6e3;
	color: #92400e;
	border-color: #fbbf24;
}
.vm-out-val {
	background: #f0fdf4;
	border-color: #86efac;
	color: #166534;
}
.vm-inp-val:disabled,
.vm-out-val:disabled {
	cursor: not-allowed;
}

/* ── Unit selects ── */
.vm-inp-unit,
.vm-out-unit {
	padding: 4px 4px;
	border: 1px solid #d1d5db;
	border-radius: 4px;
	font-size: 12px;
	max-width: 110px;
}

/* ── Calc button row ── */
.vm-calc {
	margin: 20px 0 28px;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
}
.vm-btn-calc {
	padding: 10px 28px;
	background: #2563eb;
	color: #fff;
	border: none;
	border-radius: 6px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: background .2s;
}
.vm-btn-calc:hover { background: #1d4ed8; }
.vm-btn-reset {
	padding: 10px 20px;
	background: #f3f4f6;
	color: #374151;
	border: 1px solid #d1d5db;
	border-radius: 6px;
	font-size: 14px;
	cursor: pointer;
	transition: background .2s;
}
.vm-btn-reset:hover { background: #e5e7eb; }

/* ── Error message ── */
.vm-error {
	color: #dc2626;
	font-size: 13px;
	flex-basis: 100%;
	margin: 0;
}

/* ── Results section ── */
.vm-results { display: none; }
.vm-results.vm-visible { display: block; }
.vm-table-wrap { margin-bottom: 24px; }

/* ── Notes lists ── */
.vm-notes {
	margin: 6px 0 0 0;
	padding-left: 20px;
	font-size: 12px;
	color: #6b7280;
	line-height: 1.6;
}
.vm-notes li { margin-bottom: 2px; }

/* ── Responsive ── */
@media (max-width: 768px) {
	.vm-mode-selector { gap: 10px; }
	.vm-mode-label { min-width: 130px; padding: 10px 14px; }
	.vm-inp-val,
	.vm-out-val { width: 80px; }
	.vm-input-table td:first-child,
	.vm-output-table td:first-child { width: 45%; font-size: 12px; }
}
