/* Efecto de burbuja neumórfico con animación de rebote que se detiene a los 5 segundos */
.avatar-asistencia.activo {
    background: linear-gradient(135deg, #4CAF50 0%, #2E7D32 100%);
    color: white;
    border-radius: 50% !important;
    position: relative;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    
    /* Neumorfismo mejorado */
    box-shadow: 
        inset 3px 3px 5px rgba(46, 125, 50, 0.6),
        inset -3px -3px 5px rgba(102, 187, 106, 0.8),
        8px 8px 20px rgba(46, 125, 50, 0.25),
        -8px -8px 20px rgba(102, 187, 106, 0.4),
        0 0 20px rgba(76, 175, 80, 0.3);
    
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    overflow: hidden;
    z-index: 1;
    
    /* Animación de rebote que se detiene después de 5 segundos */
    animation: bounce 1.2s ease-in-out 4.1667, float-slight 3s ease-in-out 5s infinite;
    /* 4.1667 iteraciones de 1.2s = 5 segundos exactos */
    animation-fill-mode: both;
}

/* Borde decorativo con gradiente */
.avatar-asistencia.activo::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    border-radius: 50%;
    background: linear-gradient(135deg, 
        rgba(76, 175, 80, 0.8) 0%,
        rgba(102, 187, 106, 0.9) 25%,
        rgba(56, 142, 60, 0.8) 50%,
        rgba(102, 187, 106, 0.9) 75%,
        rgba(76, 175, 80, 0.8) 100%);
    z-index: -1;
    animation: border-glow 3s linear infinite, bounce 1.2s ease-in-out 4.1667;
    background-size: 200% 200%;
    animation-fill-mode: both;
}

/* Efecto de brillo interno */
.avatar-asistencia.activo::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.15),
        rgba(255, 255, 255, 0.3),
        rgba(255, 255, 255, 0.15),
        transparent
    );
    transform: skewX(-20deg);
    animation: shine 4s infinite ease-in-out, bounce 1.2s ease-in-out 4.1667;
    animation-delay: 1s, 0s;
    animation-fill-mode: both;
}

/* Anillo exterior pulsante */
.avatar-asistencia.activo .pulse-ring {
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    border-radius: 50%;
    border: 3px solid rgba(76, 175, 80, 0.4);
    animation: pulse-ring 2.5s infinite cubic-bezier(0.215, 0.61, 0.355, 1), 
               bounce 1.2s ease-in-out 4.1667;
    pointer-events: none;
    z-index: -2;
    animation-fill-mode: both;
}

/* Contenido interno */
.avatar-asistencia.activo .avatar-inner {
    position: relative;
    z-index: 3;
    transform: scale(0.95);
    transition: transform 0.3s ease;
    animation: bounce 1.2s ease-in-out 4.1667;
    animation-fill-mode: both;
}

/* Icono */
.avatar-asistencia.activo .icono {
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.3));
    transition: all 0.3s ease;
    animation: bounce 1.2s ease-in-out 4.1667;
    animation-fill-mode: both;
}

/* Efecto de sombra para el rebote */
.avatar-asistencia.activo .shadow-effect {
    position: absolute;
    bottom: -20px;
    left: 50%;
    width: 60%;
    height: 20px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 50%;
    transform: translateX(-50%);
    filter: blur(5px);
    animation: shadow-bounce 1.2s ease-in-out 4.1667;
    animation-fill-mode: both;
    z-index: -3;
}

/* Hover - se activa después de los 5 segundos */
.avatar-asistencia.activo:hover {
    transform: scale(1.12) rotate(8deg);
    box-shadow: 
        inset 2px 2px 4px rgba(46, 125, 50, 0.5),
        inset -2px -2px 4px rgba(102, 187, 106, 0.7),
        12px 12px 28px rgba(46, 125, 50, 0.35),
        -12px -12px 28px rgba(102, 187, 106, 0.5),
        0 0 30px rgba(76, 175, 80, 0.5);
}

.avatar-asistencia.activo:hover .avatar-inner {
    transform: scale(1.05);
}

.avatar-asistencia.activo:hover .icono {
    filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.4));
    transform: scale(1.1);
}

/* Click */
.avatar-asistencia.activo:active {
    transform: scale(1.05) rotate(4deg);
    box-shadow: 
        inset 4px 4px 6px rgba(46, 125, 50, 0.7),
        inset -4px -4px 6px rgba(102, 187, 106, 0.5),
        6px 6px 15px rgba(46, 125, 50, 0.25),
        -6px -6px 15px rgba(102, 187, 106, 0.3);
}

/* ANIMACIONES */

/* Animación de rebote (bounce) - Efecto realista de pelota */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-30px) scale(1.05, 0.95); /* Se estira al caer */
    }
    60% {
        transform: translateY(-15px) scale(0.95, 1.05); /* Se aplasta al impactar */
    }
}

/* Animación de sombra que sincroniza con el rebote */
@keyframes shadow-bounce {
    0%, 100% {
        transform: translateX(-50%) scale(1);
        opacity: 0.5;
    }
    40% {
        transform: translateX(-50%) scale(1.3);
        opacity: 0.3;
    }
    60% {
        transform: translateX(-50%) scale(0.8);
        opacity: 0.7;
    }
}

/* Animación suave de flotación que empieza después de los 5 segundos */
@keyframes float-slight {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-3px);
    }
}

