@use "../app/admin/styles/primitives/buttons";
@use "../app/admin/styles/composites/modal-demo";
@use "../app/admin/styles/composites/toast-scrim";

.scheduled-changes-recording-start-overlay,
.scheduled-changes-recording-modal,
.scheduled-changes-recording-confirm,
.scheduled-changes-recording-editor-rail {
	/* stylelint-disable color-hex-length, value-keyword-case
	-- Mirrors design-system token values used by imported modal partials. */
	--brand: #3858e9;
	--brand-hover: #2c45c4;
	--brand-press: #243aa8;
	--brand-soft: #eef1fe;
	--brand-ring: #b9c4f8;
	--ink: #1e1e1e;
	--text: #2c3338;
	--text-muted: #5b626a;
	--text-faint: #646970;
	--on-brand: #ffffff;
	--surface: #ffffff;
	--surface-alt: #fbfbfc;
	--hairline: #e2e4e7;
	--hairline-strong: #cdd0d4;
	--status-failed: #cc1818;
	--status-failed-soft: #fdecea;
	--status-failed-ink: #9c1212;
	--status-running: #d18f00;
	--status-running-soft: #fff8e8;
	--status-running-ink: #7a4d00;
	--r-sm: 6px;
	--r-md: 10px;
	--r-lg: 16px;
	--r-pill: 999px;
	--shadow-modal: 0 24px 60px rgba(16, 24, 40, 0.24);
	--s-3: 12px;
	--s-4: 16px;
	--s-5: 24px;
	--s-7: 48px;
	--font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--glass-bg: rgba(255, 255, 255, 0.72);
	--glass-brd: rgba(255, 255, 255, 0.85);
	--glass-blur: saturate(170%) blur(20px);
	/* stylelint-enable color-hex-length, value-keyword-case */
}

.scheduled-changes-record-title-action {
	margin-left: 6px;
}

.scheduled-changes-record-toolbar-button {
	margin-left: 8px;
	white-space: nowrap;
}

.scheduled-changes-record-toolbar-button.is-disabled,
.scheduled-changes-record-toolbar-button[aria-disabled="true"] {
	cursor: not-allowed;
	opacity: 0.55;
}

.scheduled-changes-native-publish-hidden {
	display: none !important;
}

.scheduled-changes-recording-editor-banner,
.scheduled-changes-recording-editor-status {
	margin-left: 0;
}

.scheduled-changes-recording-editor-banner {
	align-items: flex-start;
	display: flex;
	gap: 12px;
	justify-content: space-between;
}

.scheduled-changes-recording-editor-banner__content {
	min-width: 0;
}

.scheduled-changes-recording-editor-banner p {
	margin-bottom: 0.5em;
}

.scheduled-changes-recording-editor-banner__links {
	color: #646970;
}

.scheduled-changes-recording-editor-banner__warning {
	color: #8a6d3b;
}

.scheduled-changes-recording-editor-banner__actions {
	display: flex;
	flex: 0 0 auto;
	flex-wrap: wrap;
	gap: 8px;
	justify-content: flex-end;
}

body.scheduled-changes-recording-active #wpcontent {
	animation: scheduled-changes-recording-frame 2.4s ease-in-out infinite;
	border-radius: 14px 0 0 14px;
	box-shadow:
		inset 0 0 0 2px rgba(204, 24, 24, 0.58),
		0 0 0 0 rgba(204, 24, 24, 0);
	padding-bottom: 128px;
}

.scheduled-changes-recording-editor-rail {
	bottom: 18px;
	left: 180px;
	pointer-events: none;
	position: fixed;
	right: 24px;
	z-index: 99999;
}

.scheduled-changes-recording-editor-rail__inner {
	align-items: center;
	background: var(--glass-bg);
	backdrop-filter: var(--glass-blur);
	border: 1px solid var(--glass-brd);
	border-radius: var(--r-lg);
	box-shadow: var(--shadow-modal);
	display: grid;
	gap: var(--s-3);
	grid-template-columns: minmax(0, 1fr) max-content;
	margin: 0 auto;
	max-width: 1180px;
	padding: 12px;
	pointer-events: auto;
}

.scheduled-changes-recording-editor-rail__status {
	align-items: center;
	background: var(--surface-alt);
	border: 1px solid var(--hairline);
	border-radius: var(--r-md);
	color: var(--text-muted);
	display: flex;
	flex-direction: column;
	font-size: 13px;
	gap: 6px;
	justify-content: center;
	line-height: 1.45;
	grid-column: 1;
	grid-row: 1;
	height: auto !important;
	min-height: 40px;
	min-width: 0;
	padding: 10px 12px;
	width: auto !important;
}

.scheduled-changes-recording-editor-rail__status p,
.scheduled-changes-recording-editor-rail__status ul {
	margin: 0;
}

.scheduled-changes-recording-editor-rail__status ul {
	padding-left: 18px;
}

.scheduled-changes-recording-editor-rail__status .btn {
	justify-self: start;
	margin-top: 2px;
}

