/**
 * AIR Services Modal - shared chrome for every modal/slide-over opened via
 * catalog/view/javascript/air_services_modal.js. One stylesheet reused by
 * every AIR Services page that opens a modal.
 *
 * Colours (2026-07-30): re-pointed at the AIR Global UI Theme's own
 * `--air-*` custom properties (see catalog/view/stylesheet/air_global_theme.css,
 * loaded before this file from header.twig) rather than this file's own
 * previously-hardcoded hex values, so this modal chrome and every Bootstrap
 * card/table/form on the storefront always share one single palette. Danger
 * (`.air-services-modal-destructive`/`.air-services-modal-error`) is
 * deliberately left as its own literal red, not converted to the accent -
 * it needs to keep reading as a destructive-action warning, matching how
 * the global theme also leaves .btn-danger/.alert-danger semantically red.
 */

.air-services-modal-overlay {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background-color: rgba(0, 0, 0, 0.65);
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding: 4vh 1rem;
	overflow-y: auto;
	z-index: 1050;
}

body.air-services-modal-open {
	overflow: hidden;
}

.air-services-modal {
	position: relative;
	width: 100%;
	max-width: 480px;
	background-color: var(--air-bg-card);
	border: 1px solid var(--air-border);
	border-radius: 0.5rem;
	color: var(--air-text-primary);
	box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.5);
	outline: none;
}

.air-services-modal-destructive {
	border-color: #5a1f1f;
}

.air-services-modal-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 1rem 1.25rem;
	border-bottom: 1px solid var(--air-border);
}

.air-services-modal-title {
	margin: 0;
	font-size: 1.1rem;
	font-weight: 700;
	color: var(--air-accent);
}

.air-services-modal-close {
	background: transparent;
	border: none;
	color: var(--air-text-secondary);
	font-size: 1.5rem;
	line-height: 1;
	cursor: pointer;
	padding: 0.25rem 0.5rem;
}

.air-services-modal-close:hover,
.air-services-modal-close:focus {
	color: var(--air-text-primary);
}

/**
 * Machine Identity band (2026-09-02) - a fixed, always-visible header strip
 * naming the machine a session-bound modal (e.g. a terminal) is connected to.
 * Sits in the modal chrome above the (replaceable, scrolling) body so it stays
 * put while terminal output scrolls. Prominent but on-theme: the IP is set in
 * the accent colour and a monospace face so an operator can tell at a glance
 * exactly which machine they are controlling.
 */
.air-services-modal-identity {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.35rem 1.75rem;
	padding: 0.7rem 1.25rem;
	background-color: var(--air-bg-section);
	border-bottom: 1px solid var(--air-border);
}

.air-services-modal-identity-item {
	display: flex;
	align-items: baseline;
	gap: 0.45rem;
	min-width: 0;
}

.air-services-modal-identity-label {
	font-size: 0.7rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	font-weight: 600;
	color: var(--air-text-muted);
	white-space: nowrap;
	flex: 0 0 auto;
}

.air-services-modal-identity-value {
	font-size: 0.95rem;
	font-weight: 700;
	color: var(--air-text-primary);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.air-services-modal-identity-value.air-services-modal-identity-ip {
	font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
	color: var(--air-accent);
}

.air-services-modal-body {
	padding: 1.25rem;
}

.air-services-modal-body label {
	color: var(--air-text-muted);
	font-size: 0.85rem;
	margin-bottom: 0.25rem;
}

.air-services-modal-body .form-control,
.air-services-modal-body select {
	background-color: var(--air-bg-section);
	border: 1px solid var(--air-border);
	color: var(--air-text-primary);
}

.air-services-modal-body .form-control:disabled {
	color: var(--air-text-muted);
}

.air-services-modal-error {
	margin: 0 1.25rem;
	padding: 0.6rem 0.9rem;
	background-color: #3a1414;
	color: #ff8080;
	border: 1px solid #5a1f1f;
	border-radius: 0.375rem;
	font-size: 0.9rem;
}

.air-services-modal-error:not(:empty) {
	margin-top: 1rem;
}

.air-services-modal-loading-overlay {
	display: none;
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	align-items: center;
	justify-content: center;
	background-color: rgba(20, 20, 20, 0.6);
	border-radius: 0.5rem;
}

.air-services-modal-loading .air-services-modal-loading-overlay {
	display: flex;
}

.air-services-modal-spinner {
	width: 2rem;
	height: 2rem;
	border: 0.25rem solid var(--air-border);
	border-top-color: var(--air-accent);
	border-radius: 50%;
	animation: air-services-modal-spin 0.7s linear infinite;
}

@keyframes air-services-modal-spin {
	to {
		transform: rotate(360deg);
	}
}

.air-services-modal-flash {
	animation: air-services-modal-flash-in 0.2s ease-out;
}

@keyframes air-services-modal-flash-in {
	from {
		opacity: 0;
		transform: translateY(-0.25rem);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}
