/* ── Voice Commands UI ────────────────────────────────────────────────────────
   Styling for the voice status pill and confirmation bar.
   Colours, radii, and font sizes are kept consistent with the existing
   AUTONEER palette defined in leftnavbar.css and styles.css.
   ─────────────────────────────────────────────────────────────────────────── */


/* ── Status pill ─────────────────────────────────────────────────────────── */
/* Fixed bottom-right floating indicator.
   States: idle (hidden) | listening | processing | error |
           permission-denied | unsupported                                    */

.voice-status-bar {
	position: fixed;
	bottom: 20px;
	right: 20px;
	padding: 7px 14px;
	border-radius: 20px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	font-size: 13px;
	font-weight: 500;
	background: #2d2d2d;
	color: #fff;
	z-index: 10000;
	display: flex;
	align-items: center;
	gap: 6px;
	/* Hidden by default; .visible makes it appear */
	opacity: 0;
	transform: translateY(8px);
	transition: opacity 0.2s ease, transform 0.2s ease;
	pointer-events: none;
	max-width: 300px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.28);
}

.voice-status-bar.visible {
	opacity: 1;
	transform: translateY(0);
}

/* State variants */
.voice-status-listening {
	background: #013f7d;
	/* matches .left-navbar-buttons.active colour */
	animation: voice-pulse 1.5s ease-in-out infinite;
}

.voice-status-processing {
	background: darkslategray;
}

.voice-status-error {
	background: #dc2626;
}

.voice-status-permission-denied {
	background: darkorange;
}

.voice-status-unsupported {
	background: #666;
}

@keyframes voice-pulse {

	0%,
	100% {
		box-shadow: 0 0 0 0 rgba(1, 63, 125, 0.5);
	}

	50% {
		box-shadow: 0 0 0 7px rgba(1, 63, 125, 0);
	}
}


/* ── Confirmation bar ────────────────────────────────────────────────────── */
/* Shown for guarded commands before executing them.
   Sits above the status pill so both can be visible simultaneously.         */

.voice-confirm-bar {
	position: fixed;
	bottom: 62px;
	right: 20px;
	background: #F8F7F3;
	/* matches .left-navbar background */
	border: 1px solid #D9D8D3;
	/* matches left navbar border colour */
	border-radius: 10px;
	box-shadow: 0 4px 18px rgba(0, 0, 0, 0.18);
	z-index: 10001;
	padding: 12px 16px;
	min-width: 220px;
	max-width: 300px;
	opacity: 0;
	transform: translateY(10px);
	transition: opacity 0.2s ease, transform 0.2s ease;
	pointer-events: none;
	/* non-interactive until .visible */
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.voice-confirm-bar.visible {
	opacity: 1;
	transform: translateY(0);
	pointer-events: all;
}

.voice-confirm-inner {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.voice-confirm-header {
	display: flex;
	align-items: center;
	gap: 8px;
}

.voice-confirm-icon {
	color: #013f7d;
	font-size: 16px;
	flex-shrink: 0;
}

.voice-confirm-text {
	font-size: 14px;
	color: #141413;
	font-weight: 500;
	line-height: 1.3;
}

.voice-confirm-actions {
	display: flex;
	gap: 8px;
	justify-content: flex-end;
}


/* ── Mic button (injected into .left-navbar-items) ───────────────────────── */
/* Inherits .left-navbar-buttons for layout; these rules add voice-specific
   states on top without overriding any existing nav button behaviour.       */

.voice-mic-btn {
	border: none;
	width: 100%;
	font: inherit;
	appearance: none;
	-webkit-appearance: none;
	outline: none;
	box-shadow: none;
	background-clip: padding-box;
}

.voice-mic-btn:focus,
.voice-mic-btn:focus-visible,
.voice-mic-btn:active {
	outline: none;
	box-shadow: none;
	border: none;
}

.voice-mic-btn::-moz-focus-inner {
	border: 0;
	padding: 0;
}

/* Listening state: highlight with the app's primary blue */
.voice-mic-btn.voice-mic-listening {
	background-color: #013f7d !important;
	color: #fff !important;
	border-radius: 7px;
}

.voice-mic-btn.voice-mic-listening i {
	color: #fff;
	animation: voice-mic-blink 1.1s ease-in-out infinite;
}

.voice-mic-btn.voice-mic-listening .voice-mic-text {
	color: #fff;
}

/* Disabled state (unsupported browser) */
.voice-mic-btn:disabled {
	opacity: 0.38;
	cursor: not-allowed;
}

.voice-mic-btn:disabled:hover {
	background-color: #FAF9F5;
	/* prevent hover colour on disabled */
	font-size: 14px;
}

/* ── Inline modal dictation button ───────────────────────────────────────── */

.voice-dictation-wrap {
	position: relative;
}

.voice-dictation-target {
	padding-right: 46px;
}

.voice-dictation-btn {
	position: absolute;
	top: 3px;
	right: 3px;
	width: 32px;
	height: 32px;
	border: 1px solid white;
	border-radius: 999px;
	background: darkslategray;
	color: white;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-shadow: 1px 2px 3px rgba(0, 0, 0, 0.5);
	appearance: none;
	-webkit-appearance: none;
	outline: none;
	z-index: 2;
}

.voice-dictation-btn:hover,
.voice-dictation-btn:focus,
.voice-dictation-btn:focus-visible {
	background-color: darkgoldenrod;

	box-shadow: 0 4px 8px rgba(0, 0, 0, 0.35);
}

.voice-dictation-btn.voice-dictation-btn-listening {
	background: #013f7d;
	color: #fff;
	border-color: #013f7d;
}

.voice-dictation-btn.voice-dictation-btn-listening i {
	animation: voice-mic-blink 1.1s ease-in-out infinite;
}

@keyframes voice-mic-blink {

	0%,
	100% {
		opacity: 1;
	}

	50% {
		opacity: 0.35;
	}
}