
.ui-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.375rem;
    transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    text-decoration: none;
    border: none;
    font-family: inherit;
    cursor: default;
}

.badge-xs {
    padding: 0.125rem 0.25rem;
    font-size: 0.625rem;
    border-radius: 0.25rem;
}

.badge-sm {
    padding: 0.25rem 0.375rem;
    font-size: 0.75rem;
    border-radius: 0.25rem;
}

.badge-md {
    padding: 0.375rem 0.5rem;
    font-size: 0.875rem;
    border-radius: 0.375rem;
}

.badge-lg {
    padding: 0.5rem 0.75rem;
    font-size: 1rem;
    border-radius: 0.375rem;
}

.badge-xl {
    padding: 0.625rem 1rem;
    font-size: 1.125rem;
    border-radius: 0.5rem;
}

.badge-xxl {
    padding: 0.75rem 1.25rem;
    font-size: 1.25rem;
    border-radius: 0.5rem;
}

/* Badge Shapes */
.badge-rounded {
    border-radius: 0.375rem;
}

.badge-pill {
    border-radius: 50rem;
}

.badge-square {
    border-radius: 0;
}

/* Badge Colors - Solid */
.badge-primary {
    color: #fff;
    background-color: #0d6efd;
}

.badge-secondary {
    color: #fff;
    background-color: #6c757d;
}

.badge-success {
    color: #fff;
    background-color: #198754;
}

.badge-danger {
    color: #fff;
    background-color: #dc3545;
}

.badge-warning {
    color: #000;
    background-color: #ffc107;
}

.badge-info {
    color: #000;
    background-color: #0dcaf0;
}

.badge-light {
    color: #000;
    background-color: #f8f9fa;
}

.badge-dark {
    color: #fff;
    background-color: #212529;
}

.badge-muted {
    color: #fff;
    background-color: #6c757d;
}

.badge-white {
    color: #000;
    background-color: #fff;
    border: 1px solid #dee2e6;
}

/* Badge Colors - Outline */
.badge-outline-primary {
    color: #0d6efd;
    background-color: transparent;
    border: 1px solid #0d6efd;
}

.badge-outline-secondary {
    color: #6c757d;
    background-color: transparent;
    border: 1px solid #6c757d;
}

.badge-outline-success {
    color: #198754;
    background-color: transparent;
    border: 1px solid #198754;
}

.badge-outline-danger {
    color: #dc3545;
    background-color: transparent;
    border: 1px solid #dc3545;
}

.badge-outline-warning {
    color: #ffc107;
    background-color: transparent;
    border: 1px solid #ffc107;
}

.badge-outline-info {
    color: #0dcaf0;
    background-color: transparent;
    border: 1px solid #0dcaf0;
}

.badge-outline-light {
    color: #f8f9fa;
    background-color: transparent;
    border: 1px solid #f8f9fa;
}

.badge-outline-dark {
    color: #212529;
    background-color: transparent;
    border: 1px solid #212529;
}

/* Badge Colors - Soft */
.badge-soft-primary {
    color: #0d6efd;
    background-color: rgba(13, 110, 253, 0.1);
}

.badge-soft-secondary {
    color: #6c757d;
    background-color: rgba(108, 117, 125, 0.1);
}

.badge-soft-success {
    color: #198754;
    background-color: rgba(25, 135, 84, 0.1);
}

.badge-soft-danger {
    color: #dc3545;
    background-color: rgba(220, 53, 69, 0.1);
}

.badge-soft-warning {
    color: #ffc107;
    background-color: rgba(255, 193, 7, 0.1);
}

.badge-soft-info {
    color: #0dcaf0;
    background-color: rgba(13, 202, 240, 0.1);
}

.badge-soft-light {
    color: #f8f9fa;
    background-color: rgba(248, 249, 250, 0.1);
}

.badge-soft-dark {
    color: #212529;
    background-color: rgba(33, 37, 41, 0.1);
}

/* Interactive States */
.badge-clickable {
    cursor: pointer;
    transition: all 0.2s ease;
}

.badge-clickable:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.badge-hoverable:hover {
    transform: scale(1.05);
    transition: transform 0.2s ease;
}

/* Special Effects */
.badge-pulse {
    animation: badge-pulse 1.5s infinite;
}

@keyframes badge-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.badge-glow {
    box-shadow: 0 0 10px currentColor, 0 0 20px currentColor;
}

