/* =============================================
   Badge de audiencia — esquina inferior derecha
   Aparece con barrido al hacer hover y destello
   ============================================= */
.badge-audiencia {
    position: absolute;
    bottom: 0;
    right: 0;
    left: auto;
    top: auto;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    white-space: nowrap;
    pointer-events: none;
    border-radius: 10px 0 0 0;
    z-index: 10;
    transform: translateX(110%);
    opacity: 0;
    overflow: hidden; /* Crucial para que el rayo de luz interior no se salga del badge */
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
                opacity 0.35s ease;
}

/* Al hacer hover, activamos la traslación y las animaciones de brillo neón */
.card:hover .badge-audiencia {
    transform: translateX(0);
    opacity: 1;
}

/* ── NUEVO: Rayo de luz diagonal pasando por dentro del encapsulador ── */
.badge-audiencia::before {
    content: '';
    position: absolute;
    top: 0;
    left: -150%;
    width: 80%;
    height: 100%;
    background: linear-gradient(
        to right,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.6) 50%,
        rgba(255, 255, 255, 0) 100-px
    );
    transform: skewX(-25deg);
    pointer-events: none;
    z-index: 1;
}
.card:hover .badge-audiencia::before {
    /* El rayo cruza el badge con un pequeño retraso para cuando ya esté visible */
    animation: brilloEncapsulador 1s ease-in-out 0.3s infinite;
}

@keyframes brilloEncapsulador {
    0% { left: -150%; }
    50%, 100% { left: 150%; } /* Pasa una vez y espera antes de repetir */
}

/* Variante PSICÓLOGOS — morado con pulso neón */
.badge-audiencia.badge-psicologos {
    background: #6a0dad;
    color: #e8c4ff;
    box-shadow: 0 0 0 rgba(176, 96, 255, 0);
}
.card:hover .badge-audiencia.badge-psicologos {
    animation: pulsoNeonMorado 2s infinite alternate 0.4s;
}

@keyframes pulsoNeonMorado {
    0% {
        box-shadow: -2px -2px 8px rgba(106, 13, 173, 0.5),
                    inset 0 0 4px rgba(232, 196, 255, 0.2);
    }
    100% {
        box-shadow: -4px -4px 20px rgba(176, 96, 255, 0.9),
                    inset 0 0 12px rgba(232, 196, 255, 0.6);
    }
}

/* Variante PÚBLICO GENERAL — cyan con pulso neón */
.badge-audiencia.badge-publico {
    background: #0891b2;
    color: #cff8ff;
    box-shadow: 0 0 0 rgba(0, 212, 240, 0);
}
.card:hover .badge-audiencia.badge-publico {
    animation: pulsoNeonCyan 2s infinite alternate 0.4s;
}

@keyframes pulsoNeonCyan {
    0% {
        box-shadow: -2px -2px 8px rgba(8, 145, 178, 0.5),
                    inset 0 0 4px rgba(207, 248, 255, 0.2);
    }
    100% {
        box-shadow: -4px -4px 20px rgba(0, 212, 240, 0.9),
                    inset 0 0 12px rgba(207, 248, 255, 0.6);
    }
}

/* Asegura que el texto e ícono queden por encima del rayo de luz */
.badge-audiencia .badge-icon,
.badge-audiencia .badge-label {
    position: relative;
    z-index: 2;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.4);
}

.badge-audiencia .badge-icon {
    font-size: 15px;
    line-height: 1;
}

/* ── Brillo deslizante sobre la imagen al hover ── */
.card-img-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    left: -80%;
    width: 55%;
    height: 100%;
    background: linear-gradient(
        to right,
        rgba(255,255,255,0)   0%,
        rgba(255,255,255,0.3) 50%,
        rgba(255,255,255,0)   100%
    );
    transform: skewX(-18deg);
    pointer-events: none;
    z-index: 5;
    opacity: 0;
}

.card:hover .card-img-wrapper::after {
    opacity: 1;
    animation: barraLuz 0.6s ease forwards;
}

@keyframes barraLuz {
    0%   { left: -80%; }
    100% { left: 130%; }
}

/* ── Contenedor de estrellas ── */
.stars-container {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 160px;
    height: 60px;
    pointer-events: none;
    z-index: 12;
    overflow: visible; 
    opacity: 0;
    transition: opacity 0.2s ease;
}

.card:hover .stars-container {
    opacity: 1;
}

/* ── Estrella individual básica ── */
.star-particle {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    filter: perspective(1px) translateZ(0);
}

