/**
 * @file
 * FlowDrop Pill Component Styles
 *
 * A versatile pill/tag component for status flags, state flags, labels, and tags.
 * Supports multiple styles (filled, outlined, ghost, soft), sizes, and variants.
 */

/* ========================================================================
 * BASE PILL STYLES
 * ======================================================================== */

.fd-pill {
  display: inline-flex;
  align-items: center;
  padding: var(--fd-pill-padding-y) var(--fd-pill-padding-x);
  transition:
    background-color var(--fd-transition-fast),
    border-color var(--fd-transition-fast),
    color var(--fd-transition-fast),
    box-shadow var(--fd-transition-fast);
  white-space: nowrap;
  text-decoration: none;
  border: var(--fd-pill-border-width, 1px) solid transparent;
  font-family: var(--fd-font-family-sans);
  font-size: var(--fd-pill-font-size);
  font-weight: var(--fd-pill-font-weight, var(--fd-font-weight-medium));
  line-height: 1;
  gap: var(--fd-pill-gap, var(--fd-space-1));
}

/* Remove default link styles */
a.fd-pill {
  text-decoration: none;
}

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

/* Fully rounded pill shape (default) */
.fd-pill--rounded {
  border-radius: var(--fd-radius-full);
}

/* Soft rounded corners */
.fd-pill--soft-corners {
  border-radius: var(--fd-radius-md);
}

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

/* Extra Small */
.fd-pill--size-xs {
  --fd-pill-padding-x: var(--fd-space-2);
  --fd-pill-padding-y: 0.125rem;
  --fd-pill-font-size: 0.625rem;
  --fd-pill-gap: 0.125rem;
}

/* Small */
.fd-pill--size-sm {
  --fd-pill-padding-x: var(--fd-space-2);
  --fd-pill-padding-y: 0.25rem;
  --fd-pill-font-size: var(--fd-text-xs);
  --fd-pill-gap: var(--fd-space-1);
}

/* Medium (default) */
.fd-pill--size-md {
  --fd-pill-padding-x: var(--fd-space-3);
  --fd-pill-padding-y: var(--fd-space-1);
  --fd-pill-font-size: var(--fd-text-sm);
  --fd-pill-gap: var(--fd-space-1);
}

/* Large */
.fd-pill--size-lg {
  --fd-pill-padding-x: var(--fd-space-4);
  --fd-pill-padding-y: var(--fd-space-2);
  --fd-pill-font-size: var(--fd-text-base);
  --fd-pill-gap: var(--fd-space-2);
}

/* ========================================================================
 * TEXT TRANSFORM
 * ======================================================================== */

.fd-pill--uppercase {
  letter-spacing: var(--fd-letter-spacing-wide);
  text-transform: uppercase;
}

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

.fd-pill--interactive {
  cursor: pointer;
}

.fd-pill--interactive:hover {
  filter: brightness(0.95);
}

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

.fd-pill--interactive:active {
  filter: brightness(0.9);
}

/* ========================================================================
 * STYLE VARIANTS: SOFT (default - subtle background, darker text)
 * ======================================================================== */

/* Primary - Soft */
.fd-pill--primary.fd-pill--style-soft {
  color: var(--fd-primary-hover);
  background-color: var(--fd-primary-muted);
}

/* Secondary - Soft */
.fd-pill--secondary.fd-pill--style-soft {
  color: var(--fd-foreground);
  background-color: var(--fd-subtle);
}

/* Success - Soft */
.fd-pill--success.fd-pill--style-soft {
  color: var(--fd-success-hover);
  background-color: var(--fd-success-muted);
}

/* Warning - Soft */
.fd-pill--warning.fd-pill--style-soft {
  color: var(--fd-warning-hover);
  background-color: var(--fd-warning-muted);
}

/* Error - Soft */
.fd-pill--error.fd-pill--style-soft {
  color: var(--fd-error-hover);
  background-color: var(--fd-error-muted);
}

/* Info - Soft */
.fd-pill--info.fd-pill--style-soft {
  color: var(--fd-info);
  background-color: var(--fd-info-muted);
}

/* Neutral - Soft */
.fd-pill--neutral.fd-pill--style-soft {
  color: var(--fd-muted-foreground);
  background-color: var(--fd-subtle);
}

/* ========================================================================
 * STYLE VARIANTS: FILLED (solid background, white text)
 * ======================================================================== */

/* Primary - Filled */
.fd-pill--primary.fd-pill--style-filled {
  color: #fff;
  background-color: var(--fd-primary);
}

/* Secondary - Filled */
.fd-pill--secondary.fd-pill--style-filled {
  color: #fff;
  background-color: var(--fd-muted-foreground);
}

