/* ==========================================================================
   Badges Stylesheet (Standalone)
   Independent badge system strictly using global color tokens from global.css
   ========================================================================== */

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.1875rem 0.5rem;
    font-family: var(--font-regular);
    font-size: 0.82em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    line-height: 1.2;
    white-space: nowrap;
    user-select: none;
    vertical-align: middle;
    box-sizing: border-box;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

/* --------------------------------------------------------------------------
   Badge Sizes
   -------------------------------------------------------------------------- */
.badge-small {
    padding: 0.125rem 0.375rem;
    font-size: 0.72em;
}

.badge-medium {
    padding: 0.1875rem 0.5rem;
    font-size: 0.82em;
}

.badge-large {
    padding: 0.3125rem 0.75rem;
    font-size: 0.95em;
}

/* --------------------------------------------------------------------------
   Badge Color Variants
   Strictly using global tokens and established semantic accents
   -------------------------------------------------------------------------- */
.badge-blue {
    background: var(--clr-secondary-subtle);
    color: var(--clr-secondary-main);
    border: 1px solid rgba(14, 116, 144, 0.4);
}

.badge-green {
    background: rgba(16, 185, 129, 0.15);
    color: var(--clr-status-success-text);
    border: 1px solid rgba(16, 185, 129, 0.4);
}

.badge-orange {
    background: var(--clr-primary-subtle);
    color: var(--clr-primary-text);
    border: 1px solid rgba(255, 107, 0, 0.4);
}

.badge-red {
    background: rgba(220, 38, 38, 0.15);
    color: var(--clr-status-danger);
    border: 1px solid rgba(220, 38, 38, 0.4);
}

.badge-gray,
.badge-dark {
    background: var(--clr-surface-dark);
    color: var(--clr-text-muted);
    border: 1px solid var(--clr-border-light);
}

/* Stufe einer Bewertung (C bis S+): farbige Fläche mit Schrift statt farbigem Text, weil gelbe
   Schrift auf hellem Grund kaum lesbar wäre. Die Farbe kommt aus `rating_tiers.json` und steht
   als berechneter Wert am Element (`RatingTiers.badgeHtml()`); `.is-light` wählt helle Schrift. */
.badge-tier {
    min-width: 2.1em;
    padding: 0.125rem 0.4rem;
    border: 0;
    font-family: var(--font-narrow);
    font-size: 1em;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: var(--clr-text-primary);
}

.badge-tier.is-light {
    color: var(--clr-text-light);
}

/* Pulsing Badge Variant (e.g. for pending states) */
.badge-pulse {
    animation: badgePulseGlow 2s infinite ease-in-out;
}

@keyframes badgePulseGlow {
    0%, 100% {
        opacity: 0.85;
    }
    50% {
        opacity: 1;
    }
}
