/* shell/toolbar.css — the floating toolbar, matched to Figma's (template-parts/toolbar.php, assets/js/tools.js).
   48px tall, 32px tools, a full height divider, and a Design / Dev Mode switch. Its own colours, because it copies a
   real tool's chrome: Figma's blue for the active tool (3:1 against the white icon, which is enough for an icon). */

.dba-toolbar {
	--tb-bg: #ffffff;
	--tb-ink: #1e1e1e;
	--tb-line: #e6e6e6;
	--tb-hover: #f5f5f5;
	--tb-track: #f2f2f2;
	--tb-chip: #ffffff;
	--tb-blue: #0d99ff;
	--tb-blue-ink: #0a6dc2;
	position: fixed;
	z-index: 60;
	bottom: var(--dba-tb-gap);
	left: calc(var(--dba-panel-live) + (100vw - var(--dba-panel-live)) / 2);
	display: flex;
	align-items: center;
	gap: 0.25rem;
	height: var(--dba-tb-h);
	padding: 0 0.5rem;
	background: var(--tb-bg);
	border-radius: 0.8125rem;
	box-shadow: 0 0 0.5px rgb(0 0 0 / 0.35), 0 1px 3px rgb(0 0 0 / 0.1), 0 6px 18px rgb(0 0 0 / 0.1);
	color: var(--tb-ink);
	transform: translateX(-50%);
}

:root[data-theme="dark"] .dba-toolbar {
	--tb-bg: #2c2c2c;
	--tb-ink: #ffffff;
	--tb-line: #444444;
	--tb-hover: #383838;
	--tb-track: #1e1e1e;
	--tb-chip: #444444;
	--tb-blue-ink: #7cc4f8;
}

.dba-tgroup {
	position: relative;
	display: flex;
	align-items: center;
}

.dba-toolbar button {
	display: grid;
	place-items: center;
	padding: 0;
	border: 0;
	background: transparent;
	color: inherit;
	font: inherit;
	cursor: pointer;
}

.dba-toolbar .dba-tbtn {
	position: relative;
	width: 2rem;
	height: 2rem;
	border-radius: 0.375rem;
}

.dba-toolbar .dba-tbtn:hover:not(.is-on) {
	background: var(--tb-hover);
}

.dba-toolbar .dba-tbtn.is-on {
	background: var(--tb-blue);
	color: #ffffff;
}

.dba-toolbar .dba-icon {
	width: 1.375rem;
	height: 1.375rem;
	stroke-width: 1.35;
}

/* The small arrow beside a tool with options */
.dba-toolbar .dba-chev {
	width: 1rem;
	height: 2rem;
	border-radius: 0.25rem;
}

.dba-toolbar .dba-chev:hover,
.dba-toolbar .dba-chev[aria-expanded="true"] {
	background: var(--tb-hover);
}

.dba-toolbar .dba-chev .dba-icon {
	width: 1rem;
	height: 1rem;
	stroke-width: 1.5;
}

.dba-tdivider {
	align-self: stretch;
	width: 1px;
	margin: 0 0.25rem;
	background: var(--tb-line);
}

/* Design / Dev Mode switch */
.dba-switch {
	display: flex;
	gap: 2px;
	padding: 2px;
	background: var(--tb-track);
	border-radius: 0.5rem;
}

.dba-switch .dba-tbtn {
	width: 2rem;
	height: 1.75rem;
	opacity: 1;
}

.dba-toolbar .dba-switch .dba-tbtn.is-on {
	background: var(--tb-chip);
	box-shadow: 0 0 0.5px rgb(0 0 0 / 0.35), 0 1px 3px rgb(0 0 0 / 0.15);
	color: var(--tb-blue-ink);
}

/* Options above a tool */
.dba-tmenu {
	position: absolute;
	bottom: calc(100% + 0.75rem);
	left: 0;
	display: grid;
	gap: 2px;
	min-width: 12.5rem;
	padding: 0.5rem;
	background: #1e1e1e;
	border-radius: 0.75rem;
	box-shadow: 0 10px 30px rgb(0 0 0 / 0.35);
	color: #ffffff;
}

.dba-tmenu[hidden] {
	display: none;
}

.dba-toolbar .dba-tmenu button:not(.dba-inkdot) {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	min-height: 2rem;
	padding: 0 0.5rem;
	border-radius: 0.375rem;
	font-size: 0.8125rem;
	text-align: left;
}

.dba-toolbar .dba-tmenu button:not(.dba-inkdot):hover:not(:disabled) {
	background: var(--tb-blue-ink, #0a6dc2);
	background: #0a6dc2;
}

.dba-toolbar .dba-tmenu button:disabled {
	color: #8c8c8c;
	cursor: default;
}

.dba-tmenu .dba-icon {
	width: 1.125rem;
	height: 1.125rem;
}

.dba-tmenu kbd {
	margin-left: auto;
	color: #b3b3b3;
	font: inherit;
	font-size: 0.75rem;
}

.dba-tmenu--inks {
	grid-auto-flow: column;
	gap: 0.5rem;
	min-width: 0;
	padding: 0.625rem;
}

.dba-toolbar .dba-inkdot {
	width: 1.5rem;
	height: 1.5rem;
	border: 2px solid #1e1e1e;
	border-radius: 50%;
	background: var(--ink);
}

.dba-toolbar .dba-inkdot[aria-pressed="true"] {
	box-shadow: 0 0 0 2px #ffffff;
}

/* Name of the tool, above the button */
.dba-toolbar [data-tip]::after {
	content: attr(data-tip);
	position: absolute;
	bottom: calc(100% + 0.875rem);
	left: 50%;
	padding: 0.32rem 0.55rem;
	border-radius: 0.3rem;
	background: #1e1e1e;
	color: #ffffff;
	font-size: 0.6875rem;
	font-weight: 500;
	line-height: 1.2;
	white-space: nowrap;
	opacity: 0;
	transform: translateX(-50%) translateY(3px);
	pointer-events: none;
	transition: opacity 0.15s, transform 0.2s;
}

.dba-toolbar [data-tip]:hover::after,
.dba-toolbar [data-tip]:focus-visible::after {
	opacity: 1;
	transform: translateX(-50%);
}

.is-preview .dba-toolbar {
	display: none;
}

.dba-tool-hint {
	bottom: calc(var(--dba-tb-h) + var(--dba-tb-gap) + 0.75rem);
}

.dba-ink__ellipse {
	border-radius: 50%;
}

@media (max-width: 56rem) {
	.dba-toolbar {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.dba-toolbar [data-tip]::after {
		transition: none;
	}
}