/* Success - Filled */
.fd-pill--success.fd-pill--style-filled {
  color: #fff;
  background-color: var(--fd-success);
}

/* Warning - Filled */
.fd-pill--warning.fd-pill--style-filled {
  color: #fff;
  background-color: var(--fd-warning);
}

/* Error - Filled */
.fd-pill--error.fd-pill--style-filled {
  color: #fff;
  background-color: var(--fd-error);
}

/* Info - Filled */
.fd-pill--info.fd-pill--style-filled {
  color: #fff;
  background-color: var(--fd-info);
}

/* Neutral - Filled */
.fd-pill--neutral.fd-pill--style-filled {
  color: #fff;
  background-color: var(--fd-muted-foreground);
}

/* ========================================================================
 * STYLE VARIANTS: OUTLINED (border, transparent background)
 * ======================================================================== */

/* Primary - Outlined */
.fd-pill--primary.fd-pill--style-outlined {
  color: var(--fd-primary-hover);
  border-color: var(--fd-primary);
  background-color: transparent;
}

/* Secondary - Outlined */
.fd-pill--secondary.fd-pill--style-outlined {
  color: var(--fd-muted-foreground);
  border-color: var(--fd-border-muted);
  background-color: transparent;
}

/* Success - Outlined */
.fd-pill--success.fd-pill--style-outlined {
  color: var(--fd-success-hover);
  border-color: var(--fd-success);
  background-color: transparent;
}

/* Warning - Outlined */
.fd-pill--warning.fd-pill--style-outlined {
  color: var(--fd-warning-hover);
  border-color: var(--fd-warning);
  background-color: transparent;
}

/* Error - Outlined */
.fd-pill--error.fd-pill--style-outlined {
  color: var(--fd-error-hover);
  border-color: var(--fd-error);
  background-color: transparent;
}

/* Info - Outlined */
.fd-pill--info.fd-pill--style-outlined {
  color: var(--fd-info);
  border-color: var(--fd-info);
  background-color: transparent;
}

/* Neutral - Outlined */
.fd-pill--neutral.fd-pill--style-outlined {
  color: var(--fd-muted-foreground);
  border-color: var(--fd-border-muted);
  background-color: transparent;
}

/* ========================================================================
 * STYLE VARIANTS: GHOST (minimal, transparent)
 * ======================================================================== */

/* Primary - Ghost */
.fd-pill--primary.fd-pill--style-ghost {
  color: var(--fd-primary-hover);
  background-color: transparent;
}

.fd-pill--primary.fd-pill--style-ghost.fd-pill--interactive:hover {
  background-color: var(--fd-primary-muted);
}

/* Secondary - Ghost */
.fd-pill--secondary.fd-pill--style-ghost {
  color: var(--fd-muted-foreground);
  background-color: transparent;
}

.fd-pill--secondary.fd-pill--style-ghost.fd-pill--interactive:hover {
  background-color: var(--fd-subtle);
}

/* Success - Ghost */
.fd-pill--success.fd-pill--style-ghost {
  color: var(--fd-success-hover);
  background-color: transparent;
}

.fd-pill--success.fd-pill--style-ghost.fd-pill--interactive:hover {
  background-color: var(--fd-success-muted);
}

/* Warning - Ghost */
.fd-pill--warning.fd-pill--style-ghost {
  color: var(--fd-warning-hover);
  background-color: transparent;
}

.fd-pill--warning.fd-pill--style-ghost.fd-pill--interactive:hover {
  background-color: var(--fd-warning-muted);
}

/* Error - Ghost */
.fd-pill--error.fd-pill--style-ghost {
  color: var(--fd-error-hover);
  background-color: transparent;
}

.fd-pill--error.fd-pill--style-ghost.fd-pill--interactive:hover {
  background-color: var(--fd-error-muted);
}

/* Info - Ghost */
.fd-pill--info.fd-pill--style-ghost {
  color: var(--fd-info);
  background-color: transparent;
}

.fd-pill--info.fd-pill--style-ghost.fd-pill--interactive:hover {
  background-color: var(--fd-info-muted);
}

/* Neutral - Ghost */
.fd-pill--neutral.fd-pill--style-ghost {
  color: var(--fd-muted-foreground);
  background-color: transparent;
}

.fd-pill--neutral.fd-pill--style-ghost.fd-pill--interactive:hover {
  background-color: var(--fd-subtle);
}

/* ========================================================================
 * BRAND COLOR VARIANTS (from FlowDrop logo)
 * ======================================================================== */

/* Brand Droplet (Blue) - Soft */
.fd-pill--brand-droplet.fd-pill--style-soft {
  color: var(--fd-brand-droplet);
  background-color: color-mix(in sRGB, var(--fd-brand-droplet) 15%, transparent);
}

