/* =====================================================
   HEADER CREDITS BADGE - Indicador de creditos restantes
   ===================================================== */

.hm-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px 4px 8px;
    border-radius: 16px;
    font-family: inherit;
    cursor: default;
    margin: 0 4px;
    white-space: nowrap;
    transition: all 0.3s ease;
    animation: hm-fadeIn 0.5s ease;
    flex-shrink: 0;
    height: 30px;
}

.hm-badge:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}

/* Icono SVG del mensaje */
.hm-badge-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* Numero de mensajes */
.hm-badge-count {
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.3px;
}

/* Etiqueta "mensajes" */
.hm-badge-label {
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.85;
}

/* --- Colores por estado --- */

/* Alto: verde */
.hm-badge-high {
    background: rgba(40, 167, 69, 0.18);
    color: #d4f5e0;
    border: 1px solid rgba(40, 167, 69, 0.35);
}

.hm-badge-high .hm-badge-icon {
    color: #5ddb82;
}

/* Medio: amarillo */
.hm-badge-medium {
    background: rgba(255, 193, 7, 0.18);
    color: #fff3cd;
    border: 1px solid rgba(255, 193, 7, 0.35);
}

.hm-badge-medium .hm-badge-icon {
    color: #ffc107;
}

/* Bajo: rojo pulsante */
.hm-badge-low {
    background: rgba(220, 53, 69, 0.20);
    color: #f8d7da;
    border: 1px solid rgba(220, 53, 69, 0.40);
    animation: hm-fadeIn 0.5s ease, hm-pulse-red 2s ease-in-out infinite;
}

.hm-badge-low .hm-badge-icon {
    color: #ff6b7a;
}

/* Vacio: gris */
.hm-badge-empty {
    background: rgba(108, 117, 125, 0.18);
    color: #c0c5ca;
    border: 1px solid rgba(108, 117, 125, 0.30);
    opacity: 0.7;
}

.hm-badge-empty .hm-badge-icon {
    color: #9ba3ab;
}

/* --- Badge Dorado (Créditos y Usuarios) --- */

.hm-badge-credits,
.hm-badge-users {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.30) 0%, rgba(255, 215, 0, 0.22) 50%, rgba(218, 165, 32, 0.30) 100%) !important;
    color: #fff8dc !important;
    border: 1px solid rgba(255, 215, 0, 0.55) !important;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.20), 0 0 4px rgba(255, 215, 0, 0.10), inset 0 1px 0 rgba(255, 255, 255, 0.20);
    animation: hm-fadeIn 0.5s ease, hm-golden-glow 3s ease-in-out infinite;
    position: relative;
    overflow: hidden;
}

.hm-badge-credits .hm-badge-icon,
.hm-badge-users .hm-badge-icon {
    color: #ffd700 !important;
    filter: drop-shadow(0 0 2px rgba(255, 215, 0, 0.40));
}

.hm-badge-credits .hm-badge-count,
.hm-badge-users .hm-badge-count {
    color: #fff8dc !important;
    text-shadow: 0 0 6px rgba(255, 215, 0, 0.35);
}

.hm-badge-credits .hm-badge-label,
.hm-badge-users .hm-badge-label {
    color: #faebd7 !important;
    opacity: 0.9;
}

/* Shimmer sweep dorado */
.hm-badge-credits::after,
.hm-badge-users::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 215, 0, 0.20) 40%, rgba(255, 255, 255, 0.25) 50%, rgba(255, 215, 0, 0.20) 60%, transparent 100%);
    animation: hm-shimmer-sweep 4s ease-in-out infinite;
    pointer-events: none;
    border-radius: inherit;
}

.hm-badge-credits:hover,
.hm-badge-users:hover {
    transform: scale(1.08);
    box-shadow: 0 0 18px rgba(255, 215, 0, 0.40), 0 0 6px rgba(255, 215, 0, 0.20), inset 0 1px 0 rgba(255, 255, 255, 0.25) !important;
}

/* Bajo creditos/usuarios: mantener pulso rojo pero con toque dorado */
.hm-badge-credits.hm-badge-low,
.hm-badge-users.hm-badge-low {
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.22) 0%, rgba(212, 175, 55, 0.15) 100%) !important;
    border: 1px solid rgba(220, 53, 69, 0.45) !important;
    animation: hm-fadeIn 0.5s ease, hm-pulse-red 2s ease-in-out infinite;
}

.hm-badge-credits.hm-badge-low::after,
.hm-badge-users.hm-badge-low::after {
    display: none;
}

/* --- Animaciones --- */

@keyframes hm-fadeIn {
    from { opacity: 0; transform: translateX(-10px) scale(0.9); }
    to { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes hm-pulse-red {
    0%, 100% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0); }
    50% { box-shadow: 0 0 8px 2px rgba(220, 53, 69, 0.25); }
}

@keyframes hm-golden-glow {
    0%, 100% { box-shadow: 0 0 8px rgba(255, 215, 0, 0.18), 0 0 3px rgba(255, 215, 0, 0.10), inset 0 1px 0 rgba(255, 255, 255, 0.18); }
    50% { box-shadow: 0 0 16px rgba(255, 215, 0, 0.38), 0 0 28px rgba(255, 215, 0, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.25); }
}

@keyframes hm-shimmer-sweep {
    0% { left: -100%; }
    30% { left: 100%; }
    100% { left: 100%; }
}

/* --- Responsive: ocultar label en pantallas pequenas --- */
@media (max-width: 768px) {
    .hm-badge-label {
        display: none;
    }
    .hm-badge {
        padding: 5px 10px;
    }
}
