/* Canvas-adjacent editor controls. Kept separate from the drawing engine. */
#canvas-pane {
  position: relative;
}

#canvas-tools {
  left: 0;
  top: 0;
  bottom: 34px;
  width: 54px;
  max-height: none;
  padding: 4px;
  border: 0;
  border-right: 1px solid #444;
  border-radius: 0;
  background: #181818f2;
  box-shadow: 3px 0 10px #0007;
}

#canvas-bar {
  padding-left: 61px;
}

.tool-kind-cluster {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: center;
  width: 45px;
}

.tool-option-flyout {
  display: grid;
  width: 45px;
  max-height: 0;
  gap: 2px;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-8px);
  visibility: hidden;
  transition: max-height 180ms ease, opacity 120ms ease, transform 180ms ease,
    visibility 0s linear 180ms;
}

.brush-kind-flyout {
  --option-accent: #63b3ed;
}

.fill-kind-flyout {
  --option-accent: #d6ad60;
}

.tool-kind-cluster:hover .tool-option-flyout,
.tool-kind-cluster.flyout-open .tool-option-flyout {
  margin-top: 3px;
  max-height: 190px;
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
  transition-delay: 0s;
}

.tool-option-button {
  position: relative;
  width: 45px;
  height: 42px;
  min-height: 42px;
  padding: 0;
  border-color: #52677a;
  border-radius: 4px;
  background: linear-gradient(#30404f, #1d2832);
  color: #d7e4ef;
  box-shadow: inset 0 1px 0 #ffffff24, inset 0 -2px 0 #0006, 0 1px 2px #0008;
}

.fill-kind-option {
  border-color: #746443;
  background: linear-gradient(#413925, #292318);
  color: #eadcbf;
}

.tool-option-button::before {
  content: '';
  position: absolute;
  left: 3px;
  top: 7px;
  bottom: 7px;
  width: 3px;
  border-radius: 2px;
  background: var(--option-accent, #63b3ed);
  box-shadow: 0 0 4px color-mix(in srgb, var(--option-accent, #63b3ed) 55%, transparent);
}

.tool-option-button:hover {
  border-color: #7aa4c8;
  background: linear-gradient(#3b5266, #263746);
}

.fill-kind-option:hover {
  border-color: #a88b53;
  background: linear-gradient(#52472d, #342b1c);
}

.tool-option-button .material-symbols-outlined,
.tool-option-button .material-symbols-rounded {
  font-size: 25px;
}

.material-symbols-rounded.filled-symbol {
  font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

.tool-option-button.active {
  color: #fff;
  border-color: #63b3ed;
  background: linear-gradient(#32699a, #234b70);
  box-shadow: inset 0 1px 0 #ffffff35, inset 0 -2px 0 #102d48, 0 0 0 1px #63b3ed55;
}

.fill-kind-option.active {
  border-color: #d6ad60;
  background: linear-gradient(#82652d, #5a441f);
  box-shadow: inset 0 1px 0 #ffffff2b, inset 0 -2px 0 #33230c, 0 0 0 1px #d6ad6055;
}

.kind-control-hidden {
  display: none !important;
}

.font-path-status {
  min-height: 16px;
  margin-top: 6px;
  color: #9fb7ca;
  font-size: 11px;
}

.font-path-status.error {
  color: #fc8181;
}

.canvas-tool-group-separator {
  position: relative;
  width: 34px;
  height: 13px;
  flex: 0 0 13px;
}

.canvas-tool-group-separator::after {
  content: '';
  position: absolute;
  left: 3px;
  right: 3px;
  top: 6px;
  height: 1px;
  background: #4b4b4b;
}

#canvas-bottom-bar {
  display: flex;
  flex: 0 0 34px;
  min-width: 0;
  align-items: center;
  border-top: 1px solid #3b3b3b;
  background: #181818;
}

#canvas-bottom-settings {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  align-items: center;
  gap: 2px;
  height: 100%;
  padding: 2px 5px;
  border-right: 1px solid #3b3b3b;
}

.canvas-bottom-actions-spacer {
  flex: 0 0 8px;
}

#canvas-bottom-settings #canvas-output-actions {
  flex: 0 0 auto;
  height: 100%;
  margin: 0 0 0 auto;
  padding-left: 5px;
  border-left: 1px solid #3b3b3b;
}

#canvas-bottom-settings .canvas-output-action {
  width: 34px;
  height: 29px;
  flex-basis: 34px;
  border: 0;
  background: transparent;
  color: #bbb;
}

#canvas-bottom-settings .canvas-output-action:hover {
  color: #fff;
  background: #315f91;
}

.canvas-bottom-setting {
  width: 34px;
  height: 29px;
  padding: 0;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: #bbb;
}

.canvas-bottom-setting:hover,
.canvas-bottom-setting[aria-expanded='true'] {
  color: #fff;
  background: #315f91;
}

.canvas-bottom-setting:disabled {
  color: #555;
  background: transparent;
}

#canvas-bottom-status {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  height: 100%;
  padding: 0 9px;
  border: 0;
  background: transparent;
}

#canvas-settings-popovers {
  position: absolute;
  left: 5px;
  bottom: 38px;
  z-index: 40;
  width: min(390px, calc(100% - 10px));
  max-height: calc(100% - 48px);
  pointer-events: none;
}

.canvas-settings-popover {
  display: none;
  max-height: min(480px, calc(100vh - 130px));
  overflow: auto;
  pointer-events: auto;
  border: 1px solid #595959;
  border-radius: 5px;
  background: #1c1c1c;
  box-shadow: 0 10px 30px #000c;
}

.canvas-settings-popover.open {
  display: block;
  animation: canvas-popover-in 120ms ease-out;
}

.canvas-settings-popover > .panel {
  width: 100%;
  margin: 0;
  border: 0;
  border-radius: 0;
}

.canvas-settings-popover > .panel.hidden {
  display: none !important;
}

@keyframes canvas-popover-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

#ui-button-tooltip {
  position: fixed;
  z-index: 5000;
  left: 0;
  top: 0;
  max-width: min(330px, calc(100vw - 16px));
  padding: 5px 7px;
  border: 1px solid #666;
  border-radius: 4px;
  background: #101010;
  color: #f2f2f2;
  box-shadow: 0 4px 14px #000b;
  font-size: 11px;
  line-height: 1.35;
  white-space: normal;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(2px);
  transition: opacity 80ms linear, transform 80ms ease, visibility 0s linear 80ms;
}

#ui-button-tooltip.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition-delay: 0s;
}

@media (prefers-reduced-motion: reduce) {
  .tool-option-flyout,
  #ui-button-tooltip {
    transition: none;
  }

  .canvas-settings-popover.open {
    animation: none;
  }
}
