/**
 * D-One Platform - Badge Component System
 * 
 * Sistema unificato per badge status e count
 * Versione: 1.0
 * Data: 2025-10-19
 * 
 * Uso:
 * <span class="badge badge-active">Attivo</span>
 * <span class="badge-count">12</span>
 */

/* BASE BADGE */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.2;
    white-space: nowrap;
}

/* STATUS BADGES */
.badge-active,
.status-active {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-development,
.status-development {
    background: rgba(251, 191, 36, 0.1);
    color: #f59e0b;
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.badge-inactive,
.status-inactive {
    background: rgba(107, 114, 128, 0.1);
    color: #6b7280;
    border: 1px solid rgba(107, 114, 128, 0.3);
}

.badge-beta {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.badge-new {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-deprecated {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-super,
.status-super {
    background: rgba(148, 88, 207, 0.1);
    color: #9458cf;
    border: 1px solid rgba(148, 88, 207, 0.3);
}

/* COUNT BADGE (per navigazione) */
.badge-count,
.service-count,
.agent-count {
    background: var(--primary);
    color: white;
    padding: 0.1rem 0.3rem;
    border-radius: 8px;
    font-size: 0.65rem;
    font-weight: 600;
    margin-left: 0.3rem;
    min-width: 1.2rem;
    text-align: center;
    display: inline-block;
    line-height: 1.2;
}

/* Count badge in active navigation item */
.quick-nav-item.active .badge-count,
.quick-nav-item.active .service-count,
.quick-nav-item.active .agent-count {
    background: var(--primary-light);
    color: var(--primary);
}

/* CATEGORY BADGE */
.badge-category,
.card-category {
    display: inline-block;
    background: var(--primary-light);
    color: var(--primary);
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid rgba(108, 92, 231, 0.2);
    width: auto;           /* Force inline sizing */
    max-width: none;       /* Remove any width constraints */
}

/* SERVICE BADGE (deprecato, usare badge-category) */
.service-badge {
    display: inline-block;
    background: var(--primary-light);
    color: var(--primary);
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid rgba(108, 92, 231, 0.2);
    width: auto;           /* Force inline sizing */
    max-width: none;       /* Remove any width constraints */
}

/* BADGE GROUP */
.badge-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.badge-group .badge {
    margin-bottom: 0;
}

/* SIZE VARIANTS */
.badge-sm {
    padding: 0.15rem 0.5rem;
    font-size: 0.65rem;
    border-radius: 8px;
}

.badge-lg {
    padding: 0.35rem 0.9rem;
    font-size: 0.85rem;
    border-radius: 14px;
}

/* DOT INDICATOR */
.badge-dot {
    padding-left: 1.25rem;
    position: relative;
}

.badge-dot::before {
    content: '';
    position: absolute;
    left: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.badge-dot.pulse::before {
    animation: badge-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes badge-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* THEME VARIANTS */
.badge[data-theme="success"] {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge[data-theme="warning"] {
    background: rgba(251, 191, 36, 0.1);
    color: #f59e0b;
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.badge[data-theme="error"] {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge[data-theme="info"] {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

/* SOLID VARIANTS */
.badge-solid {
    border: none;
}

.badge-solid.badge-active {
    background: #10b981;
    color: white;
}

.badge-solid.badge-development {
    background: #f59e0b;
    color: white;
}

.badge-solid.badge-inactive {
    background: #6b7280;
    color: white;
}

/* POSITIONED BADGES (per card status) */
.badge-positioned {
    position: absolute;
    top: 1rem;
    right: 1rem;
}

.card-status {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* AGENT STATUS - vertical stacking for multiple badges */
.agent-status {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
    z-index: 10;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .badge {
        font-size: 0.7rem;
        padding: 0.2rem 0.6rem;
    }
    
    .badge-group {
        gap: 0.35rem;
    }
}

/* BACKWARDS COMPATIBILITY */
.status-badge {
    /* Redirect to .badge */
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
