/* Pill-shaped Material buttons. Default is tonal; --primary is the filled action; --quiet is a text button. */
.ez_button {
  --ez-button-bg: var(--ez-color-brand-container);
  --ez-button-fg: var(--ez-color-on-brand-container);
  --ez-button-border: transparent;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--ez-space-2);
  min-block-size: var(--ez-button-height);
  padding: var(--ez-space-2) var(--ez-space-5);
  background: var(--ez-button-bg);
  color: var(--ez-button-fg);
  border: 1px solid var(--ez-button-border);
  border-radius: var(--ez-radius-pill);
  font-size: var(--ez-font-size-sm);
  font-weight: var(--ez-font-weight-medium);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: filter var(--ez-duration-fast), box-shadow var(--ez-duration-fast);
}

.ez_button:hover {
  filter: brightness(0.94);
  box-shadow: var(--ez-shadow-sm);
}

.ez_button:active {
  filter: brightness(0.88);
}

.ez_button--primary {
  --ez-button-bg: var(--ez-color-action-primary);
  --ez-button-fg: var(--ez-color-on-action-primary);
}

.ez_button--outlined {
  --ez-button-bg: transparent;
  --ez-button-fg: var(--ez-color-text-primary);
  --ez-button-border: var(--ez-color-border);
}

.ez_button--danger {
  --ez-button-bg: var(--ez-color-danger-container);
  --ez-button-fg: var(--ez-color-on-danger-container);
}

.ez_button--quiet {
  --ez-button-bg: transparent;
  --ez-button-fg: var(--ez-color-link);
  padding-inline: var(--ez-space-3);
}

.ez_button--quiet:hover {
  background: var(--ez-color-surface-container-high);
  box-shadow: none;
}

.ez_button--small {
  min-block-size: 2rem;
  padding: var(--ez-space-1) var(--ez-space-4);
  font-size: var(--ez-font-size-xs);
}

.ez_button--block {
  inline-size: 100%;
}

.ez_button:disabled,
.ez_button[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
  filter: none;
  box-shadow: none;
}

/* Round icon-only button (theme toggle, sidebar collapse) */
.ez_icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  inline-size: 2.5rem;
  block-size: 2.5rem;
  padding: 0;
  background: transparent;
  color: var(--ez-color-text-muted);
  border: 0;
  border-radius: var(--ez-radius-pill);
  cursor: pointer;
  transition: background var(--ez-duration-fast), color var(--ez-duration-fast);
}

.ez_icon-button:hover {
  background: var(--ez-color-surface-container-high);
  color: var(--ez-color-text-primary);
}

/* htmx adds this class to the requesting element while a request is in flight. */
.ez_button.ez_is-loading {
  cursor: progress;
  opacity: 0.7;
}

/* Icon-only button: the label lives in data-tip, shown at once on hover or keyboard focus, and in aria-label. */
.ez_button--icon {
  inline-size: 2.5rem;
  min-inline-size: 2.5rem;
  padding: 0;
  justify-content: center;
}

.ez_tip {
  position: fixed;
  z-index: 200;
  padding: var(--ez-space-1) var(--ez-space-2);
  border-radius: var(--ez-radius-sm);
  background: var(--ez-color-text-primary);
  color: var(--ez-color-surface);
  font-size: var(--ez-font-size-xs);
  font-weight: var(--ez-font-weight-medium);
  white-space: nowrap;
  pointer-events: none;
}

.ez_tip[hidden] {
  display: none;
}

.ez_button[hidden] {
  display: none;
}
