/* Modal UI helpers for metrology.urops.net
	 Purpose: provide consistent modal overlays, body-scroll lock, and action/button utilities.
	 Keep this minimal and resilient to Tailwind usage in the page.
*/

/* Lock body scroll when modal open */
.modal-open {
	overflow: hidden !important;
	height: 100%;
}

/* Full-screen overlay */
.modal-overlay {
	position: fixed !important;
	inset: 0 !important; /* top:0; right:0; bottom:0; left:0 */
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	padding: 1rem !important;
	background-color: rgba(143, 143, 143, 0.5) !important;
	border-radius: 8px !important;
	box-shadow: 0 4px 12px rgba(15,23,42,0.2) !important;
	z-index: 9999 !important;
}

/* Card inside overlay */
.modal-content {
	background: #fff !important;
	color: #3e3e3e !important;
	border-radius: 8px !important;
	box-shadow: 0 6px 24px rgba(15,23,42,0.2) !important;
	max-width: 980px !important;
	width: 100% !important;
	max-height: calc(100vh - 2rem) !important;
	overflow: auto !important;
	padding: 1rem !important;
}

/* Action area - stacks on small screens, rows on larger */
.modal-actions {
	display: flex !important;
	gap: 0.5rem !important;
	flex-direction: column !important; /* mobile-first: stacked */
	margin-top: 0.75rem !important;
}
@media (min-width: 640px) {
	.modal-actions { flex-direction: row !important; justify-content: flex-end !important; }
}

/* Small utility button styles for modal footers */
.modal-btn {
	padding: 0.5rem 0.75rem !important;
	border-radius: 6px !important;
	border: 1px solid transparent !important;
	background: #fdfdfd !important; /* default: dark */
	color: #000000 !important;
	cursor: pointer !important;
	font-weight: 600 !important;
}
.modal-btn.secondary { background: #fff !important; color: #111827 !important; border-color: #e5e7eb !important; }
.modal-btn.ghost { background: transparent !important; color: #111827 !important; border-color: transparent !important; }

/* Ensure modals visually above other UI */
[data-modal] { z-index: 10000; }

/* Small content helpers used by a few modals */
.modal-header { display:flex; align-items:center; justify-content:space-between; gap:0.5rem; margin-bottom:0.5rem; }
.modal-close { background: transparent; border: none; padding: 0.25rem; cursor: pointer; }

/* Make sure images inside modal don't overflow */
.modal-content img { max-width: 100%; height: auto; }

