/**
 * TXL Gen4 Design System - Badges
 * 
 * Composants badge pour labels et compteurs
 */

/* ============================================
   BADGE BASE
   ============================================ */

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.125rem 0.5rem;
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    line-height: var(--line-height-tight);
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: var(--radius-base);
    transition: all var(--transition-fast);
}

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

.badge-primary {
    background-color: var(--color-primary-500);
    color: var(--color-neutral-0);
}

.badge-secondary {
    background-color: var(--color-secondary-500);
    color: var(--color-neutral-0);
}

.badge-success {
    background-color: var(--color-success-500);
    color: var(--color-neutral-0);
}

.badge-warning {
    background-color: var(--color-warning-500);
    color: var(--color-neutral-900);
}

.badge-error {
    background-color: var(--color-error-500);
    color: var(--color-neutral-0);
}

.badge-info {
    background-color: var(--color-info-500);
    color: var(--color-neutral-0);
}

.badge-neutral {
    background-color: var(--color-neutral-200);
    color: var(--color-neutral-900);
}

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

.badge-outline-primary {
    background-color: transparent;
    border: 1px solid var(--color-primary-500);
    color: var(--color-primary-600);
}

.badge-outline-secondary {
    background-color: transparent;
    border: 1px solid var(--color-secondary-500);
    color: var(--color-secondary-600);
}

.badge-outline-success {
    background-color: transparent;
    border: 1px solid var(--color-success-500);
    color: var(--color-success-600);
}

.badge-outline-error {
    background-color: transparent;
    border: 1px solid var(--color-error-500);
    color: var(--color-error-600);
}

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

.badge-sm {
    padding: 0.0625rem 0.375rem;
    font-size: 0.625rem;
}

.badge-lg {
    padding: 0.25rem 0.75rem;
    font-size: var(--font-size-sm);
}

/* ============================================
   SHAPES
   ============================================ */

.badge-pill {
    border-radius: var(--radius-full);
}

.badge-square {
    border-radius: var(--radius-sm);
}

/* ============================================
   DOT BADGE
   ============================================ */

.badge-dot {
    position: relative;
    padding: 0;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: var(--radius-full);
}

.badge-dot-lg {
    width: 0.75rem;
    height: 0.75rem;
}

/* Dot avec animation pulse */
.badge-dot-pulse::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-full);
    background-color: currentColor;
    opacity: 0.5;
    animation: badge-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes badge-pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.5);
        opacity: 0;
    }
}

/* ============================================
   BADGE WITH ICON
   ============================================ */

.badge-with-icon {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-1);
}

.badge-icon {
    width: 1em;
    height: 1em;
}

/* ============================================
   DISMISSIBLE BADGE
   ============================================ */

.badge-dismissible {
    padding-right: var(--spacing-1);
}

.badge-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: var(--spacing-1);
    padding: 0;
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity var(--transition-fast);
}

.badge-close:hover {
    opacity: 1;
}

/* ============================================
   BADGE COUNTER
   ============================================ */

.badge-counter {
    min-width: 1.5rem;
    padding-left: 0.375rem;
    padding-right: 0.375rem;
}

/* ============================================
   POSITIONED BADGE
   ============================================ */

.position-badge {
    position: relative;
}

.position-badge .badge {
    position: absolute;
    top: 0;
    right: 0;
    transform: translate(50%, -50%);
}

.position-badge .badge-top-left {
    right: auto;
    left: 0;
    transform: translate(-50%, -50%);
}