.fd-pill--brand-droplet.fd-pill--style-filled {
  color: #fff;
  background-color: var(--fd-brand-droplet);
}

.fd-pill--brand-droplet.fd-pill--style-outlined {
  color: var(--fd-brand-droplet);
  border-color: var(--fd-brand-droplet);
  background-color: transparent;
}

.fd-pill--brand-droplet.fd-pill--style-ghost {
  color: var(--fd-brand-droplet);
  background-color: transparent;
}

/* Brand Red - Soft */
.fd-pill--brand-red.fd-pill--style-soft {
  color: var(--fd-brand-node-red);
  background-color: color-mix(in sRGB, var(--fd-brand-node-red) 15%, transparent);
}

.fd-pill--brand-red.fd-pill--style-filled {
  color: #fff;
  background-color: var(--fd-brand-node-red);
}

.fd-pill--brand-red.fd-pill--style-outlined {
  color: var(--fd-brand-node-red);
  border-color: var(--fd-brand-node-red);
  background-color: transparent;
}

.fd-pill--brand-red.fd-pill--style-ghost {
  color: var(--fd-brand-node-red);
  background-color: transparent;
}

/* Brand Purple - Soft */
.fd-pill--brand-purple.fd-pill--style-soft {
  color: #6b5b95;
  background-color: color-mix(in sRGB, var(--fd-brand-node-purple) 30%, transparent);
}

.fd-pill--brand-purple.fd-pill--style-filled {
  color: #4a3d6e;
  background-color: var(--fd-brand-node-purple);
}

.fd-pill--brand-purple.fd-pill--style-outlined {
  color: #6b5b95;
  border-color: var(--fd-brand-node-purple);
  background-color: transparent;
}

.fd-pill--brand-purple.fd-pill--style-ghost {
  color: #6b5b95;
  background-color: transparent;
}

/* Brand Yellow - Soft */
.fd-pill--brand-yellow.fd-pill--style-soft {
  color: #946c00;
  background-color: color-mix(in sRGB, var(--fd-brand-node-yellow) 20%, transparent);
}

.fd-pill--brand-yellow.fd-pill--style-filled {
  color: #1a1a1a;
  background-color: var(--fd-brand-node-yellow);
}

.fd-pill--brand-yellow.fd-pill--style-outlined {
  color: #946c00;
  border-color: var(--fd-brand-node-yellow);
  background-color: transparent;
}

.fd-pill--brand-yellow.fd-pill--style-ghost {
  color: #946c00;
  background-color: transparent;
}

/* ========================================================================
 * ICON STYLES
 * ======================================================================== */

.fd-pill__icon {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
}

.fd-pill--size-xs .fd-pill__icon {
  font-size: 0.625rem;
}

.fd-pill--size-sm .fd-pill__icon {
  font-size: 0.75rem;
}

.fd-pill--size-md .fd-pill__icon {
  font-size: 0.875rem;
}

.fd-pill--size-lg .fd-pill__icon {
  font-size: 1rem;
}

/* ========================================================================
 * LABEL STYLES
 * ======================================================================== */

.fd-pill__label {
  display: inline-block;
}

/* ========================================================================
 * DISMISS BUTTON STYLES
 * ======================================================================== */

.fd-pill__dismiss {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: var(--fd-space-1);
  padding: 0;
  cursor: pointer;
  transition:
    opacity var(--fd-transition-fast),
    background-color var(--fd-transition-fast);
  opacity: 0.7;
  border: none;
  border-radius: var(--fd-radius-full);
  background: transparent;
}

.fd-pill__dismiss:hover {
  opacity: 1;
  background-color: rgb(0, 0, 0, 0.1);
}

.fd-pill__dismiss:focus-visible {
  opacity: 1;
  outline: 2px solid currentColor;
  outline-offset: 1px;
}

.fd-pill__dismiss-icon {
  width: 0.75em;
  height: 0.75em;
}

.fd-pill--size-xs .fd-pill__dismiss-icon {
  width: 0.5em;
  height: 0.5em;
}

.fd-pill--size-lg .fd-pill__dismiss-icon {
  width: 1em;
  height: 1em;
}

/* ========================================================================
 * PILL GROUP UTILITY
 * Use .fd-pill-group to wrap multiple pills with proper spacing
 * ======================================================================== */

.fd-pill-group {
  display: inline-flex;
  flex-wrap: wrap;
  gap: var(--fd-space-2);
  align-items: center;
}

/* Compact variant for tighter spacing */
.fd-pill-group--compact {
  gap: var(--fd-space-1);
}

/* Vertical stack variant */
.fd-pill-group--vertical {
  flex-direction: column;
  align-items: flex-start;
}
