/**
 * Badge styles
 * @countermeasure/web-components/display/badge
 */

/* ============================================================================
   BADGE BASE
   ============================================================================ */
.cmm-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.1875rem 0.5rem;
  height: fit-content;
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.2;
  border-radius: 9999px;
  white-space: nowrap;
  transition: background-color var(--transition-fast);
}

/* ============================================================================
   BADGE VARIANTS
   ============================================================================ */
.cmm-badge--default {
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}

.cmm-badge--secondary {
  background-color: hsl(var(--secondary));
  color: hsl(var(--secondary-foreground));
}

.cmm-badge--outline {
  background-color: transparent;
  color: hsl(var(--foreground));
  border: 1px solid hsl(var(--border));
}

.cmm-badge--destructive {
  background-color: var(--color-error-bg);
  color: var(--color-error-text);
  border: 1px solid transparent;
}

.cmm-badge--success {
  background-color: var(--color-bg-emerald-10);
  color: var(--color-success-text);
  border: 1px solid transparent;
}

.cmm-badge--warning {
  background-color: var(--color-bg-amber-10);
  color: var(--color-warning-text);
  border: 1px solid transparent;
}

.cmm-badge--error,
.cmm-badge--danger {
  background-color: var(--color-bg-rose-10);
  color: var(--color-error-text);
  border: 1px solid transparent;
}

.cmm-badge--info {
  background-color: var(--color-bg-blue-10);
  color: var(--color-info-text);
  border: 1px solid transparent;
}

.cmm-badge--neutral {
  background-color: hsl(var(--muted) / 0.6);
  color: hsl(var(--muted-foreground));
  border: 1px solid transparent;
}

.cmm-badge--orange {
  background-color: var(--color-primary-alpha);
  color: var(--color-primary-text);
  border: 1px solid transparent;
}

.cmm-badge--blue {
  background-color: var(--color-bg-blue-10);
  color: var(--color-blue-text);
  border: 1px solid transparent;
}

.cmm-badge--violet {
  background-color: var(--color-bg-violet-10);
  color: var(--color-violet-text);
  border: 1px solid transparent;
}

.cmm-badge--amber {
  background-color: var(--color-bg-amber-10);
  color: var(--color-amber-text);
  border: 1px solid transparent;
}

.cmm-badge--emerald {
  background-color: var(--color-bg-emerald-10);
  color: var(--color-emerald-text);
  border: 1px solid transparent;
}

.cmm-badge--rose {
  background-color: var(--color-bg-rose-10);
  color: var(--color-rose-text);
  border: 1px solid transparent;
}

.cmm-badge--cyan {
  background-color: var(--color-bg-cyan-10);
  color: var(--color-cyan-text);
  border: 1px solid transparent;
}

/* ============================================================================
   BADGE SEVERITY
   ============================================================================ */
.cmm-badge--severity-critical {
  background-color: var(--color-bg-rose-10);
  color: var(--color-rose-text);
  border: 1px solid transparent;
}

.cmm-badge--severity-high {
  background-color: var(--color-primary-alpha);
  color: var(--color-primary-text);
  border: 1px solid transparent;
}

.cmm-badge--severity-medium {
  background-color: var(--color-bg-amber-10);
  color: var(--color-amber-text);
  border: 1px solid transparent;
}

.cmm-badge--severity-low {
  background-color: var(--color-bg-cyan-10);
  color: var(--color-cyan-text);
  border: 1px solid transparent;
}

.cmm-badge--severity-info {
  background-color: hsl(var(--muted) / 0.6);
  color: hsl(var(--muted-foreground));
  border: 1px solid transparent;
}

/* ============================================================================
   BADGE STATUS
   ============================================================================ */
.cmm-badge--status-active {
  background-color: var(--color-bg-emerald-10);
  color: var(--color-emerald-text);
  border: 1px solid transparent;
}

.cmm-badge--status-inactive {
  background-color: hsl(var(--muted) / 0.6);
  color: hsl(var(--muted-foreground));
  border: 1px solid transparent;
}

.cmm-badge--status-pending {
  background-color: var(--color-bg-amber-10);
  color: var(--color-amber-text);
  border: 1px solid transparent;
}

.cmm-badge--status-error {
  background-color: var(--color-bg-rose-10);
  color: var(--color-rose-text);
  border: 1px solid transparent;
}

/* ============================================================================
   BADGE DOT
   ============================================================================ */
.cmm-badge__dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: currentColor;
  flex-shrink: 0;
}

/* ============================================================================
   BADGE REMOVE BUTTON
   ============================================================================ */
.cmm-badge__remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  padding: 0;
  margin-left: 0.125rem;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: currentColor;
  opacity: 0.6;
  cursor: pointer;
  font-size: 0.875rem;
  line-height: 1;
  transition: opacity var(--transition-fast);
}

.cmm-badge__remove:hover {
  opacity: 1;
}

.cmm-badge__remove:focus-visible {
  outline: 2px solid hsl(var(--focus-ring));
  outline-offset: 2px;
}
