/**
 * @file
 * FlowDrop Button Component Styles
 */

.fd-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--fd-button-padding-y) var(--fd-button-padding-x);
  cursor: pointer;
  transition:
    background-color var(--fd-transition-fast),
    border-color var(--fd-transition-fast),
    color var(--fd-transition-fast),
    box-shadow var(--fd-transition-fast);
  text-decoration: none;
  border: var(--fd-border-width) solid transparent;
  border-radius: var(--fd-button-radius);
  font-family: inherit;
  font-size: var(--fd-button-font-size);
  font-weight: var(--fd-button-font-weight);
  line-height: 1.25;
  gap: var(--fd-space-2);
}

.fd-button:focus-visible {
  outline: 2px solid var(--fd-primary);
  outline-offset: 2px;
}

/* Icon */
.fd-button__icon {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
}

.fd-button__icon svg {
  width: 1.25rem;
  height: 1.25rem;
}

/* ========================================================================
 * VARIANTS
 * ======================================================================== */

/* Primary */
.fd-button--primary {
  color: var(--fd-button-primary-text);
  border-color: var(--fd-button-primary-border);
  background-color: var(--fd-button-primary-bg);
}

.fd-button--primary:hover:not(.fd-button--disabled) {
  background-color: var(--fd-button-primary-bg-hover);
}

.fd-button--primary:active:not(.fd-button--disabled) {
  background-color: var(--fd-button-primary-bg-active);
}

/* Secondary */
.fd-button--secondary {
  color: var(--fd-button-secondary-text);
  border-color: var(--fd-button-secondary-border);
  background-color: var(--fd-button-secondary-bg);
}

.fd-button--secondary:hover:not(.fd-button--disabled) {
  border-color: var(--fd-border-muted);
  background-color: var(--fd-button-secondary-bg-hover);
}

.fd-button--secondary:active:not(.fd-button--disabled) {
  background-color: var(--fd-button-secondary-bg-active);
}

/* Ghost */
.fd-button--ghost {
  color: var(--fd-button-ghost-text);
  border-color: transparent;
  background-color: var(--fd-button-ghost-bg);
}

.fd-button--ghost:hover:not(.fd-button--disabled) {
  background-color: var(--fd-button-ghost-bg-hover);
}

/* Danger */
.fd-button--danger {
  color: var(--fd-error-foreground);
  border-color: var(--fd-error);
  background-color: var(--fd-error);
}

.fd-button--danger:hover:not(.fd-button--disabled) {
  border-color: var(--fd-error-hover);
  background-color: var(--fd-error-hover);
}

.fd-button--danger:active:not(.fd-button--disabled) {
  border-color: var(--fd-error-hover);
  background-color: var(--fd-error-hover);
}

/* ========================================================================
 * SIZES
 * ======================================================================== */

.fd-button--sm {
  padding: var(--fd-space-1) var(--fd-space-3);
  font-size: var(--fd-text-xs);
}

.fd-button--sm .fd-button__icon svg {
  width: 1rem;
  height: 1rem;
}

.fd-button--lg {
  padding: var(--fd-space-3) var(--fd-space-6);
  font-size: var(--fd-text-base);
}

.fd-button--lg .fd-button__icon svg {
  width: 1.5rem;
  height: 1.5rem;
}

/* ========================================================================
 * STATES
 * ======================================================================== */

.fd-button--full-width {
  width: 100%;
}

.fd-button--disabled {
  cursor: not-allowed;
  pointer-events: none;
  opacity: 0.5;
}