.scheduled-changes-recording-editor-rail__status.is-info {
	background: var(--brand-soft);
	border-color: var(--brand-ring);
	color: var(--text);
}

.scheduled-changes-recording-editor-rail__status.is-warning {
	background: var(--status-running-soft);
	border-color: rgba(209, 143, 0, 0.32);
	color: var(--status-running-ink);
}

.scheduled-changes-recording-editor-rail__status.is-error {
	background: var(--status-failed-soft);
	border-color: rgba(204, 24, 24, 0.26);
	color: var(--status-failed-ink);
	font-weight: 600;
}

.scheduled-changes-recording-editor-rail__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	grid-column: 2;
	grid-row: 1;
	justify-content: flex-end;
}

.scheduled-changes-recording-save-control.is-disabled,
.scheduled-changes-recording-save-control[aria-disabled="true"] {
	cursor: not-allowed;
	opacity: 0.55;
	pointer-events: auto;
}

a.button.btn.btn-secondary {
	text-align: center;
}

.scheduled-changes-recording-confirm {
	align-items: center;
	backdrop-filter: blur(14px);
	background: rgba(17, 24, 39, 0.42);
	bottom: 0;
	display: flex;
	justify-content: center;
	left: 0;
	padding: 24px;
	position: fixed;
	right: 0;
	top: 0;
	z-index: 100002;
}

body.scheduled-changes-recording-start-overlay-open {
	overflow: hidden;
}

.scheduled-changes-recording-start-overlay {
	align-items: center;
	backdrop-filter: blur(14px);
	background: rgba(17, 24, 39, 0.48);
	bottom: 0;
	display: flex;
	justify-content: center;
	left: 0;
	padding: 24px;
	position: fixed;
	right: 0;
	top: 0;
	z-index: 100001;
}

.scheduled-changes-recording-modal {
	align-items: center;
	backdrop-filter: blur(14px);
	background: rgba(17, 24, 39, 0.45);
	bottom: 0;
	display: flex;
	justify-content: center;
	left: 0;
	padding: 2rem;
	position: fixed;
	right: 0;
	top: 0;
	z-index: 100000;
}

.scheduled-changes-record-title-action:focus-visible {
	box-shadow: 0 0 0 2px #fff, 0 0 0 4px #2271b1;
	outline: 2px solid transparent;
	outline-offset: 2px;
}

.scheduled-changes-recording-modal__status {
	margin: 0;
}

.scheduled-changes-recording-modal__status.is-error {
	color: #b32d2e;
	font-weight: 600;
}

.scheduled-changes-recording-confetti {
	inset: 0;
	overflow: hidden;
	pointer-events: none;
	position: absolute;
}

.scheduled-changes-recording-modal .modal {
	position: relative;
}

@keyframes scheduled-changes-recording-frame {

	0%,
	100% {
		box-shadow:
			inset 0 0 0 2px rgba(204, 24, 24, 0.58),
			0 0 0 0 rgba(204, 24, 24, 0);
	}

	50% {
		box-shadow:
			inset 0 0 0 3px rgba(204, 24, 24, 0.9),
			0 0 0 6px rgba(204, 24, 24, 0.1);
	}
}

@media (prefers-reduced-motion: reduce) {

	.scheduled-changes-record-title-action,
	.scheduled-changes-recording-start-overlay *,
	.scheduled-changes-recording-start-overlay *::before,
	.scheduled-changes-recording-start-overlay *::after,
	.scheduled-changes-recording-modal *,
	.scheduled-changes-recording-modal *::before,
	.scheduled-changes-recording-modal *::after,
	.scheduled-changes-recording-confirm *,
	.scheduled-changes-recording-confirm *::before,
	.scheduled-changes-recording-confirm *::after,
	.scheduled-changes-recording-editor-rail *,
	.scheduled-changes-recording-editor-rail *::before,
	.scheduled-changes-recording-editor-rail *::after,
	body.scheduled-changes-recording-active #wpcontent {
		animation-duration: 0.001ms !important;
		animation-iteration-count: 1 !important;
		scroll-behavior: auto !important;
		transition-duration: 0.001ms !important;
	}
}

@media (max-width: 782px) {

	.scheduled-changes-recording-editor-banner {
		display: block;
	}

	.scheduled-changes-recording-editor-rail {
		bottom: 10px;
		left: 10px;
		right: 10px;
	}

	.scheduled-changes-recording-editor-rail__inner {
		grid-template-columns: 1fr;
	}

	.scheduled-changes-recording-editor-rail__actions {
		justify-content: stretch;
	}

	.scheduled-changes-recording-editor-rail__actions .btn {
		flex: 1 1 0;
		justify-content: center;
	}

	.scheduled-changes-recording-modal__form {
		grid-template-columns: 1fr;
	}

	.scheduled-changes-recording-modal .modal-foot,
	.scheduled-changes-recording-confirm .modal-foot {
		flex-direction: column;
	}
}

@media (min-width: 783px) and (max-width: 960px) {

	.scheduled-changes-recording-editor-rail {
		left: 58px;
	}
}

body.folded .scheduled-changes-recording-editor-rail {
	left: 58px;
}