/* Estrellas para psicólogos — Morado Neón Intenso */
.badge-psicologos-stars .star-particle {
    background: #e8c4ff;
    filter: drop-shadow(0 0 6px #b060ff) drop-shadow(0 0 12px #6a0dad);
}

/* Estrellas para público general — Cyan Neón Eléctrico */
.badge-publico-stars .star-particle {
    background: #cff8ff;
    filter: drop-shadow(0 0 6px #00d4f0) drop-shadow(0 0 12px #0891b2);
}

/* ── Animaciones de trayectoria ── */
@keyframes starFly1 {
    0%   { transform: translate(0, 0) scale(0) rotate(0deg); opacity: 0; }
    15%  { opacity: 1; }
    100% { transform: translate(-100px, -120px) scale(1.4) rotate(180deg); opacity: 0; }
}
@keyframes starFly2 {
    0%   { transform: translate(0, 0) scale(0) rotate(0deg); opacity: 0; }
    15%  { opacity: 1; }
    100% { transform: translate(-50px, -160px) scale(1) rotate(-120deg); opacity: 0; }
}
@keyframes starFly3 {
    0%   { transform: translate(0, 0) scale(0) rotate(0deg); opacity: 0; }
    15%  { opacity: 1; }
    100% { transform: translate(-160px, -80px) scale(1.3) rotate(240deg); opacity: 0; }
}
@keyframes starFly4 {
    0%   { transform: translate(0, 0) scale(0) rotate(0deg); opacity: 0; }
    20%  { opacity: 1; }
    100% { transform: translate(-80px, -200px) scale(1.5) rotate(-180deg); opacity: 0; }
}
@keyframes starFly5 {
    0%   { transform: translate(0, 0) scale(0) rotate(0deg); opacity: 0; }
    10%  { opacity: 1; }
    100% { transform: translate(-200px, -60px) scale(1.1) rotate(90deg); opacity: 0; }
}
@keyframes starFly6 {
    0%   { transform: translate(0, 0) scale(0) rotate(0deg); opacity: 0; }
    15%  { opacity: 1; }
    100% { transform: translate(-30px, -100px) scale(1.3) rotate(-90deg); opacity: 0; }
}
@keyframes starFly7 {
    0%   { transform: translate(0, 0) scale(0) rotate(0deg); opacity: 0; }
    15%  { opacity: 1; }
    100% { transform: translate(-130px, -140px) scale(0.9) rotate(145deg); opacity: 0; }
}
@keyframes starFly8 {
    0%   { transform: translate(0, 0) scale(0) rotate(0deg); opacity: 0; }
    20%  { opacity: 1; }
    100% { transform: translate(-90px, -70px) scale(1.4) rotate(-60deg); opacity: 0; }
}

/* ── Posiciones de origen y asignación de tiempos ── */
.card:hover .star-particle:nth-child(1) { bottom: 15px; right: 20px; animation: starFly1 1.1s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.15s forwards; }
.card:hover .star-particle:nth-child(2) { bottom: 10px; right: 40px; animation: starFly2 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.22s forwards; }
.card:hover .star-particle:nth-child(3) { bottom: 20px; right: 60px; animation: cubic-bezier(0.25, 0.46, 0.45, 0.94) 1.0s starFly3 0.26s forwards; }
.card:hover .star-particle:nth-child(4) { bottom: 5px;  right: 80px; animation: starFly4 1.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.18s forwards; }
.card:hover .star-particle:nth-child(5) { bottom: 25px; right: 30px; animation: starFly5 1.15s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.28s forwards; }
.card:hover .star-particle:nth-child(6) { bottom: 12px; right: 50px; animation: starFly6 1.05s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.12s forwards; }
.card:hover .star-particle:nth-child(7) { bottom: 8px;  right: 70px; animation: starFly7 1.25s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.24s forwards; }
.card:hover .star-particle:nth-child(8) { bottom: 22px; right: 90px; animation: starFly8 1.1s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.20s forwards; }

/* ── ESTRELLA TRADICIONAL CLÁSICA ── */
.star-particle:nth-child(odd) {
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
    width: 22px;
    height: 22px;
}

/* ── DESTELLO DE CUATRO PUNTAS ── */
.star-particle:nth-child(even) {
    clip-path: polygon(50% 0%, 54% 46%, 100% 50%, 54% 54%, 50% 100%, 46% 54%, 0% 50%, 46% 46%);
    width: 18px;
    height: 18px;
}