.badge-shadow-sm {
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.badge-shadow-md {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.badge-shadow-lg {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Floating Badges */
.badge-floating {
    position: absolute;
    z-index: 10;
}

.badge-floating-top-left {
    top: -0.5rem;
    left: -0.5rem;
}

.badge-floating-top-right {
    top: -0.5rem;
    right: -0.5rem;
}

.badge-floating-bottom-left {
    bottom: -0.5rem;
    left: -0.5rem;
}

.badge-floating-bottom-right {
    bottom: -0.5rem;
    right: -0.5rem;
}

/* Badge Content Types */
.badge-icon-only {
    padding: 0.375rem;
    aspect-ratio: 1;
    min-width: auto;
}

.badge-text-only {
    /* Default styling, no special changes */
}

/* Dismissible Badges */
.badge-dismissible .btn-close {
    font-size: 0.75em;
    opacity: 0.8;
    margin-left: 0.25rem;
    background: none;
    border: none;
    color: inherit;
    padding: 0;
    line-height: 1;
}

.badge-dismissible .btn-close:hover {
    opacity: 1;
}

/* Link Badges */
a.ui-badge {
    text-decoration: none;
    cursor: pointer;
}

a.ui-badge:hover {
    filter: brightness(1.1);
}

/* Button Badges */
button.ui-badge {
    border: none;
    background: inherit;
    cursor: pointer;
}

button.ui-badge:focus {
    outline: 2px solid rgba(13, 110, 253, 0.5);
    outline-offset: 2px;
}

/* Badge with Border */
.badge-bordered {
    border: 1px solid currentColor;
}

/* Responsive adjustments */
@media (max-width: 576px) {
    .badge-lg {
        padding: 0.375rem 0.5rem;
        font-size: 0.875rem;
    }
    
    .badge-xl {
        padding: 0.5rem 0.75rem;
        font-size: 1rem;
    }
    
    .badge-xxl {
        padding: 0.625rem 1rem;
        font-size: 1.125rem;
    }
}

/* Icon spacing in badges */
.ui-badge i {
    font-size: 0.875em;
}

.ui-badge .me-1 {
    margin-right: 0.25rem !important;
}

.ui-badge .ms-1 {
    margin-left: 0.25rem !important;
}

/* Dark theme support with higher specificity */
[data-theme="dark"] .ui-badge,
.dark .ui-badge,
body.dark .ui-badge,
body[data-theme="dark"] .ui-badge {
    border-color: #4a5568;
}

/* Dark theme solid colors */
[data-theme="dark"] .badge-primary,
.dark .badge-primary,
body.dark .badge-primary,
body[data-theme="dark"] .badge-primary {
    background-color: #63b3ed !important;
    color: #1a202c !important;
}

[data-theme="dark"] .badge-secondary,
.dark .badge-secondary,
body.dark .badge-secondary,
body[data-theme="dark"] .badge-secondary {
    background-color: #4a5568 !important;
    color: #e2e8f0 !important;
}

[data-theme="dark"] .badge-success,
.dark .badge-success,
body.dark .badge-success,
body[data-theme="dark"] .badge-success {
    background-color: #68d391 !important;
    color: #1a202c !important;
}

[data-theme="dark"] .badge-danger,
.dark .badge-danger,
body.dark .badge-danger,
body[data-theme="dark"] .badge-danger {
    background-color: #fc8181 !important;
    color: #1a202c !important;
}

[data-theme="dark"] .badge-warning,
.dark .badge-warning,
body.dark .badge-warning,
body[data-theme="dark"] .badge-warning {
    background-color: #f6e05e !important;
    color: #1a202c !important;
}

[data-theme="dark"] .badge-info,
.dark .badge-info,
body.dark .badge-info,
body[data-theme="dark"] .badge-info {
    background-color: #63b3ed !important;
    color: #1a202c !important;
}

[data-theme="dark"] .badge-light,
.dark .badge-light,
body.dark .badge-light,
body[data-theme="dark"] .badge-light {
    background-color: #e2e8f0 !important;
    color: #1a202c !important;
}

[data-theme="dark"] .badge-dark,
.dark .badge-dark,
body.dark .badge-dark,
body[data-theme="dark"] .badge-dark {
    background-color: #2d3748 !important;
    color: #e2e8f0 !important;
}

[data-theme="dark"] .badge-white,
.dark .badge-white,
body.dark .badge-white,
body[data-theme="dark"] .badge-white {
    background-color: #f7fafc !important;
    color: #1a202c !important;
    border-color: #4a5568 !important;
}

/* Dark theme outline colors */
[data-theme="dark"] .badge-outline-primary,
.dark .badge-outline-primary,
body.dark .badge-outline-primary,
body[data-theme="dark"] .badge-outline-primary {
    color: #63b3ed !important;
    border-color: #63b3ed !important;
}

[data-theme="dark"] .badge-outline-secondary,
.dark .badge-outline-secondary,
body.dark .badge-outline-secondary,
body[data-theme="dark"] .badge-outline-secondary {
    color: #a0aec0 !important;
    border-color: #a0aec0 !important;
}

[data-theme="dark"] .badge-outline-success,
.dark .badge-outline-success,
body.dark .badge-outline-success,
body[data-theme="dark"] .badge-outline-success {
    color: #68d391 !important;
    border-color: #68d391 !important;
}

[data-theme="dark"] .badge-outline-danger,
.dark .badge-outline-danger,
body.dark .badge-outline-danger,
body[data-theme="dark"] .badge-outline-danger {
    color: #fc8181 !important;
    border-color: #fc8181 !important;
}

[data-theme="dark"] .badge-outline-warning,
.dark .badge-outline-warning,
body.dark .badge-outline-warning,
body[data-theme="dark"] .badge-outline-warning {
    color: #f6e05e !important;
    border-color: #f6e05e !important;
}

[data-theme="dark"] .badge-outline-info,
.dark .badge-outline-info,
body.dark .badge-outline-info,
body[data-theme="dark"] .badge-outline-info {
    color: #63b3ed !important;
    border-color: #63b3ed !important;
}

[data-theme="dark"] .badge-outline-light,
.dark .badge-outline-light,
body.dark .badge-outline-light,
body[data-theme="dark"] .badge-outline-light {
    color: #e2e8f0 !important;
    border-color: #e2e8f0 !important;
}

[data-theme="dark"] .badge-outline-dark,
.dark .badge-outline-dark,
body.dark .badge-outline-dark,
body[data-theme="dark"] .badge-outline-dark {
    color: #2d3748 !important;
    border-color: #2d3748 !important;
}

/* Dark theme soft colors */
[data-theme="dark"] .badge-soft-primary,
.dark .badge-soft-primary,
body.dark .badge-soft-primary,
body[data-theme="dark"] .badge-soft-primary {
    color: #63b3ed !important;
    background-color: rgba(99, 179, 237, 0.15) !important;
}

[data-theme="dark"] .badge-soft-secondary,
.dark .badge-soft-secondary,
body.dark .badge-soft-secondary,
body[data-theme="dark"] .badge-soft-secondary {
    color: #a0aec0 !important;
    background-color: rgba(160, 174, 192, 0.15) !important;
}

[data-theme="dark"] .badge-soft-success,
.dark .badge-soft-success,
body.dark .badge-soft-success,
body[data-theme="dark"] .badge-soft-success {
    color: #68d391 !important;
    background-color: rgba(104, 211, 145, 0.15) !important;
}

[data-theme="dark"] .badge-soft-danger,
.dark .badge-soft-danger,
body.dark .badge-soft-danger,
body[data-theme="dark"] .badge-soft-danger {
    color: #fc8181 !important;
    background-color: rgba(252, 129, 129, 0.15) !important;
}

[data-theme="dark"] .badge-soft-warning,
.dark .badge-soft-warning,
body.dark .badge-soft-warning,
body[data-theme="dark"] .badge-soft-warning {
    color: #f6e05e !important;
    background-color: rgba(246, 224, 94, 0.15) !important;
}

[data-theme="dark"] .badge-soft-info,
.dark .badge-soft-info,
body.dark .badge-soft-info,
body[data-theme="dark"] .badge-soft-info {
    color: #63b3ed !important;
    background-color: rgba(99, 179, 237, 0.15) !important;
}

/* Dark theme effects */
[data-theme="dark"] .badge-glow,
.dark .badge-glow,
body.dark .badge-glow,
body[data-theme="dark"] .badge-glow {
    box-shadow: 0 0 10px currentColor, 0 0 20px currentColor, 0 0 30px rgba(99, 179, 237, 0.3) !important;
}

[data-theme="dark"] .badge-shadow-sm,
.dark .badge-shadow-sm,
body.dark .badge-shadow-sm,
body[data-theme="dark"] .badge-shadow-sm {
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important;
}

[data-theme="dark"] .badge-shadow-md,
.dark .badge-shadow-md,
body.dark .badge-shadow-md,
body[data-theme="dark"] .badge-shadow-md {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3) !important;
}

[data-theme="dark"] .badge-shadow-lg,
.dark .badge-shadow-lg,
body.dark .badge-shadow-lg,
body[data-theme="dark"] .badge-shadow-lg {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4) !important;
}
.base-badge[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    z-index: 1000;
    opacity: 0;
    animation: baseBadgeTooltipFadeIn 0.3s ease forwards;
    margin-bottom: 0.25rem;
}

@keyframes baseBadgeTooltipFadeIn {
    to { opacity: 1; }
}

@media (max-width: 768px) {
    .base-badge.size-extra-large {
        padding: 0.375rem 0.75rem;
    }

    .base-badge.size-large {
        padding: 0.25rem 0.5rem;
    }
}