/* Badges CSS - Badge component variants */

/* ============================================
   Base Badge
   ============================================ */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.125rem 0.625rem;
    font-size: var(--text-xs);
    font-weight: 500;
    line-height: 1.4;
    border-radius: 9999px;
    white-space: nowrap;
    transition: all var(--transition-fast) ease-in-out;
}

.badge svg,
.badge .icon {
    width: 0.75rem;
    height: 0.75rem;
}

/* ============================================
   Badge Variants
   ============================================ */

/* Default */
.badge-default {
    background-color: hsl(var(--foreground));
    color: hsl(var(--background));
}

/* Primary */
.badge-primary {
    background-color: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
}

.badge-primary-outline {
    background-color: transparent;
    color: hsl(var(--primary));
    border: 1px solid hsl(var(--primary));
}

.badge-primary-soft {
    background-color: hsl(var(--primary) / 0.1);
    color: hsl(var(--primary));
}

/* Secondary */
.badge-secondary {
    background-color: hsl(var(--secondary));
    color: hsl(var(--secondary-foreground));
}

.badge-secondary-outline {
    background-color: transparent;
    color: hsl(var(--secondary));
    border: 1px solid hsl(var(--secondary));
}

.badge-secondary-soft {
    background-color: hsl(var(--secondary) / 0.1);
    color: hsl(var(--secondary));
}

/* Success */
.badge-success {
    background-color: hsl(var(--success));
    color: hsl(var(--success-foreground));
}

.badge-success-outline {
    background-color: transparent;
    color: hsl(var(--success));
    border: 1px solid hsl(var(--success));
}

.badge-success-soft {
    background-color: hsl(var(--success) / 0.1);
    color: hsl(var(--success));
}

/* Warning */
.badge-warning {
    background-color: hsl(var(--warning));
    color: hsl(var(--warning-foreground));
}

.badge-warning-outline {
    background-color: transparent;
    color: hsl(var(--warning));
    border: 1px solid hsl(var(--warning));
}

.badge-warning-soft {
    background-color: hsl(var(--warning) / 0.1);
    color: hsl(var(--warning));
}

/* Destructive / Error */
.badge-destructive,
.badge-error {
    background-color: hsl(var(--destructive));
    color: hsl(var(--destructive-foreground));
}

.badge-destructive-outline,
.badge-error-outline {
    background-color: transparent;
    color: hsl(var(--destructive));
    border: 1px solid hsl(var(--destructive));
}

.badge-destructive-soft,
.badge-error-soft {
    background-color: hsl(var(--destructive) / 0.1);
    color: hsl(var(--destructive));
}

/* Info */
.badge-info {
    background-color: hsl(var(--info));
    color: hsl(var(--info-foreground));
}

.badge-info-outline {
    background-color: transparent;
    color: hsl(var(--info));
    border: 1px solid hsl(var(--info));
}

.badge-info-soft {
    background-color: hsl(var(--info) / 0.1);
    color: hsl(var(--info));
}

/* Muted */
.badge-muted {
    background-color: hsl(var(--muted));
    color: hsl(var(--muted-foreground));
}

.badge-muted-outline {
    background-color: transparent;
    color: hsl(var(--muted-foreground));
    border: 1px solid hsl(var(--border));
}

/* Outline (generic) */
.badge-outline {
    background-color: transparent;
    color: hsl(var(--foreground));
    border: 1px solid hsl(var(--border));
}

/* ============================================
   Badge Sizes
   ============================================ */
.badge-sm {
    padding: 0 0.5rem;
    font-size: 0.65rem;
}

.badge-lg {
    padding: 0.25rem 0.75rem;
    font-size: var(--text-sm);
}

/* ============================================
   Badge Shapes
   ============================================ */
.badge-square {
    border-radius: calc(var(--radius) - 2px);
}

.badge-rounded {
    border-radius: var(--radius);
}

/* ============================================
   Badge with Dot
   ============================================ */
.badge-dot {
    position: relative;
    padding-left: 1rem;
}

.badge-dot::before {
    content: "";
    position: absolute;
    left: 0.375rem;
    top: 50%;
    transform: translateY(-50%);
    width: 0.375rem;
    height: 0.375rem;
    border-radius: 50%;
    background-color: currentColor;
}

/* ============================================
   Status Badges (common use cases)
   ============================================ */
.badge-status-active {
    background-color: hsl(var(--success) / 0.1);
    color: hsl(var(--success));
}

.badge-status-inactive {
    background-color: hsl(var(--muted));
    color: hsl(var(--muted-foreground));
}

.badge-status-pending {
    background-color: hsl(var(--warning) / 0.1);
    color: hsl(var(--warning));
}

.badge-status-new {
    background-color: hsl(var(--info) / 0.1);
    color: hsl(var(--info));
}

.badge-status-error {
    background-color: hsl(var(--destructive) / 0.1);
    color: hsl(var(--destructive));
}

/* ============================================
   Removable Badge
   ============================================ */
.badge-removable {
    padding-right: 0.25rem;
}

.badge-remove-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1rem;
    height: 1rem;
    margin-left: 0.25rem;
    padding: 0;
    border: none;
    background-color: transparent;
    color: inherit;
    opacity: 0.7;
    cursor: pointer;
    border-radius: 50%;
    transition: all var(--transition-fast) ease-in-out;
}

.badge-remove-btn:hover {
    opacity: 1;
    background-color: rgba(0, 0, 0, 0.1);
}

.badge-remove-btn svg,
.badge-remove-btn .icon {
    width: 0.625rem;
    height: 0.625rem;
}

/* ============================================
   Badge Group
   ============================================ */
.badge-group {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

/* ============================================
   Notification Badge (count)
   ============================================ */
.badge-count {
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.375rem;
    font-size: 0.625rem;
    font-weight: 600;
    border-radius: 9999px;
}

.badge-count-sm {
    min-width: 1rem;
    height: 1rem;
    padding: 0 0.25rem;
    font-size: 0.5rem;
}

/* Position helper for notification badges */
.badge-position {
    position: relative;
    display: inline-flex;
}

.badge-position .badge-count {
    position: absolute;
    top: -0.375rem;
    right: -0.375rem;
}