/* Border glow */
@keyframes border-glow {
    0%, 100% {
        background-position: 0% 50%;
        opacity: 1;
    }
    50% {
        background-position: 100% 50%;
        opacity: 0.8;
    }
}

/* Shine effect */
@keyframes shine {
    0%, 100% {
        left: -100%;
        opacity: 0.5;
    }
    10%, 90% {
        opacity: 0.7;
    }
    50% {
        left: 150%;
        opacity: 0.9;
    }
}

/* Pulse ring */
@keyframes pulse-ring {
    0% {
        transform: scale(0.95);
        opacity: 0.8;
        border-width: 4px;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.4;
        border-width: 2px;
    }
    100% {
        transform: scale(0.95);
        opacity: 0.8;
        border-width: 4px;
    }
}

/* Para los otros tipos de asistencia - aplicar misma animación de rebote */

/* Tarde */
.avatar-asistencia.tarde.activo {
    background: linear-gradient(135deg, #FF9800 0%, #F57C00 100%);
    animation: bounce 1.2s ease-in-out 4.1667, float-slight 3s ease-in-out 5s infinite;
    animation-fill-mode: both;
}
.avatar-asistencia.tarde.activo::before {
    background: linear-gradient(135deg, 
        rgba(255, 152, 0, 0.8) 0%,
        rgba(255, 193, 7, 0.9) 25%,
        rgba(245, 124, 0, 0.8) 50%,
        rgba(255, 193, 7, 0.9) 75%,
        rgba(255, 152, 0, 0.8) 100%);
}
.avatar-asistencia.tarde.activo .pulse-ring {
    border-color: rgba(255, 152, 0, 0.4);
}
.avatar-asistencia.tarde.activo {
    box-shadow: 
        inset 3px 3px 5px rgba(197, 108, 0, 0.6),
        inset -3px -3px 5px rgba(255, 213, 79, 0.8),
        8px 8px 20px rgba(197, 108, 0, 0.25),
        -8px -8px 20px rgba(255, 213, 79, 0.4),
        0 0 20px rgba(255, 152, 0, 0.3);
}

/* Fuga */
.avatar-asistencia.fuga.activo {
    background: linear-gradient(135deg, #F44336 0%, #D32F2F 100%);
    animation: bounce 1.2s ease-in-out 4.1667, float-slight 3s ease-in-out 5s infinite;
    animation-fill-mode: both;
}
.avatar-asistencia.fuga.activo::before {
    background: linear-gradient(135deg, 
        rgba(244, 67, 54, 0.8) 0%,
        rgba(239, 154, 154, 0.9) 25%,
        rgba(211, 47, 47, 0.8) 50%,
        rgba(239, 154, 154, 0.9) 75%,
        rgba(244, 67, 54, 0.8) 100%);
}
.avatar-asistencia.fuga.activo .pulse-ring {
    border-color: rgba(244, 67, 54, 0.4);
}
.avatar-asistencia.fuga.activo {
    box-shadow: 
        inset 3px 3px 5px rgba(183, 28, 28, 0.6),
        inset -3px -3px 5px rgba(239, 154, 154, 0.8),
        8px 8px 20px rgba(183, 28, 28, 0.25),
        -8px -8px 20px rgba(239, 154, 154, 0.4),
        0 0 20px rgba(244, 67, 54, 0.3);
}

/* Ausente */
.avatar-asistencia.ausente.activo {
    background: linear-gradient(135deg, #9E9E9E 0%, #616161 100%);
    animation: bounce 1.2s ease-in-out 4.1667, float-slight 3s ease-in-out 5s infinite;
    animation-fill-mode: both;
}
.avatar-asistencia.ausente.activo::before {
    background: linear-gradient(135deg, 
        rgba(158, 158, 158, 0.8) 0%,
        rgba(189, 189, 189, 0.9) 25%,
        rgba(97, 97, 97, 0.8) 50%,
        rgba(189, 189, 189, 0.9) 75%,
        rgba(158, 158, 158, 0.8) 100%);
}
.avatar-asistencia.ausente.activo .pulse-ring {
    border-color: rgba(158, 158, 158, 0.4);
}
.avatar-asistencia.ausente.activo {
    box-shadow: 
        inset 3px 3px 5px rgba(97, 97, 97, 0.6),
        inset -3px -3px 5px rgba(189, 189, 189, 0.8),
        8px 8px 20px rgba(97, 97, 97, 0.25),
        -8px -8px 20px rgba(189, 189, 189, 0.4),
        0 0 20px rgba(158, 158, 158, 0.3);
}

/* Responsive */
@media (max-width: 768px) {
    .avatar-asistencia.activo {
        width: 65px;
        height: 65px;
    }
    
    @keyframes bounce {
        0%, 20%, 50%, 80%, 100% {
            transform: translateY(0);
        }
        40% {
            transform: translateY(-20px) scale(1.05, 0.95);
        }
        60% {
            transform: translateY(-10px) scale(0.95, 1.05);
        }
    }
}

@media (max-width: 480px) {
    .avatar-asistencia.activo {
        width: 55px;
        height: 55px;
    }
    
    @keyframes bounce {
        0%, 20%, 50%, 80%, 100% {
            transform: translateY(0);
        }
        40% {
            transform: translateY(-15px) scale(1.05, 0.95);
        }
        60% {
            transform: translateY(-7px) scale(0.95, 1.05);
        }
    }
}